Skip to content

Commit b076f54

Browse files
author
pipeline
committed
v22.1.37 is released
1 parent e363f59 commit b076f54

File tree

582 files changed

+2269
-474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

582 files changed

+2269
-474
lines changed

components/base/CHANGELOG.md

Lines changed: 25 additions & 0 deletions

components/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-vue-base",
3-
"version": "21.2.3",
3+
"version": "19.3.53",
44
"description": "A common package of Essential JS 2 base Vue libraries, methods and class definitions",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

components/base/src/component-base.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,7 @@ export let ComponentBase = vueDefineComponent({
7878
this.ej2Instances.appendTo(this.$el);
7979
},
8080
updated(): void {
81-
if (this.isVue3) {
82-
this.setModelValue();
83-
}
84-
if (this.hasChildDirective) {
85-
let childKey: Object = {};
86-
this.fetchChildPropValues(childKey);
87-
let curChildDir: string = JSON.stringify(childKey);
88-
if (this.childDirObjects !== curChildDir) {
89-
this.childDirObjects = curChildDir;
90-
this.assignValueToWrapper(childKey, false);
91-
}
92-
}
81+
this.updated();
9382
},
9483
beforeDestroy(): void {
9584
this.destroyComponent();
@@ -257,6 +246,7 @@ export let ComponentBase = vueDefineComponent({
257246
let slot: any = [];
258247
let innerDirValues: any;
259248
slot = slots.default ? slots.default() : slots;
249+
slot = slot.flatMap((item: any) => Array.isArray(item.children) ? item.children : item);
260250
let items: any = {};
261251
items[`${tagName}`] = [];
262252
for (const childSlot of slot) {

components/base/src/template.ts

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function compile(
2020
innerHTML: '<div id="' + id + '"></div>',
2121
});
2222
document.body.appendChild(ele);
23-
if (!isExecute && typeof templateElement === "string") {
23+
if (!isExecute && (typeof templateElement === "string" || (templateElement.prototype && templateElement.prototype.CSPTemplate && typeof templateElement === 'function'))) {
2424
let vueSlot: any = getCurrentVueSlot(context.vueInstance, templateElement, root);
2525
if (vueSlot) {
2626
// Compilation for Vue 3 slot template
@@ -68,9 +68,18 @@ export function compile(
6868
}
6969
let tempRef: any;
7070
if (propsData) {
71-
tempRef = (<any>Object).assign(templateCompRef.data(), propsData);
72-
} else {
73-
tempRef = (<any>Object).assign(templateCompRef.data(), dataObj.data);
71+
if (templateCompRef.setup) {
72+
tempRef = (<any>Object).assign(templateCompRef.setup(null, { expose: function () {}}), propsData);
73+
} else {
74+
tempRef = (<any>Object).assign(templateCompRef.data(), propsData);
75+
}
76+
}
77+
else {
78+
if (templateCompRef.setup) {
79+
tempRef = (<any>Object).assign(templateCompRef.setup(null, { expose: function () {}}), dataObj.data);
80+
} else {
81+
tempRef = (<any>Object).assign(templateCompRef.data(), dataObj.data);
82+
}
7483
if (templateCompRef.components) {
7584
let objkeys: any = Object.keys(templateCompRef.components) || [];
7685
for (let objstring of objkeys) {
@@ -82,6 +91,14 @@ export function compile(
8291
}
8392
}
8493
}
94+
if (templateCompRef.setup) {
95+
templateCompRef.setup = function (__props: any, { expose: __expose }: any) {
96+
__expose();
97+
const __returned__ = tempRef;
98+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
99+
return __returned__;
100+
}
101+
}
85102
templateCompRef.data = function () { return tempRef; };
86103
let app: any = Vue.createApp(templateCompRef);
87104
if (plugins) {
@@ -94,7 +111,7 @@ export function compile(
94111
app.mount("#" + pid);
95112
returnEle = ele.childNodes;
96113
detach(ele);
97-
} else if (typeof templateElement === "string") {
114+
} else if (typeof templateElement === "string" || (templateElement.prototype && templateElement.prototype.CSPTemplate && typeof templateElement === 'function')) {
98115
let vueSlot: any = getVueSlot(context.vueInstance, templateElement, root);
99116
if (vueSlot) {
100117
// Get provide values for Vue 2 slot template
@@ -140,6 +157,12 @@ export function compile(
140157
if (typeof templateFunction !== "function") {
141158
templateFunction = Vue.extend(templateFunction);
142159
}
160+
if (templateFunction.options.setup) {
161+
var variables: any = (<any>Object).assign(templateFunction.options.setup(), dataObj.data);
162+
templateFunction.options.setup = function(__props: any) {
163+
return variables;
164+
};
165+
}
143166
let templateVue: any = new templateFunction(dataObj);
144167
// let templateVue = new Vue(tempObj.template);
145168
// templateVue.$data.data = extend(tempObj.data, data);
@@ -173,7 +196,7 @@ function getValues(app: any, cInstance: any, root: any): any {
173196
return;
174197
}
175198
// Get globally defined variables.
176-
let globalVariables: string[] = ['components', 'mixins', 'provides'];
199+
let globalVariables: string[] = ['components', 'mixins', 'provides', 'directives'];
177200
for (let i: number = 0; i < globalVariables.length; i++) {
178201
let gVariable: string = globalVariables[i];
179202
if (app['_context'][gVariable] && vueInstance['$']['appContext'][gVariable]) {
@@ -258,6 +281,7 @@ function getChildVueSlot(slots: any, templateElement: any): any {
258281
return slots;
259282
} else if (slots && slots.default) {
260283
let childSlots: any = slots.default();
284+
childSlots = childSlots.flatMap((item: any) => Array.isArray(item.children) ? item.children : item);
261285
for (let i: number = 0; i < childSlots.length; i++) {
262286
let slot: any = getChildVueSlot(childSlots[parseInt(i.toString(), 10)].children, templateElement);
263287
if (slot) {

components/buttons/CHANGELOG.md

Lines changed: 27 additions & 23 deletions

components/buttons/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-vue-buttons",
3-
"version": "21.1.37",
3+
"version": "21.1.36",
44
"description": "A package of feature-rich Essential JS 2 components such as Button, CheckBox, RadioButton and Switch. for Vue",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

components/buttons/src/button/button.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export let ButtonComponent = vueDefineComponent({
2727
provide() { return { custom: this.custom } },
2828
data() {
2929
return {
30-
ej2Instances: new Button({}) as any,
30+
ej2Instance: new Button({}) as any,
3131
propKeys: properties as string[],
3232
models: modelProps as string[],
3333
hasChildDirective: false as boolean,

components/buttons/src/check-box/checkbox.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export let CheckBoxComponent = vueDefineComponent({
2929
provide() { return { custom: this.custom } },
3030
data() {
3131
return {
32-
ej2Instances: new CheckBox({}) as any,
32+
ej2Instance: new CheckBox({}) as any,
3333
propKeys: properties as string[],
3434
models: modelProps as string[],
3535
hasChildDirective: false as boolean,

components/buttons/src/chips/chiplist.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export let ChipListComponent = vueDefineComponent({
2828
provide() { return { custom: this.custom } },
2929
data() {
3030
return {
31-
ej2Instances: new ChipList({}) as any,
31+
ej2Instance: new ChipList({}) as any,
3232
propKeys: properties as string[],
3333
models: modelProps as string[],
3434
hasChildDirective: true as boolean,

components/buttons/src/floating-action-button/fab.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export let FabComponent = vueDefineComponent({
2727
provide() { return { custom: this.custom } },
2828
data() {
2929
return {
30-
ej2Instances: new Fab({}) as any,
30+
ej2Instance: new Fab({}) as any,
3131
propKeys: properties as string[],
3232
models: modelProps as string[],
3333
hasChildDirective: false as boolean,

0 commit comments

Comments
 (0)