@syncfusion/ej2-vue-base 22.2.5 → 23.2.4

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/src/template.js CHANGED
@@ -18,7 +18,7 @@ export function compile(templateElement, helper) {
18
18
  return function (data, context, propName, element, root) {
19
19
  var returnEle;
20
20
  if (context) {
21
- var plugins = context.vueInstance ? context.vueInstance.plugins : null;
21
+ var plugins = context.vueInstance && context.vueInstance.plugins ? { plugins: context.vueInstance.plugins } : {};
22
22
  var pid = getUniqueID("templateParentDiv");
23
23
  var id = getUniqueID("templateDiv");
24
24
  var ele = createElement("div", {
@@ -74,7 +74,7 @@ export function compile(templateElement, helper) {
74
74
  var tempRef_1;
75
75
  if (propsData) {
76
76
  if (templateCompRef.setup) {
77
- tempRef_1 = Object.assign(templateCompRef.setup(null, { expose: function () { } }), propsData);
77
+ tempRef_1 = Object.assign({}, propsData);
78
78
  }
79
79
  else {
80
80
  tempRef_1 = Object.assign(templateCompRef.data(), propsData);
@@ -82,7 +82,7 @@ export function compile(templateElement, helper) {
82
82
  }
83
83
  else {
84
84
  if (templateCompRef.setup) {
85
- tempRef_1 = Object.assign(templateCompRef.setup(null, { expose: function () { } }), dataObj_1.data);
85
+ tempRef_1 = Object.assign({}, dataObj_1.data);
86
86
  }
87
87
  else {
88
88
  tempRef_1 = Object.assign(templateCompRef.data(), dataObj_1.data);
@@ -104,13 +104,7 @@ export function compile(templateElement, helper) {
104
104
  }
105
105
  }
106
106
  if (templateCompRef.setup) {
107
- templateCompRef.setup = function (__props, _a) {
108
- var __expose = _a.expose;
109
- __expose();
110
- var __returned__ = tempRef_1;
111
- Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
112
- return __returned__;
113
- };
107
+ plugins = Object.assign(plugins, data);
114
108
  }
115
109
  templateCompRef.data = function () { return tempRef_1; };
116
110
  var app = Vue.createVNode(templateCompRef, plugins);
@@ -171,10 +165,7 @@ export function compile(templateElement, helper) {
171
165
  templateFunction = Vue.extend(templateFunction);
172
166
  }
173
167
  if (templateFunction.options.setup) {
174
- var variables = Object.assign(templateFunction.options.setup(), dataObj.data);
175
- templateFunction.options.setup = function (__props) {
176
- return variables;
177
- };
168
+ dataObj.propsData = Object.assign(dataObj.propsData || {}, data);
178
169
  }
179
170
  var templateVue = new templateFunction(dataObj);
180
171
  // let templateVue = new Vue(tempObj.template);
@@ -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>>;