Skip to content

Commit 94e48c0

Browse files
author
pipeline
committed
v21.1.35 is released
1 parent 0eeaec3 commit 94e48c0

File tree

424 files changed

+15111
-19922
lines changed

Some content is hidden

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

424 files changed

+15111
-19922
lines changed

components/barcodegenerator/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-vue-barcode-generator",
3-
"version": "19.3.0",
3+
"version": "19.4.0",
44
"description": "Barcode generator component is a pure JavaScript library which will convert a string to Barcode and show it to the user. This supports major 1D and 2D barcodes including coda bar, code 128, QR Code. for Vue",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",
@@ -31,7 +31,6 @@
3131
"@types/jasmine-ajax": "^3.1.27",
3232
"@types/requirejs": "^2.1.26",
3333
"vue": "2.6.14",
34-
"vue-class-component": "^8.0.0-rc.1",
3534
"vue-loader-v16": "^16.0.0-beta.5.4",
3635
"rollup": "^0.51.3",
3736
"rollup-plugin-commonjs": "^8.2.6",

components/barcodegenerator/src/barcode-generator/barcodegenerator.component.ts

+71-99
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,109 @@
1-
import { Options } from 'vue-class-component';
2-
import { ComponentBase, EJComponentDecorator, getProps, allVue, gh, isExecute } from '@syncfusion/ej2-vue-base';
1+
import { ComponentBase, gh, getProps, isExecute, vueDefineComponent } from '@syncfusion/ej2-vue-base';
32
import { isNullOrUndefined, getValue } from '@syncfusion/ej2-base';
43

54
import { BarcodeGenerator } from '@syncfusion/ej2-barcode-generator';
65

76

8-
// {{VueImport}}
97
export const properties: string[] = ['isLazyUpdate', 'plugins', 'backgroundColor', 'displayText', 'enableCheckSum', 'enablePersistence', 'enableRtl', 'foreColor', 'height', 'locale', 'margin', 'mode', 'type', 'value', 'width', 'invalid'];
108
export const modelProps: string[] = [];
119

1210
export const testProp: any = getProps({props: properties});
13-
export const props = testProp[0];
14-
export const watch = testProp[1];
15-
16-
export const emitProbs: any = Object.keys(watch);
11+
export const props = testProp[0], watch = testProp[1], emitProbs: any = Object.keys(watch);
1712
emitProbs.push('modelchanged', 'update:modelValue');
18-
for (let props of modelProps) {
19-
emitProbs.push(
20-
'update:'+props
21-
);
22-
}
13+
for (let props of modelProps) { emitProbs.push('update:'+props) }
2314

