@syncfusion/ej2-vue-base 22.1.34 → 23.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 +18 -0
- package/dist/ej2-vue-base.umd.min.js +2 -2
- package/dist/ej2-vue-base.umd.min.js.map +1 -1
- package/dist/es6/ej2-vue-base.es2015.js +35 -41
- package/dist/es6/ej2-vue-base.es2015.js.map +1 -1
- package/dist/es6/ej2-vue-base.es5.js +35 -41
- 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 +5 -5
- package/src/component-base.js +25 -13
- package/src/index.d.ts +1 -0
- package/src/template.js +10 -28
- package/src/vue-types.d.ts +15 -0
package/src/template.js
CHANGED
|
@@ -30,19 +30,15 @@ export function compile(templateElement, helper) {
|
|
|
30
30
|
var vueSlot_1 = getCurrentVueSlot(context.vueInstance, templateElement, root);
|
|
31
31
|
if (vueSlot_1) {
|
|
32
32
|
// Compilation for Vue 3 slot template
|
|
33
|
-
var app = Vue.
|
|
33
|
+
var app = Vue.createVNode({
|
|
34
34
|
render: function () {
|
|
35
35
|
return vueSlot_1["" + templateElement]({ data: data });
|
|
36
36
|
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
for (var i = 0; i < plugins.length; i++) {
|
|
40
|
-
app.use(plugins[parseInt(i.toString(), 10)]);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
37
|
+
}, plugins);
|
|
38
|
+
ele.innerHTML = '';
|
|
43
39
|
// Get values for Vue 3 slot template
|
|
44
40
|
getValues(app, context.vueInstance, root);
|
|
45
|
-
|
|
41
|
+
Vue.render(app, ele);
|
|
46
42
|
returnEle = ele.childNodes;
|
|
47
43
|
detach(ele);
|
|
48
44
|
}
|
|
@@ -117,15 +113,11 @@ export function compile(templateElement, helper) {
|
|
|
117
113
|
};
|
|
118
114
|
}
|
|
119
115
|
templateCompRef.data = function () { return tempRef_1; };
|
|
120
|
-
var app = Vue.
|
|
121
|
-
|
|
122
|
-
for (var i = 0; i < plugins.length; i++) {
|
|
123
|
-
app.use(plugins[parseInt(i.toString(), 10)]);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
116
|
+
var app = Vue.createVNode(templateCompRef, plugins);
|
|
117
|
+
ele.innerHTML = '';
|
|
126
118
|
// Get values for Vue 3 functional template
|
|
127
119
|
getValues(app, context.vueInstance, root);
|
|
128
|
-
|
|
120
|
+
Vue.render(app, ele);
|
|
129
121
|
returnEle = ele.childNodes;
|
|
130
122
|
detach(ele);
|
|
131
123
|
}
|
|
@@ -215,13 +207,7 @@ function getValues(app, cInstance, root) {
|
|
|
215
207
|
return;
|
|
216
208
|
}
|
|
217
209
|
// Get globally defined variables.
|
|
218
|
-
|
|
219
|
-
for (var i = 0; i < globalVariables.length; i++) {
|
|
220
|
-
var gVariable = globalVariables[i];
|
|
221
|
-
if (app['_context'][gVariable] && vueInstance['$']['appContext'][gVariable]) {
|
|
222
|
-
app['_context'][gVariable] = vueInstance['$']['appContext'][gVariable];
|
|
223
|
-
}
|
|
224
|
-
}
|
|
210
|
+
app['appContext'] = vueInstance['$']['appContext'];
|
|
225
211
|
// Get provide value from child component.
|
|
226
212
|
var provided = {};
|
|
227
213
|
var getProvideValue = function (vueinstance) {
|
|
@@ -232,12 +218,8 @@ function getValues(app, cInstance, root) {
|
|
|
232
218
|
}
|
|
233
219
|
};
|
|
234
220
|
getProvideValue(vueInstance);
|
|
235
|
-
if (app['
|
|
236
|
-
app.
|
|
237
|
-
}
|
|
238
|
-
// Get globally defined properties.
|
|
239
|
-
if (app['_context']['config']['globalProperties'] && vueInstance['$']['appContext']['config']['globalProperties']) {
|
|
240
|
-
app['_context']['config']['globalProperties'] = vueInstance['$']['appContext']['config']['globalProperties'];
|
|
221
|
+
if (app['appContext']['provides']) {
|
|
222
|
+
app.appContext.provides = __assign({}, app.appContext.provides, provided);
|
|
241
223
|
}
|
|
242
224
|
}
|
|
243
225
|
// Get the Vue2 slot template from the root or current Vue component.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import Vue, { VueConstructor } from 'vue';
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import { DefineComponent } from 'vue';
|
|
5
|
+
|
|
6
|
+
interface CommonProps {
|
|
7
|
+
isLazyUpdate?: Boolean,
|
|
8
|
+
plugins?: any[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
export type DefineVueComponent<Props> = typeof Vue.compile extends (template: string) => Function ? DefineComponent<Props & CommonProps, any, {}, {}, {}, {}, {}, {}, string, Props & CommonProps, Props & CommonProps, {}> : VueConstructor<Vue<{}, Props & CommonProps>>;
|
|
13
|
+
|
|
14
|
+
//@ts-ignore
|
|
15
|
+
export type DefineVueDirective<Props> = typeof Vue.compile extends (template: string) => Function ? DefineComponent<Props, any, {}, {}, {}, {}, {}, {}, string, Props, Props, {}> : VueConstructor<Vue<{}, Props>>;
|