@syncfusion/ej2-vue-base 20.4.51 → 21.1.36
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 +12 -0
- package/dist/ej2-vue-base.umd.min.js +2 -12
- package/dist/ej2-vue-base.umd.min.js.map +1 -1
- package/dist/es6/ej2-vue-base.es2015.js +465 -528
- package/dist/es6/ej2-vue-base.es2015.js.map +1 -1
- package/dist/es6/ej2-vue-base.es5.js +505 -578
- 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 +26 -9
- package/postinstall.js +1 -119
- package/src/component-base.d.ts +4 -48
- package/src/component-base.js +448 -441
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/template.js +64 -5
- package/GitLeaksReport.json +0 -1
- package/gitleaks-ci/gitleaks +0 -0
- package/gitleaks-ci.tar.gz +0 -0
- package/src/component-decorator.d.ts +0 -4
- package/src/component-decorator.js +0 -144
|
@@ -1,62 +1,43 @@
|
|
|
1
|
+
import * as Vue from 'vue';
|
|
1
2
|
import { createElement, detach, extend, getTemplateEngine, getUniqueID, getValue, isNullOrUndefined, setTemplateEngine } from '@syncfusion/ej2-base';
|
|
2
|
-
import { Vue } from 'vue-class-component';
|
|
3
|
-
import * as Vue$1 from 'vue';
|
|
4
|
-
import Vue$1__default from 'vue';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* Vue Component Base
|
|
8
6
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
extendStatics = Object.setPrototypeOf ||
|
|
12
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
13
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
14
|
-
return extendStatics(d, b);
|
|
15
|
-
};
|
|
16
|
-
return function (d, b) {
|
|
17
|
-
extendStatics(d, b);
|
|
18
|
-
function __() { this.constructor = d; }
|
|
19
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
20
|
-
};
|
|
21
|
-
})();
|
|
22
|
-
var aVue = _interopRequireWildcard(Vue$1);
|
|
23
|
-
function _interopRequireWildcard(obj) {
|
|
24
|
-
if (obj && obj.__esModule) {
|
|
25
|
-
return obj;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
var newObj = {};
|
|
29
|
-
if (obj != null) {
|
|
30
|
-
for (var key in obj) {
|
|
31
|
-
if (Object.prototype.hasOwnProperty.call(obj, key))
|
|
32
|
-
newObj["" + key] = obj["" + key];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
newObj.default = obj;
|
|
36
|
-
return newObj;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
var allVue = aVue;
|
|
40
|
-
var gh = allVue.h;
|
|
41
|
-
var isExecute = (parseInt(allVue.version) > 2) ? false : true;
|
|
42
|
-
var vueImport;
|
|
43
|
-
if (!isExecute || parseInt(allVue.version) < 3) {
|
|
44
|
-
vueImport = Vue;
|
|
7
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) {
|
|
8
|
+
return obj;
|
|
45
9
|
}
|
|
46
10
|
else {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
_this.hasInjectedModules = false;
|
|
54
|
-
_this.hasChildDirective = false;
|
|
55
|
-
_this.childDirObjects = '';
|
|
56
|
-
_this.isDecorator = false;
|
|
57
|
-
return _this;
|
|
11
|
+
var newObj = {};
|
|
12
|
+
if (obj != null) {
|
|
13
|
+
for (var key in obj) {
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(obj, key))
|
|
15
|
+
newObj["" + key] = obj["" + key];
|
|
16
|
+
}
|
|
58
17
|
}
|
|
59
|
-
|
|
18
|
+
newObj.default = obj;
|
|
19
|
+
return newObj;
|
|
20
|
+
} }
|
|
21
|
+
var curVue = _interopRequireWildcard(Vue);
|
|
22
|
+
var isExecute = (parseInt(curVue['version']) > 2) ? false : true;
|
|
23
|
+
var aVue = !isExecute ? curVue : curVue['default'];
|
|
24
|
+
var gh = curVue['h'];
|
|
25
|
+
var vueDefineComponent = function (options) { return !isExecute ? aVue['defineComponent'](options) : aVue['extend'](options); };
|
|
26
|
+
var ComponentBase = vueDefineComponent({
|
|
27
|
+
name: 'ComponentBase',
|
|
28
|
+
data: function () {
|
|
29
|
+
return {
|
|
30
|
+
ej2Instances: {},
|
|
31
|
+
tagMapper: {},
|
|
32
|
+
tagNameMapper: {},
|
|
33
|
+
hasInjectedModules: false,
|
|
34
|
+
hasChildDirective: false,
|
|
35
|
+
childDirObjects: '',
|
|
36
|
+
propKeys: {},
|
|
37
|
+
isDecorator: false
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
created: function () {
|
|
60
41
|
var _this = this;
|
|
61
42
|
if (!this.propKeys) {
|
|
62
43
|
return;
|
|
@@ -95,8 +76,8 @@ var ComponentBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
95
76
|
}
|
|
96
77
|
this.ej2Instances.injectedModules = prevModule;
|
|
97
78
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
79
|
+
},
|
|
80
|
+
mounted: function () {
|
|
100
81
|
var cusEle = this.$el ? this.$el.querySelectorAll("div.e-directive") : null;
|
|
101
82
|
if (!isExecute && cusEle) {
|
|
102
83
|
for (var i = 0; i < cusEle.length; i++) {
|
|
@@ -112,79 +93,8 @@ var ComponentBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
112
93
|
this.setModelValue();
|
|
113
94
|
}
|
|
114
95
|
this.ej2Instances.appendTo(this.$el);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (!isNullOrUndefined(this.modelValue) || !isNullOrUndefined(this.$attrs.modelValue)) {
|
|
118
|
-
var key = this.models.toString().match(/checked|value/) || [];
|
|
119
|
-
var propKey = key[0];
|
|
120
|
-
if (!isNullOrUndefined(propKey)) {
|
|
121
|
-
this.ej2Instances["" + propKey] = !isNullOrUndefined(this.modelValue) ? this.modelValue : this.$attrs.modelValue;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
ComponentBase.prototype.getInjectedServices = function () {
|
|
126
|
-
var ret = [];
|
|
127
|
-
var provide;
|
|
128
|
-
if (this.$root && this.isDecorator) {
|
|
129
|
-
provide = getValue('$root.$options.provide', this);
|
|
130
|
-
}
|
|
131
|
-
else if (this.$vnode) {
|
|
132
|
-
provide = getValue('$vnode.context.$options.provide', this);
|
|
133
|
-
}
|
|
134
|
-
else if (this.$parent) {
|
|
135
|
-
provide = getValue('$parent.$options.provide', this);
|
|
136
|
-
}
|
|
137
|
-
if (isNullOrUndefined(provide) && !isNullOrUndefined(this.$)) {
|
|
138
|
-
provide = getValue('$.parent.provides', this);
|
|
139
|
-
}
|
|
140
|
-
if (provide) {
|
|
141
|
-
// tslint:disable:no-any
|
|
142
|
-
var injectables = provide;
|
|
143
|
-
if (typeof provide === 'function') {
|
|
144
|
-
if (provide.managed) {
|
|
145
|
-
var provideKey = provide.managed;
|
|
146
|
-
var provideValue = Object.keys(provideKey);
|
|
147
|
-
var key = void 0;
|
|
148
|
-
if (this.$root && this.isDecorator) {
|
|
149
|
-
key = Object.keys(this.$root);
|
|
150
|
-
}
|
|
151
|
-
else if (this.$vnode) {
|
|
152
|
-
key = Object.keys(this.$vnode.context);
|
|
153
|
-
}
|
|
154
|
-
else if (this.$parent) {
|
|
155
|
-
key = Object.keys(this.$parent);
|
|
156
|
-
}
|
|
157
|
-
for (var i = 0; i < provideValue.length; i++) {
|
|
158
|
-
for (var j = 0; j < key.length; j++) {
|
|
159
|
-
if ((key[parseInt(j.toString(), 10)].indexOf(provideValue[parseInt(i.toString(), 10)])) !== -1) {
|
|
160
|
-
if (this.$root && this.isDecorator) {
|
|
161
|
-
provideKey[provideValue[parseInt(j.toString(), 10)]] = this.$root[key[parseInt(i.toString(), 10)]];
|
|
162
|
-
}
|
|
163
|
-
else if (this.$vnode) {
|
|
164
|
-
provideKey[provideValue[parseInt(i.toString(), 10)]] = this.$vnode.context[key[parseInt(j.toString(), 10)]];
|
|
165
|
-
}
|
|
166
|
-
else if (this.$parent) {
|
|
167
|
-
provideKey[provideValue[parseInt(i.toString(), 10)]] = this.$parent[key[parseInt(j.toString(), 10)]];
|
|
168
|
-
}
|
|
169
|
-
injectables = provideKey;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
// tslint:disable:no-any
|
|
175
|
-
else if (this.$vnode) {
|
|
176
|
-
injectables = this.$vnode.context.$options.provide();
|
|
177
|
-
}
|
|
178
|
-
else if (this.$parent) {
|
|
179
|
-
injectables = this.$parent.$options.provide();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
ret = injectables[this.ej2Instances.getModuleName()] || [];
|
|
183
|
-
}
|
|
184
|
-
this.isDecorator = false;
|
|
185
|
-
return ret;
|
|
186
|
-
};
|
|
187
|
-
ComponentBase.prototype.updated = function () {
|
|
96
|
+
},
|
|
97
|
+
updated: function () {
|
|
188
98
|
if (this.isVue3) {
|
|
189
99
|
this.setModelValue();
|
|
190
100
|
}
|
|
@@ -197,399 +107,460 @@ var ComponentBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
197
107
|
this.assignValueToWrapper(childKey, false);
|
|
198
108
|
}
|
|
199
109
|
}
|
|
200
|
-
}
|
|
201
|
-
|
|
110
|
+
},
|
|
111
|
+
beforeDestroy: function () {
|
|
202
112
|
this.destroyComponent();
|
|
203
|
-
}
|
|
204
|
-
|
|
113
|
+
},
|
|
114
|
+
beforeUnmount: function () {
|
|
205
115
|
this.destroyComponent();
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
var options = {};
|
|
215
|
-
for (var _i = 0, _a = this.propKeys; _i < _a.length; _i++) {
|
|
216
|
-
var prop = _a[_i];
|
|
217
|
-
if ((!isNullOrUndefined(this["" + prop]) && !this.isVue3) || (this[0] && !isNullOrUndefined(this[0][0]) && !isNullOrUndefined(this[0][0]["" + prop]))) {
|
|
218
|
-
options["" + prop] = !this.isVue3 ? this["" + prop] : this[0][0]["" + prop];
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
if (this.hasChildDirective) {
|
|
222
|
-
this.fetchChildPropValues(options);
|
|
223
|
-
}
|
|
224
|
-
if (this.hasInjectedModules) {
|
|
225
|
-
var prevModule = this.getInjectedServices() || [];
|
|
226
|
-
var curModule = this.ej2Instances.getInjectedModules() || [];
|
|
227
|
-
for (var _b = 0, curModule_2 = curModule; _b < curModule_2.length; _b++) {
|
|
228
|
-
var mod = curModule_2[_b];
|
|
229
|
-
if (prevModule.indexOf(mod) === -1) {
|
|
230
|
-
prevModule.push(mod);
|
|
116
|
+
},
|
|
117
|
+
methods: {
|
|
118
|
+
setModelValue: function () {
|
|
119
|
+
if (!isNullOrUndefined(this.modelValue) || !isNullOrUndefined(this.$attrs.modelValue)) {
|
|
120
|
+
var key = this.models.toString().match(/checked|value/) || [];
|
|
121
|
+
var propKey = key[0];
|
|
122
|
+
if (!isNullOrUndefined(propKey)) {
|
|
123
|
+
this.ej2Instances["" + propKey] = !isNullOrUndefined(this.modelValue) ? this.modelValue : this.$attrs.modelValue;
|
|
231
124
|
}
|
|
232
125
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
var key =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
var splitKeys = key.split('-');
|
|
260
|
-
var controlName = this.ej2Instances.getModuleName().toLowerCase();
|
|
261
|
-
var keyRef = (splitKeys.length > 1 && controlName.indexOf(splitKeys[0]) > -1) ? splitKeys[1] : splitKeys[0];
|
|
262
|
-
keyRef = keyRef.replace(controlName, '');
|
|
263
|
-
if (controlName == "splitter" && keyRef == "panes") {
|
|
264
|
-
keyRef = "paneSettings";
|
|
126
|
+
},
|
|
127
|
+
getInjectedServices: function () {
|
|
128
|
+
var ret = [];
|
|
129
|
+
var provide;
|
|
130
|
+
if (this.$root && this.isDecorator) {
|
|
131
|
+
provide = getValue('$root.$options.provide', this);
|
|
132
|
+
}
|
|
133
|
+
else if (this.$vnode) {
|
|
134
|
+
provide = getValue('$vnode.context.$options.provide', this);
|
|
135
|
+
}
|
|
136
|
+
else if (this.$parent) {
|
|
137
|
+
provide = getValue('$parent.$options.provide', this);
|
|
138
|
+
}
|
|
139
|
+
if (isNullOrUndefined(provide) && !isNullOrUndefined(this.$)) {
|
|
140
|
+
provide = getValue('$.parent.provides', this);
|
|
141
|
+
}
|
|
142
|
+
if (provide) {
|
|
143
|
+
// tslint:disable:no-any
|
|
144
|
+
var injectables = provide;
|
|
145
|
+
if (typeof provide === 'function') {
|
|
146
|
+
if (provide.managed) {
|
|
147
|
+
var provideKey = provide.managed;
|
|
148
|
+
var provideValue = Object.keys(provideKey);
|
|
149
|
+
var key = void 0;
|
|
150
|
+
if (this.$root && this.isDecorator) {
|
|
151
|
+
key = Object.keys(this.$root);
|
|
265
152
|
}
|
|
266
|
-
else if (
|
|
267
|
-
|
|
153
|
+
else if (this.$vnode) {
|
|
154
|
+
key = Object.keys(this.$vnode.context);
|
|
268
155
|
}
|
|
269
|
-
else if (
|
|
270
|
-
|
|
156
|
+
else if (this.$parent) {
|
|
157
|
+
key = Object.keys(this.$parent);
|
|
158
|
+
}
|
|
159
|
+
for (var i = 0; i < provideValue.length; i++) {
|
|
160
|
+
for (var j = 0; j < key.length; j++) {
|
|
161
|
+
if ((key[parseInt(j.toString(), 10)].indexOf(provideValue[parseInt(i.toString(), 10)])) !== -1) {
|
|
162
|
+
if (this.$root && this.isDecorator) {
|
|
163
|
+
provideKey[provideValue[parseInt(j.toString(), 10)]] = this.$root[key[parseInt(i.toString(), 10)]];
|
|
164
|
+
}
|
|
165
|
+
else if (this.$vnode) {
|
|
166
|
+
provideKey[provideValue[parseInt(i.toString(), 10)]] = this.$vnode.context[key[parseInt(j.toString(), 10)]];
|
|
167
|
+
}
|
|
168
|
+
else if (this.$parent) {
|
|
169
|
+
provideKey[provideValue[parseInt(i.toString(), 10)]] = this.$parent[key[parseInt(j.toString(), 10)]];
|
|
170
|
+
}
|
|
171
|
+
injectables = provideKey;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
271
174
|
}
|
|
272
|
-
|
|
175
|
+
}
|
|
176
|
+
// tslint:disable:no-any
|
|
177
|
+
else if (this.$vnode) {
|
|
178
|
+
injectables = this.$vnode.context.$options.provide();
|
|
179
|
+
}
|
|
180
|
+
else if (this.$parent) {
|
|
181
|
+
injectables = this.$parent.$options.provide();
|
|
273
182
|
}
|
|
274
183
|
}
|
|
184
|
+
ret = injectables[this.ej2Instances.getModuleName()] || [];
|
|
185
|
+
}
|
|
186
|
+
this.isDecorator = false;
|
|
187
|
+
return ret;
|
|
188
|
+
},
|
|
189
|
+
destroyComponent: function () {
|
|
190
|
+
var tempBeforeDestroyThis = this;
|
|
191
|
+
tempBeforeDestroyThis.ej2Instances.destroy();
|
|
192
|
+
tempBeforeDestroyThis.$el.style.visibility = 'hidden';
|
|
193
|
+
tempBeforeDestroyThis = null;
|
|
194
|
+
},
|
|
195
|
+
bindProperties: function () {
|
|
196
|
+
var options = {};
|
|
197
|
+
for (var _i = 0, _a = this.propKeys; _i < _a.length; _i++) {
|
|
198
|
+
var prop = _a[_i];
|
|
199
|
+
if (!isNullOrUndefined(this["" + prop])) {
|
|
200
|
+
options["" + prop] = this["" + prop];
|
|
201
|
+
}
|
|
202
|
+
else if (this[0] && !isNullOrUndefined(this[0][0]) && !isNullOrUndefined(this[0][0]["" + prop])) {
|
|
203
|
+
options["" + prop] = this[0][0]["" + prop];
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (this.hasChildDirective) {
|
|
207
|
+
this.fetchChildPropValues(options);
|
|
208
|
+
}
|
|
209
|
+
if (this.hasInjectedModules) {
|
|
210
|
+
var prevModule = this.getInjectedServices() || [];
|
|
211
|
+
var curModule = this.ej2Instances.getInjectedModules() || [];
|
|
212
|
+
for (var _b = 0, curModule_2 = curModule; _b < curModule_2.length; _b++) {
|
|
213
|
+
var mod = curModule_2[_b];
|
|
214
|
+
if (prevModule.indexOf(mod) === -1) {
|
|
215
|
+
prevModule.push(mod);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
this.ej2Instances.injectedModules = prevModule;
|
|
275
219
|
}
|
|
276
|
-
|
|
277
|
-
|
|
220
|
+
this.assignValueToWrapper(options);
|
|
221
|
+
},
|
|
222
|
+
assignValueToWrapper: function (option, silent) {
|
|
223
|
+
this.ej2Instances.setProperties(extend({}, {}, option, true), isNullOrUndefined(silent) ? true : silent);
|
|
224
|
+
},
|
|
225
|
+
fetchChildPropValues: function (childOption) {
|
|
226
|
+
var dirProps = {};
|
|
227
|
+
if (!this.isVue3) {
|
|
228
|
+
dirProps = this.getDirectiveValues(this.$slots.default, this.tagMapper || {}, this.tagNameMapper || {});
|
|
278
229
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
230
|
+
else {
|
|
231
|
+
var propRef = void 0;
|
|
232
|
+
if (this[0] && this[0][1].slots.default) {
|
|
233
|
+
propRef = this[0][1].slots.default();
|
|
234
|
+
}
|
|
235
|
+
else if (this && this.$ && this.$.slots && this.$.slots.default) {
|
|
236
|
+
propRef = this.$.slots.default();
|
|
237
|
+
}
|
|
238
|
+
if (propRef) {
|
|
239
|
+
for (var i = 0; i < propRef.length; i++) {
|
|
240
|
+
if (propRef[parseInt(i.toString(), 10)].type.methods || propRef[parseInt(i.toString(), 10)].type === 'e-seriescollection') {
|
|
241
|
+
var key = propRef[parseInt(i.toString(), 10)].type === 'e-seriescollection' ? 'series-collection' :
|
|
242
|
+
propRef[parseInt(i.toString(), 10)].type.methods.getTag().replace("e-", "");
|
|
243
|
+
var ref = this.resolveArrayDirectives(propRef[parseInt(i.toString(), 10)].children, key);
|
|
244
|
+
var splitKeys = key.split('-');
|
|
245
|
+
var controlName = this.ej2Instances.getModuleName().toLowerCase();
|
|
246
|
+
var keyRef = (splitKeys.length > 1 && controlName.indexOf(splitKeys[0]) > -1) ? splitKeys[1] : splitKeys[0];
|
|
247
|
+
keyRef = keyRef.replace(controlName, '');
|
|
248
|
+
if (controlName == "splitter" && keyRef == "panes") {
|
|
249
|
+
keyRef = "paneSettings";
|
|
250
|
+
}
|
|
251
|
+
else if (controlName == "bulletchart" && keyRef == "range") {
|
|
252
|
+
keyRef = "ranges";
|
|
253
|
+
}
|
|
254
|
+
else if (controlName == "schedule" && keyRef == "header") {
|
|
255
|
+
keyRef = "headerRows";
|
|
256
|
+
}
|
|
257
|
+
dirProps["" + keyRef] = ref["" + key];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
302
260
|
}
|
|
303
261
|
else {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (!this.childDirObjects) {
|
|
266
|
+
this.childDirObjects = JSON.stringify(dirProps);
|
|
267
|
+
}
|
|
268
|
+
for (var _i = 0, _a = Object.keys(dirProps); _i < _a.length; _i++) {
|
|
269
|
+
var dirProp = _a[_i];
|
|
270
|
+
childOption["" + dirProp] = dirProps["" + dirProp];
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
resolveArrayDirectives: function (slots, tagName) {
|
|
274
|
+
var slot = [];
|
|
275
|
+
var innerDirValues;
|
|
276
|
+
slot = slots.default ? slots.default() : slots;
|
|
277
|
+
var items = {};
|
|
278
|
+
items["" + tagName] = [];
|
|
279
|
+
var _loop_2 = function (childSlot) {
|
|
280
|
+
var tempObj = {};
|
|
281
|
+
var tagRef = childSlot.type.methods ? childSlot.type.methods.getTag() : tagName;
|
|
282
|
+
if (childSlot.children) {
|
|
283
|
+
var key = void 0;
|
|
284
|
+
innerDirValues = this_2.resolveComplexDirs(childSlot.children, this_2.tagMapper["e-" + tagName], tagRef);
|
|
285
|
+
if (innerDirValues.length) {
|
|
286
|
+
tempObj = innerDirValues;
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
for (var i = 0; i < Object.keys(innerDirValues).length; i++) {
|
|
290
|
+
key = Object.keys(innerDirValues)[parseInt(i.toString(), 10)];
|
|
291
|
+
tempObj["" + key] = innerDirValues["" + key];
|
|
292
|
+
}
|
|
307
293
|
}
|
|
308
|
-
|
|
309
294
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
295
|
+
if (childSlot.props) {
|
|
296
|
+
Object.keys(childSlot.props).forEach(function (key) {
|
|
297
|
+
var propName = key.replace(/-[a-z]/g, function (e) { return e[1].toUpperCase(); });
|
|
298
|
+
if (propName) {
|
|
299
|
+
tempObj["" + propName] = childSlot.props["" + key];
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
if (((/[s]\b/).test(tagRef) && innerDirValues) && (!(/[s]\b/).test(tagName) || innerDirValues.length)) {
|
|
304
|
+
items["" + tagName] = tempObj;
|
|
305
|
+
}
|
|
306
|
+
else if (tempObj && Object.keys(tempObj).length !== 0) {
|
|
307
|
+
items["" + tagName].push(tempObj);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
var this_2 = this;
|
|
311
|
+
for (var _i = 0, slot_1 = slot; _i < slot_1.length; _i++) {
|
|
312
|
+
var childSlot = slot_1[_i];
|
|
313
|
+
_loop_2(childSlot);
|
|
314
|
+
}
|
|
315
|
+
return items;
|
|
316
|
+
},
|
|
317
|
+
resolveComplexDirs: function (slots, tagObject, tagName) {
|
|
318
|
+
var slot = [];
|
|
319
|
+
var innerDirValues;
|
|
320
|
+
slot = slots.default ? slots.default() : slots;
|
|
321
|
+
var items = {};
|
|
322
|
+
var _loop_3 = function (childSlot) {
|
|
323
|
+
var tagRef = void 0;
|
|
324
|
+
var tag = void 0;
|
|
325
|
+
if (tagObject["" + tagName]) {
|
|
326
|
+
tagRef = Object.keys(tagObject["" + tagName]);
|
|
327
|
+
tag = tagRef.find(function (key) {
|
|
328
|
+
return tagObject["" + tagName]["" + key] ===
|
|
329
|
+
childSlot.type.methods.getTag().replace(/[s]\b/, "");
|
|
330
|
+
});
|
|
331
|
+
var moduleName = this_3.ej2Instances.getModuleName().toLowerCase();
|
|
332
|
+
tag = tag
|
|
333
|
+
? tag.replace("e-", "")
|
|
334
|
+
: childSlot.type.methods.getTag().replace(moduleName === "ribbon" ? "e-ribbon-" : "e-", "");
|
|
335
|
+
if (this_3.ej2Instances.getModuleName().toLowerCase() == "diagram" && tag.indexOf('annotations') != -1) {
|
|
336
|
+
tag = 'annotations';
|
|
316
337
|
}
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
if (((/[s]\b/).test(tagRef) && innerDirValues) && (!(/[s]\b/).test(tagName) || innerDirValues.length)) {
|
|
320
|
-
items["" + tagName] = tempObj;
|
|
321
|
-
}
|
|
322
|
-
else if (tempObj && Object.keys(tempObj).length !== 0) {
|
|
323
|
-
items["" + tagName].push(tempObj);
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
var this_2 = this;
|
|
327
|
-
for (var _i = 0, slot_1 = slot; _i < slot_1.length; _i++) {
|
|
328
|
-
var childSlot = slot_1[_i];
|
|
329
|
-
_loop_2(childSlot);
|
|
330
|
-
}
|
|
331
|
-
return items;
|
|
332
|
-
};
|
|
333
|
-
ComponentBase.prototype.resolveComplexDirs = function (slots, tagObject, tagName) {
|
|
334
|
-
var slot = [];
|
|
335
|
-
var innerDirValues;
|
|
336
|
-
slot = slots.default ? slots.default() : slots;
|
|
337
|
-
var items = {};
|
|
338
|
-
var _loop_3 = function (childSlot) {
|
|
339
|
-
var tagRef = void 0;
|
|
340
|
-
var tag = void 0;
|
|
341
|
-
if (tagObject["" + tagName]) {
|
|
342
|
-
tagRef = Object.keys(tagObject["" + tagName]);
|
|
343
|
-
tag = tagRef.find(function (key) {
|
|
344
|
-
return tagObject["" + tagName]["" + key] ===
|
|
345
|
-
childSlot.type.methods.getTag().replace(/[s]\b/, "");
|
|
346
|
-
});
|
|
347
|
-
tag = tag
|
|
348
|
-
? tag.replace("e-", "")
|
|
349
|
-
: childSlot.type.methods.getTag().replace("e-", "");
|
|
350
|
-
if (this_3.ej2Instances.getModuleName().toLowerCase() == "diagram" && tag.indexOf('annotations') != -1) {
|
|
351
|
-
tag = 'annotations';
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
if (childSlot.children) {
|
|
355
|
-
innerDirValues = this_3.resolveComplexInnerDirs(childSlot.children, tagObject["" + tagName], childSlot.type.methods.getTag());
|
|
356
|
-
if (!items["" + tag]) {
|
|
357
|
-
items["" + tag] = [];
|
|
358
|
-
}
|
|
359
|
-
if (innerDirValues.length > 1) {
|
|
360
|
-
items["" + tag] = innerDirValues;
|
|
361
338
|
}
|
|
362
|
-
|
|
363
|
-
|
|
339
|
+
if (childSlot.children) {
|
|
340
|
+
innerDirValues = this_3.resolveComplexInnerDirs(childSlot.children, tagObject["" + tagName], childSlot.type.methods.getTag());
|
|
341
|
+
if (!items["" + tag]) {
|
|
342
|
+
items["" + tag] = [];
|
|
343
|
+
}
|
|
344
|
+
if (innerDirValues.length > 1) {
|
|
345
|
+
items["" + tag] = innerDirValues;
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
items["" + tag].push(innerDirValues);
|
|
349
|
+
}
|
|
364
350
|
}
|
|
365
|
-
}
|
|
366
|
-
if (childSlot.props) {
|
|
367
|
-
childSlot.props = this_3.getCamelCaseProps(childSlot.props);
|
|
368
|
-
}
|
|
369
|
-
if (slot.length > 1) {
|
|
370
|
-
items = Object.keys(items).length == 0 && !items.length ? [] : items;
|
|
371
351
|
if (childSlot.props) {
|
|
372
|
-
|
|
352
|
+
childSlot.props = this_3.getCamelCaseProps(childSlot.props);
|
|
373
353
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
var
|
|
393
|
-
var
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
354
|
+
if (slot.length > 1) {
|
|
355
|
+
items = Object.keys(items).length == 0 && !items.length ? [] : items;
|
|
356
|
+
if (childSlot.props) {
|
|
357
|
+
items.push(childSlot.props);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
items = childSlot.props ? Object.assign(items, childSlot.props) : items;
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
var this_3 = this;
|
|
365
|
+
for (var _i = 0, slot_2 = slot; _i < slot_2.length; _i++) {
|
|
366
|
+
var childSlot = slot_2[_i];
|
|
367
|
+
_loop_3(childSlot);
|
|
368
|
+
}
|
|
369
|
+
return items;
|
|
370
|
+
},
|
|
371
|
+
resolveComplexInnerDirs: function (slots, tagObject, tagName) {
|
|
372
|
+
var slot = [];
|
|
373
|
+
var innerDirValues;
|
|
374
|
+
slot = slots.default ? slots.default() : slots;
|
|
375
|
+
var items = slot.length > 1 ? [] : {};
|
|
376
|
+
for (var _i = 0, slot_3 = slot; _i < slot_3.length; _i++) {
|
|
377
|
+
var childSlot = slot_3[_i];
|
|
378
|
+
var isRibbon = (this.ej2Instances.getModuleName().toLowerCase() == "ribbon");
|
|
379
|
+
var tag = childSlot.type.methods.getTag().replace(isRibbon ? "e-ribbon-" : "e-", "");
|
|
380
|
+
if (childSlot.children) {
|
|
381
|
+
innerDirValues = this.resolveMultilevelComplexInnerDirs(childSlot.children, tagObject["" + tagName], childSlot.type.methods.getTag());
|
|
382
|
+
if ((/[s]\b/).test(tag) || slot.length > 1) {
|
|
383
|
+
if ((/[s]\b/).test(tag)) {
|
|
384
|
+
items["" + tag] = !items["" + tag] ? [] : items["" + tag];
|
|
385
|
+
if (innerDirValues.length) {
|
|
386
|
+
items["" + tag] = innerDirValues;
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
items["" + tag].push(innerDirValues);
|
|
390
|
+
}
|
|
401
391
|
}
|
|
402
|
-
else {
|
|
403
|
-
items
|
|
392
|
+
else if (innerDirValues && !(isRibbon && innerDirValues.hasOwnProperty('collections'))) {
|
|
393
|
+
items.push(innerDirValues);
|
|
404
394
|
}
|
|
405
395
|
}
|
|
406
|
-
else
|
|
407
|
-
items
|
|
396
|
+
else {
|
|
397
|
+
items = innerDirValues ? innerDirValues : items;
|
|
408
398
|
}
|
|
409
399
|
}
|
|
410
|
-
|
|
411
|
-
|
|
400
|
+
if (childSlot.props) {
|
|
401
|
+
childSlot.props = this.getCamelCaseProps(childSlot.props);
|
|
412
402
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
403
|
+
if (slot.length > 1 && childSlot.props) {
|
|
404
|
+
if (isRibbon && innerDirValues && innerDirValues.hasOwnProperty('collections')) {
|
|
405
|
+
innerDirValues = childSlot.props ? Object.assign(innerDirValues, childSlot.props) : innerDirValues;
|
|
406
|
+
items.push(innerDirValues);
|
|
407
|
+
}
|
|
408
|
+
else if (items.length >= 0) {
|
|
409
|
+
items.push(childSlot.props);
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
items = childSlot.props ? Object.assign(items, childSlot.props) : items;
|
|
413
|
+
}
|
|
420
414
|
}
|
|
421
415
|
else {
|
|
422
416
|
items = childSlot.props ? Object.assign(items, childSlot.props) : items;
|
|
423
417
|
}
|
|
424
418
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
var tag = childSlot.type.methods.getTag().replace("e-", "");
|
|
439
|
-
if (childSlot.children) {
|
|
440
|
-
innerDirValues = this.resolveComplexInnerDirs(childSlot.children, tagObject["" + tagName], childSlot.type.methods.getTag());
|
|
441
|
-
}
|
|
442
|
-
if (childSlot.props) {
|
|
443
|
-
childSlot.props = this.getCamelCaseProps(childSlot.props);
|
|
444
|
-
}
|
|
445
|
-
if ((/[s]\b/).test(tag)) {
|
|
446
|
-
items["" + tag] = !items["" + tag] ? [] : items["" + tag];
|
|
447
|
-
if (innerDirValues.length) {
|
|
448
|
-
items["" + tag] = innerDirValues;
|
|
449
|
-
}
|
|
450
|
-
else {
|
|
451
|
-
items["" + tag].push(innerDirValues);
|
|
419
|
+
return items;
|
|
420
|
+
},
|
|
421
|
+
resolveMultilevelComplexInnerDirs: function (slots, tagObject, tagName) {
|
|
422
|
+
var slot = [];
|
|
423
|
+
var innerDirValues;
|
|
424
|
+
slot = slots.default ? slots.default() : slots;
|
|
425
|
+
var items = slot.length > 1 ? [] : {};
|
|
426
|
+
for (var _i = 0, slot_4 = slot; _i < slot_4.length; _i++) {
|
|
427
|
+
var childSlot = slot_4[_i];
|
|
428
|
+
var moduleName = this.ej2Instances.getModuleName().toLowerCase();
|
|
429
|
+
var tag = childSlot.type.methods.getTag().replace(moduleName === "ribbon" ? "e-ribbon-" : "e-", "");
|
|
430
|
+
if (childSlot.children) {
|
|
431
|
+
innerDirValues = this.resolveComplexInnerDirs(childSlot.children, tagObject["" + tagName], childSlot.type.methods.getTag());
|
|
452
432
|
}
|
|
453
433
|
if (childSlot.props) {
|
|
454
|
-
|
|
434
|
+
childSlot.props = this.getCamelCaseProps(childSlot.props);
|
|
435
|
+
}
|
|
436
|
+
if ((/[s]\b/).test(tag)) {
|
|
437
|
+
items["" + tag] = !items["" + tag] ? [] : items["" + tag];
|
|
438
|
+
if (innerDirValues.length) {
|
|
439
|
+
items["" + tag] = innerDirValues;
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
items["" + tag].push(innerDirValues);
|
|
443
|
+
}
|
|
444
|
+
if (childSlot.props) {
|
|
445
|
+
items["" + tag].push(childSlot.props);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
items = innerDirValues;
|
|
450
|
+
items = childSlot.props ? Object.assign(items, childSlot.props) : items;
|
|
455
451
|
}
|
|
456
452
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
var tagDirChild = children_1[_a];
|
|
480
|
-
var retObj = this.getVNodeValue(tagDirChild, tagMapper["" + dirTag], tagNameMapper);
|
|
481
|
-
if (Object.keys(retObj).length !== 0) {
|
|
482
|
-
dir[tagName.replace('e-', '')].push(retObj);
|
|
453
|
+
return items;
|
|
454
|
+
},
|
|
455
|
+
getDirectiveValues: function (tagDirectives, tagMapper, tagNameMapper) {
|
|
456
|
+
var keyTags = Object.keys(tagMapper);
|
|
457
|
+
var dir = {};
|
|
458
|
+
if (tagDirectives) {
|
|
459
|
+
for (var _i = 0, tagDirectives_1 = tagDirectives; _i < tagDirectives_1.length; _i++) {
|
|
460
|
+
var tagDirective = tagDirectives_1[_i];
|
|
461
|
+
if (tagDirective.componentOptions && tagDirective.componentOptions.children && tagDirective.componentOptions.tag ||
|
|
462
|
+
(tagDirective.tag === 'e-seriescollection' && tagDirective.children)) {
|
|
463
|
+
var dirTag = tagDirective.componentOptions ? tagDirective.componentOptions.tag : tagDirective.tag;
|
|
464
|
+
dirTag = (dirTag === 'e-seriescollection') ? 'e-seriesCollection' : dirTag;
|
|
465
|
+
if (keyTags.indexOf(dirTag) !== -1) {
|
|
466
|
+
var tagName = tagNameMapper["" + dirTag] ? tagNameMapper["" + dirTag] : dirTag;
|
|
467
|
+
dir[tagName.replace('e-', '')] = [];
|
|
468
|
+
var children = tagDirective.componentOptions ? tagDirective.componentOptions.children : tagDirective.children;
|
|
469
|
+
for (var _a = 0, children_1 = children; _a < children_1.length; _a++) {
|
|
470
|
+
var tagDirChild = children_1[_a];
|
|
471
|
+
var retObj = this.getVNodeValue(tagDirChild, tagMapper["" + dirTag], tagNameMapper);
|
|
472
|
+
if (Object.keys(retObj).length !== 0) {
|
|
473
|
+
dir[tagName.replace('e-', '')].push(retObj);
|
|
474
|
+
}
|
|
483
475
|
}
|
|
484
476
|
}
|
|
485
477
|
}
|
|
486
478
|
}
|
|
487
479
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
480
|
+
return dir;
|
|
481
|
+
},
|
|
482
|
+
getMultiLevelDirValue: function (tagDirectories, tagKey, tagNameMapper) {
|
|
483
|
+
var mulObj = {};
|
|
484
|
+
for (var _i = 0, tagDirectories_1 = tagDirectories; _i < tagDirectories_1.length; _i++) {
|
|
485
|
+
var tagDir = tagDirectories_1[_i];
|
|
486
|
+
var key = void 0;
|
|
487
|
+
var children = void 0;
|
|
488
|
+
if (tagDir.componentOptions) {
|
|
489
|
+
key = tagDir.componentOptions.tag;
|
|
490
|
+
if (tagDir.componentOptions.children) {
|
|
491
|
+
children = tagDir.componentOptions.children;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
else if ((tagDir.tag === 'e-markersettings' || tagDir.tag === 'e-markersetting') && tagDir.children) {
|
|
495
|
+
key = (tagDir.tag === 'e-markersettings') ? 'e-markerSettings' : 'e-markerSetting';
|
|
496
|
+
children = tagDir.children;
|
|
497
|
+
}
|
|
498
|
+
if (key) {
|
|
499
|
+
var tagName = tagNameMapper["" + key] ? tagNameMapper["" + key] : key;
|
|
500
|
+
mulObj[tagName.replace('e-', '')] = [];
|
|
501
|
+
if (children) {
|
|
502
|
+
for (var _a = 0, children_2 = children; _a < children_2.length; _a++) {
|
|
503
|
+
var tagDirChild = children_2[_a];
|
|
504
|
+
var mulLevObj = this.getVNodeValue(tagDirChild, tagKey["" + key], tagNameMapper);
|
|
505
|
+
if (Object.keys(mulLevObj).length !== 0) {
|
|
506
|
+
mulObj[tagName.replace('e-', '')].push(mulLevObj);
|
|
507
|
+
}
|
|
516
508
|
}
|
|
517
509
|
}
|
|
518
510
|
}
|
|
519
511
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
dirTag = tagDirective.componentOptions.tag;
|
|
529
|
-
}
|
|
530
|
-
else {
|
|
531
|
-
dirTag = (tagDirective.tag === 'e-markersettings') ? 'e-markerSettings' : 'e-markerSetting';
|
|
532
|
-
}
|
|
533
|
-
if (typeof tagKey === 'string' && dirTag === tagKey && tagDirective.data) {
|
|
534
|
-
ret = tagDirective.data.attrs ? this.getCamelCaseProps(tagDirective.data.attrs) : this.getCamelCaseProps(tagDirective.data);
|
|
535
|
-
}
|
|
536
|
-
else if (typeof tagKey === 'object') {
|
|
537
|
-
if (tagDirective.componentOptions.children && (Object.keys(tagKey).indexOf(dirTag) !== -1)) {
|
|
538
|
-
ret = this.getMultiLevelDirValue(tagDirective.componentOptions.children, tagKey["" + dirTag], tagNameMapper);
|
|
512
|
+
return mulObj;
|
|
513
|
+
},
|
|
514
|
+
getVNodeValue: function (tagDirective, tagKey, tagNameMapper) {
|
|
515
|
+
var ret = {};
|
|
516
|
+
if (tagDirective.componentOptions || ((tagDirective.tag === 'e-markersettings' || tagDirective.tag === 'e-markersetting') && tagDirective.context)) {
|
|
517
|
+
var dirTag = void 0;
|
|
518
|
+
if (tagDirective.componentOptions) {
|
|
519
|
+
dirTag = tagDirective.componentOptions.tag;
|
|
539
520
|
}
|
|
540
|
-
else
|
|
541
|
-
|
|
521
|
+
else {
|
|
522
|
+
dirTag = (tagDirective.tag === 'e-markersettings') ? 'e-markerSettings' : 'e-markerSetting';
|
|
542
523
|
}
|
|
543
|
-
if (
|
|
544
|
-
ret =
|
|
524
|
+
if (typeof tagKey === 'string' && dirTag === tagKey && tagDirective.data) {
|
|
525
|
+
ret = tagDirective.data.attrs ? this.getCamelCaseProps(tagDirective.data.attrs) : this.getCamelCaseProps(tagDirective.data);
|
|
526
|
+
}
|
|
527
|
+
else if (typeof tagKey === 'object') {
|
|
528
|
+
if (tagDirective.componentOptions.children && (Object.keys(tagKey).indexOf(dirTag) !== -1)) {
|
|
529
|
+
ret = this.getMultiLevelDirValue(tagDirective.componentOptions.children, tagKey["" + dirTag], tagNameMapper);
|
|
530
|
+
}
|
|
531
|
+
else if (tagDirective.children && (Object.keys(tagKey).indexOf(dirTag) !== -1) && (dirTag === 'e-markersettings' || dirTag === 'e-markersetting')) {
|
|
532
|
+
ret = this.getMultiLevelDirValue(tagDirective.children, tagKey["" + dirTag], tagNameMapper);
|
|
533
|
+
}
|
|
534
|
+
if (tagDirective.data && tagDirective.data.attrs) {
|
|
535
|
+
ret = extend(ret, this.getCamelCaseProps(tagDirective.data.attrs));
|
|
536
|
+
}
|
|
545
537
|
}
|
|
546
538
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
}(vueImport));
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* Vue Component Base
|
|
572
|
-
*/
|
|
573
|
-
// import { Base, Component as EJ2Component, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
574
|
-
var $internalHooks = [
|
|
575
|
-
'data',
|
|
576
|
-
'beforeCreate',
|
|
577
|
-
'created',
|
|
578
|
-
'beforeMount',
|
|
579
|
-
'mounted',
|
|
580
|
-
'beforeDestroy',
|
|
581
|
-
'destroyed',
|
|
582
|
-
'beforeUpdate',
|
|
583
|
-
'updated',
|
|
584
|
-
'activated',
|
|
585
|
-
'deactivated',
|
|
586
|
-
'render',
|
|
587
|
-
'errorCaptured' // 2.5
|
|
588
|
-
];
|
|
539
|
+
return ret;
|
|
540
|
+
},
|
|
541
|
+
/**
|
|
542
|
+
* convert kebab case directive props to camel case
|
|
543
|
+
*/
|
|
544
|
+
getCamelCaseProps: function (props) {
|
|
545
|
+
var retProps = {};
|
|
546
|
+
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
|
547
|
+
var prop = _a[_i];
|
|
548
|
+
retProps[prop.replace(/-[a-z]/g, function (e) { return e[1].toUpperCase(); })] = props["" + prop];
|
|
549
|
+
}
|
|
550
|
+
return retProps;
|
|
551
|
+
},
|
|
552
|
+
dataBind: function () {
|
|
553
|
+
this.ej2Instances.dataBind();
|
|
554
|
+
},
|
|
555
|
+
setProperties: function (arg, muteOnChange) {
|
|
556
|
+
return this.ej2Instances.setProperties(arg, muteOnChange);
|
|
557
|
+
},
|
|
558
|
+
}
|
|
559
|
+
});
|
|
589
560
|
function getProps(options) {
|
|
590
561
|
if (options === void 0) { options = {}; }
|
|
591
562
|
if (options.props) {
|
|
592
|
-
var
|
|
563
|
+
var _loop_4 = function (prop) {
|
|
593
564
|
(options.newprops || (options.newprops = {}))["" + prop] = {};
|
|
594
565
|
(options.watch || (options.watch = {}))["" + prop] = function (newVal) {
|
|
595
566
|
this.ej2Instances["" + prop] = newVal;
|
|
@@ -600,116 +571,23 @@ function getProps(options) {
|
|
|
600
571
|
};
|
|
601
572
|
for (var _i = 0, _a = options.props; _i < _a.length; _i++) {
|
|
602
573
|
var prop = _a[_i];
|
|
603
|
-
|
|
574
|
+
_loop_4(prop);
|
|
604
575
|
}
|
|
605
576
|
}
|
|
606
577
|
return [options.newprops, options.watch];
|
|
607
578
|
}
|
|
608
|
-
function EJComponentDecorator(options, isExecute$$1) {
|
|
609
|
-
if (!isExecute$$1) {
|
|
610
|
-
return;
|
|
611
|
-
}
|
|
612
|
-
return function (Component) {
|
|
613
|
-
return EJcomponentFactory(Component, options);
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
function EJcomponentFactory(Component, options) {
|
|
617
|
-
if (options === void 0) { options = {}; }
|
|
618
|
-
options.name = options.name || Component._componentTag || Component.name;
|
|
619
|
-
// prototype props.
|
|
620
|
-
var proto = Component.prototype;
|
|
621
|
-
if (options.props) {
|
|
622
|
-
var _loop_2 = function (prop) {
|
|
623
|
-
(options.props || (options.props = {}))["" + prop] = {};
|
|
624
|
-
(options.watch || (options.watch = {}))["" + prop] = function (newVal) {
|
|
625
|
-
this.ej2Instances["" + prop] = newVal;
|
|
626
|
-
if (this.dataBind && (options.name !== 'DateRangePickerComponent')) {
|
|
627
|
-
this.dataBind();
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
};
|
|
631
|
-
for (var _i = 0, _a = options.props; _i < _a.length; _i++) {
|
|
632
|
-
var prop = _a[_i];
|
|
633
|
-
_loop_2(prop);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
Object.getOwnPropertyNames(proto).forEach(function (key) {
|
|
637
|
-
// hooks
|
|
638
|
-
if (key === 'constructor') {
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
if ($internalHooks.indexOf(key) > -1) {
|
|
642
|
-
options["" + key] = proto["" + key];
|
|
643
|
-
return;
|
|
644
|
-
}
|
|
645
|
-
var descriptor = Object.getOwnPropertyDescriptor(proto, key);
|
|
646
|
-
if (typeof descriptor.value === 'function') {
|
|
647
|
-
// methods
|
|
648
|
-
(options.methods || (options.methods = {}))["" + key] = descriptor.value;
|
|
649
|
-
}
|
|
650
|
-
else if (descriptor.get || descriptor.set) {
|
|
651
|
-
// computed properties
|
|
652
|
-
(options.computed || (options.computed = {}))["" + key] = {
|
|
653
|
-
get: descriptor.get,
|
|
654
|
-
set: descriptor.set
|
|
655
|
-
};
|
|
656
|
-
}
|
|
657
|
-
});
|
|
658
|
-
Object.getOwnPropertyNames(ComponentBase.prototype).forEach(function (key) {
|
|
659
|
-
if ($internalHooks.indexOf(key) > -1) {
|
|
660
|
-
options["" + key] = proto["" + key];
|
|
661
|
-
return;
|
|
662
|
-
}
|
|
663
|
-
});
|
|
664
|
-
(options.mixins || (options.mixins = [])).push({
|
|
665
|
-
data: function () {
|
|
666
|
-
return collectDataFromConstructor(this, Component);
|
|
667
|
-
}
|
|
668
|
-
});
|
|
669
|
-
// decorate options
|
|
670
|
-
var decorators = Component.__decorators__;
|
|
671
|
-
if (decorators) {
|
|
672
|
-
decorators.forEach(Function(options));
|
|
673
|
-
delete Component.__decorators__;
|
|
674
|
-
}
|
|
675
|
-
// find super
|
|
676
|
-
var superProto = Object.getPrototypeOf(Component.prototype);
|
|
677
|
-
var Super = superProto instanceof Vue$1__default
|
|
678
|
-
? superProto.constructor
|
|
679
|
-
: Vue$1__default;
|
|
680
|
-
var Extended = Super.extend(options);
|
|
681
|
-
return Extended;
|
|
682
|
-
}
|
|
683
|
-
function collectDataFromConstructor(vm, Component) {
|
|
684
|
-
Component.prototype._init = function () {
|
|
685
|
-
var _this = this;
|
|
686
|
-
var keys = Object.getOwnPropertyNames(vm);
|
|
687
|
-
if (vm.$options.props) {
|
|
688
|
-
for (var key in vm.$options.props) {
|
|
689
|
-
if (!vm.hasOwnProperty(key)) {
|
|
690
|
-
keys.push(key);
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
keys.forEach(function (key) {
|
|
695
|
-
if (key.charAt(0) !== '_') {
|
|
696
|
-
Object.defineProperty(_this, key, {
|
|
697
|
-
get: function () { return vm["" + key]; },
|
|
698
|
-
set: function (value) { return vm["" + key] = value; }
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
});
|
|
702
|
-
};
|
|
703
|
-
var data = new Component();
|
|
704
|
-
var plainData = {};
|
|
705
|
-
Object.keys(data).forEach(function (key) {
|
|
706
|
-
if (data["" + key] !== undefined) {
|
|
707
|
-
plainData["" + key] = data["" + key];
|
|
708
|
-
}
|
|
709
|
-
});
|
|
710
|
-
return plainData;
|
|
711
|
-
}
|
|
712
579
|
|
|
580
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
581
|
+
__assign = Object.assign || function(t) {
|
|
582
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
583
|
+
s = arguments[i];
|
|
584
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
585
|
+
t[p] = s[p];
|
|
586
|
+
}
|
|
587
|
+
return t;
|
|
588
|
+
};
|
|
589
|
+
return __assign.apply(this, arguments);
|
|
590
|
+
};
|
|
713
591
|
// tslint:disable:no-any
|
|
714
592
|
var stringCompiler = getTemplateEngine();
|
|
715
593
|
function compile(templateElement, helper) {
|
|
@@ -729,7 +607,7 @@ function compile(templateElement, helper) {
|
|
|
729
607
|
var vueSlot_1 = getCurrentVueSlot(context.vueInstance, templateElement, root);
|
|
730
608
|
if (vueSlot_1) {
|
|
731
609
|
// Compilation for Vue 3 slot template
|
|
732
|
-
var app =
|
|
610
|
+
var app = aVue.createApp({
|
|
733
611
|
render: function () {
|
|
734
612
|
return vueSlot_1["" + templateElement]({ data: data });
|
|
735
613
|
}
|
|
@@ -739,6 +617,8 @@ function compile(templateElement, helper) {
|
|
|
739
617
|
app.use(plugins[parseInt(i.toString(), 10)]);
|
|
740
618
|
}
|
|
741
619
|
}
|
|
620
|
+
// Get values for Vue 3 slot template
|
|
621
|
+
getValues(app, context.vueInstance, root);
|
|
742
622
|
app.mount((context.getModuleName() === 'grid') ? ("#" + pid) : ("#" + id));
|
|
743
623
|
returnEle = ele.childNodes;
|
|
744
624
|
detach(ele);
|
|
@@ -794,12 +674,14 @@ function compile(templateElement, helper) {
|
|
|
794
674
|
}
|
|
795
675
|
}
|
|
796
676
|
templateCompRef.data = function () { return tempRef_1; };
|
|
797
|
-
var app =
|
|
677
|
+
var app = aVue.createApp(templateCompRef);
|
|
798
678
|
if (plugins) {
|
|
799
679
|
for (var i = 0; i < plugins.length; i++) {
|
|
800
680
|
app.use(plugins[parseInt(i.toString(), 10)]);
|
|
801
681
|
}
|
|
802
682
|
}
|
|
683
|
+
// Get values for Vue 3 functional template
|
|
684
|
+
getValues(app, context.vueInstance, root);
|
|
803
685
|
app.mount((context.getModuleName() === 'grid') ? ("#" + pid) : ("#" + id));
|
|
804
686
|
returnEle = ele.childNodes;
|
|
805
687
|
detach(ele);
|
|
@@ -807,8 +689,22 @@ function compile(templateElement, helper) {
|
|
|
807
689
|
else if (typeof templateElement === "string") {
|
|
808
690
|
var vueSlot_2 = getVueSlot(context.vueInstance, templateElement, root);
|
|
809
691
|
if (vueSlot_2) {
|
|
692
|
+
// Get provide values for Vue 2 slot template
|
|
693
|
+
var provided_1 = {};
|
|
694
|
+
var getProvideValues_1 = function (vueinstance) {
|
|
695
|
+
if (vueinstance['$parent'])
|
|
696
|
+
getProvideValues_1(vueinstance.$parent);
|
|
697
|
+
if (vueinstance['_provided'] && Object.keys(vueinstance['_provided']).length > 0) {
|
|
698
|
+
provided_1 = __assign({}, provided_1, vueinstance._provided);
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
var vueInstance = context.vueInstance ? context.vueInstance : ((root && root.vueInstance) ? root.vueInstance : null);
|
|
702
|
+
if (vueInstance) {
|
|
703
|
+
getProvideValues_1(vueInstance);
|
|
704
|
+
}
|
|
810
705
|
// Compilation for Vue 2 slot template
|
|
811
|
-
var vueTemplate = new
|
|
706
|
+
var vueTemplate = new aVue({
|
|
707
|
+
provide: __assign({}, provided_1),
|
|
812
708
|
render: function () {
|
|
813
709
|
return vueSlot_2["" + templateElement]({ data: data });
|
|
814
710
|
}
|
|
@@ -837,7 +733,7 @@ function compile(templateElement, helper) {
|
|
|
837
733
|
dataObj.propsData = propsData;
|
|
838
734
|
}
|
|
839
735
|
if (typeof templateFunction !== "function") {
|
|
840
|
-
templateFunction =
|
|
736
|
+
templateFunction = aVue.extend(templateFunction);
|
|
841
737
|
}
|
|
842
738
|
var templateVue = new templateFunction(dataObj);
|
|
843
739
|
// let templateVue = new Vue(tempObj.template);
|
|
@@ -864,6 +760,37 @@ function compile(templateElement, helper) {
|
|
|
864
760
|
};
|
|
865
761
|
}
|
|
866
762
|
setTemplateEngine({ compile: compile });
|
|
763
|
+
function getValues(app, cInstance, root) {
|
|
764
|
+
var vueInstance = cInstance ? cInstance : ((root && root.vueInstance) ? root.vueInstance : null);
|
|
765
|
+
if (!vueInstance) {
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
// Get globally defined variables.
|
|
769
|
+
var globalVariables = ['components', 'mixins', 'provides'];
|
|
770
|
+
for (var i = 0; i < globalVariables.length; i++) {
|
|
771
|
+
var gVariable = globalVariables[i];
|
|
772
|
+
if (app['_context'][gVariable] && vueInstance['$']['appContext'][gVariable]) {
|
|
773
|
+
app['_context'][gVariable] = vueInstance['$']['appContext'][gVariable];
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
// Get provide value from child component.
|
|
777
|
+
var provided = {};
|
|
778
|
+
var getProvideValue = function (vueinstance) {
|
|
779
|
+
if (vueinstance['$'] && vueinstance['$']['parent'])
|
|
780
|
+
getProvideValue(vueinstance.$.parent);
|
|
781
|
+
if (vueinstance['provides'] && Object.keys(vueinstance['provides']).length > 0) {
|
|
782
|
+
provided = __assign({}, provided, vueinstance.provides);
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
getProvideValue(vueInstance);
|
|
786
|
+
if (app['_context']['provides']) {
|
|
787
|
+
app._context.provides = __assign({}, app._context.provides, provided);
|
|
788
|
+
}
|
|
789
|
+
// Get globally defined properties.
|
|
790
|
+
if (app['_context']['config']['globalProperties'] && vueInstance['$']['appContext']['config']['globalProperties']) {
|
|
791
|
+
app['_context']['config']['globalProperties'] = vueInstance['$']['appContext']['config']['globalProperties'];
|
|
792
|
+
}
|
|
793
|
+
}
|
|
867
794
|
// Get the Vue2 slot template from the root or current Vue component.
|
|
868
795
|
function getVueSlot(vueInstance, templateElement, root) {
|
|
869
796
|
if (!vueInstance && !(root && root.vueInstance)) {
|
|
@@ -938,5 +865,5 @@ function getChildVueSlot(slots, templateElement) {
|
|
|
938
865
|
* index for component base
|
|
939
866
|
*/
|
|
940
867
|
|
|
941
|
-
export {
|
|
868
|
+
export { isExecute, aVue, gh, vueDefineComponent, ComponentBase, getProps, compile };
|
|
942
869
|
//# sourceMappingURL=ej2-vue-base.es5.js.map
|