2415
/**
2516
* Represents vue Barcode Component
2617
* ```html
2718
* <ejs-barcode-generator></ejs-barcode-generator>
2819
* ```
2920
*/
30-
@EJComponentDecorator({
31-
props: properties
32-
},isExecute)
33-
34-
/* Start Options({
21+
export let BarcodeGeneratorComponent = vueDefineComponent({
22+
name: 'BarcodeGeneratorComponent',
23+
mixins: [ComponentBase],
3524
props: props,
3625
watch: watch,
3726
emits: emitProbs,
38-
provide: function provide() {
27+
provide() { return { custom: this.custom } },
28+
data() {
3929
return {
40-
custom: this.custom
41-
};
42-
}
43-
}) End */
30+
ej2Instances: new BarcodeGenerator({}) as any,
31+
propKeys: properties as string[],
32+
models: modelProps as string[],
33+
hasChildDirective: false as boolean,
34+
hasInjectedModules: false as boolean,
35+
tagMapper: {} as { [key: string]: Object },
36+
tagNameMapper: {} as Object,
37+
isVue3: !isExecute as boolean,
38+
templateCollection: {} as any,
39+
}
40+
},
41+
created() {
4442

45-
export class BarcodeGeneratorComponent extends ComponentBase {
46-
47-
public ej2Instances: any;
48-
public propKeys: string[] = properties;
49-
public models: string[] = modelProps;
50-
public hasChildDirective: boolean = false;
51-
protected hasInjectedModules: boolean = false;
52-
public tagMapper: { [key: string]: Object } = {};
53-
public tagNameMapper: Object = {};
54-
public isVue3: boolean;
55-
public templateCollection: any;
56-
constructor() {
57-
super(arguments);
58-
this.isVue3 = !isExecute;
59-
this.ej2Instances = new BarcodeGenerator({});
6043
this.bindProperties();
6144
this.ej2Instances._setProperties = this.ej2Instances.setProperties;
6245
this.ej2Instances.setProperties = this.setProperties;
6346
this.ej2Instances.clearTemplate = this.clearTemplate;
6447
this.updated = this.updated;
65-
}
66-
67-
public clearTemplate(templateNames?: string[]): any {
68-
if (!templateNames){
69-
templateNames = Object.keys(this.templateCollection || {});
70-
}
71-
if (templateNames.length && this.templateCollection) {
72-
for (let tempName of templateNames){
73-
let elementCollection: any = this.templateCollection[tempName];
74-
if(elementCollection && elementCollection.length) {
75-
for(let ele of elementCollection) {
76-
let destroy: any = getValue('__vue__.$destroy', ele);
77-
if (destroy) {
78-
ele.__vue__.$destroy();
79-
}
80-
if (ele.innerHTML){
81-
ele.innerHTML = '';
82-
}
83-
}
84-
delete this.templateCollection[tempName];
85-
}
86-
}
87-
}
88-
}
89-
90-
91-
92-
public setProperties(prop: any, muteOnChange: boolean): void {
93-
if(this.isVue3) {
94-
this.models = !this.models ? this.ej2Instances.referModels : this.models;
95-
}
96-
if (this.ej2Instances && this.ej2Instances._setProperties) {
97-
this.ej2Instances._setProperties(prop, muteOnChange);
98-
}
99-
if (prop && this.models && this.models.length) {
100-
Object.keys(prop).map((key: string): void => {
101-
this.models.map((model: string): void => {
102-
if ((key === model) && !(/datasource/i.test(key))) {
103-
if (this.isVue3) {
104-
this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
105-
} else {
106-
(this as any).$emit('update:' + key, prop[key]);
107-
(this as any).$emit('modelchanged', prop[key]);
108-
}
109-
}
110-
});
111-
});
112-
}
113-
}
114-
115-
public render(createElement: any) {
48+
},
49+
render(createElement: any) {
11650
let h: any = !isExecute ? gh : createElement;
11751
let slots: any = null;
11852
if(!isNullOrUndefined((this as any).$slots.default)) {
11953
slots = !isExecute ? (this as any).$slots.default() : (this as any).$slots.default;
12054
}
12155
return h('div', slots);
56+
},
57+
methods: {
58+
clearTemplate(templateNames?: string[]): any {
59+
if (!templateNames){ templateNames = Object.keys(this.templateCollection || {}) }
60+
if (templateNames.length && this.templateCollection) {
61+
for (let tempName of templateNames){
62+
let elementCollection: any = this.templateCollection[tempName];
63+
if(elementCollection && elementCollection.length) {
64+
for(let ele of elementCollection) {
65+
let destroy: any = getValue('__vue__.$destroy', ele);
66+
if (destroy) { ele.__vue__.$destroy() }
67+
if (ele.innerHTML) { ele.innerHTML = '' }
68+
}
69+
delete this.templateCollection[tempName];
70+
}
71+
}
72+
}
73+
},
74+
setProperties(prop: any, muteOnChange: boolean): void {
75+
if(this.isVue3) { this.models = !this.models ? this.ej2Instances.referModels : this.models }
76+
if (this.ej2Instances && this.ej2Instances._setProperties) {
77+
this.ej2Instances._setProperties(prop, muteOnChange);
78+
}
79+
if (prop && this.models && this.models.length) {
80+
Object.keys(prop).map((key: string): void => {
81+
this.models.map((model: string): void => {
82+
if ((key === model) && !(/datasource/i.test(key))) {
83+
if (this.isVue3) {
84+
this.ej2Instances.vueInstance.$emit('update:' + key, prop[key]);
85+
} else {
86+
(this as any).$emit('update:' + key, prop[key]);
87+
(this as any).$emit('modelchanged', prop[key]);
88+
}
89+
}
90+
});
91+
});
92+
}
93+
},
94+
custom(): void {
95+
this.updated();
96+
},
97+
exportAsBase64Image(exportType: Object): Object {
98+
return this.ej2Instances.exportAsBase64Image(exportType);
99+
},
100+
exportImage(filename: string, exportType: Object): void {
101+
return this.ej2Instances.exportImage(filename, exportType);
102+
},
122103
}
123-
public custom(): void {
124-
this.updated();
125-
}
126-
127-
public exportAsBase64Image(exportType: Object): Object {
128-
return this.ej2Instances.exportAsBase64Image(exportType);
129-
}
104+
});
130105

131-
public exportImage(filename: string, exportType: Object): void {
132-
return this.ej2Instances.exportImage(filename, exportType);
133-
}
134-
}
106+
export type BarcodeGeneratorComponent = InstanceType<typeof BarcodeGeneratorComponent>;
135107

136108
export const BarcodeGeneratorPlugin = {
137109
name: 'ejs-barcodegenerator',

0 commit comments

Comments
 (0)