Skip to content

Commit 0c35280

Browse files
author
pipeline
committed
v21.1.35 is released
1 parent ab669d9 commit 0c35280

File tree

24,933 files changed

+834782
-467841
lines changed

Some content is hidden

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

24,933 files changed

+834782
-467841
lines changed

controls/barcodegenerator/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@syncfusion/ej2-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.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",
77
"main": "./dist/ej2-barcode-generator.umd.min.js",
88
"module": "./index.js",
9-
"es2015": "./dist/es6/ej2-barcode-generator.es2015.js",
9+
"es2015": "./dist/es6/ej2-barcode-generator.es5.js",
1010
"dependencies": {
1111
"@syncfusion/ej2-base": "*",
1212
"@syncfusion/ej2-data": "*"

controls/barcodegenerator/src/barcode/barcode.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export class BarcodeGenerator extends Component<HTMLElement> implements INotifyP
184184
const arg: ValidateEvent = {
185185
message: message
186186
};
187-
this.trigger(BarcodeEvent[eventName], arg);
187+
this.trigger(BarcodeEvent[`${eventName}`], arg);
188188
}
189189

190190
// eslint-disable-next-line
@@ -396,10 +396,10 @@ export class BarcodeGenerator extends Component<HTMLElement> implements INotifyP
396396
const measureElement: HTMLCollection = document.getElementsByClassName('barcodeMeasureElement');
397397
if (measureElement.length > 0) {
398398
for (let i: number = measureElement.length - 1; i >= 0; i--) {
399-
measureElement[i].parentNode.removeChild(measureElement[i]);
399+
measureElement[parseInt(i.toString(), 10)].parentNode.removeChild(measureElement[parseInt(i.toString(), 10)]);
400400
}
401401
const element: string = 'barcodeMeasureElement';
402-
window[element] = null;
402+
window[`${element}`] = null;
403403
}
404404
}
405405

controls/barcodegenerator/src/barcode/one-dimension.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ export abstract class OneDimension extends BarcodeBase {
7070
} else if (type === 'Code93Extension') {
7171
let count: number = 0;
7272
for (let i: number = 0; i < code.length; i++) {
73-
const numberOfDigits: string = code[i];
73+
const numberOfDigits: string = code[parseInt(i.toString(), 10)];
7474
for (let j: number = 0; j < numberOfDigits.length; j++) {
75-
count += Number(numberOfDigits[j]);
75+
count += Number(numberOfDigits[parseInt(j.toString(), 10)]);
7676
}
7777
}
7878
return widthValue / count;
7979
} else {
8080
let lineCount: number = 0;
8181
for (let i: number = 0; i < code.length; i++) {
82-
const numberOfDigits: number = code[i].length;
82+
const numberOfDigits: number = code[parseInt(i.toString(), 10)].length;
8383
lineCount += numberOfDigits;
8484
}
8585
let additionalValue: number;
@@ -94,7 +94,7 @@ export abstract class OneDimension extends BarcodeBase {
9494

9595
private multipleWidth(codeValue: string, k: number, value: number): number {
9696
let number: number;
97-
if (codeValue[k] === '1' && codeValue[k + 1] === '1') {
97+
if (codeValue[parseInt(k.toString(), 10)] === '1' && codeValue[k + 1] === '1') {
9898
number = value + 1;
9999
return this.multipleWidth(codeValue, k + 1, number);
100100
}
@@ -218,7 +218,7 @@ export abstract class OneDimension extends BarcodeBase {
218218
const position: string = this.displayText.position; const scaleValue: number = this.isSvgMode ? 1 : 1.5;
219219
let textOptions: BaseAttributes; let textSize: Size; let textHeight: number; let textProperty: DisplayTextModel;
220220
for (let j: number = 0; j < code.length; j++) {
221-
const codeValue: string = code[j] as string;
221+
const codeValue: string = code[parseInt(j.toString(), 10)] as string;
222222
const check: boolean = (type !== 'UpcA' && type !== 'UpcE' && type !== 'Code11' && type !== 'Code93' && type !== 'Code93Extension');
223223
const barType: string = this.barCodeType(this.type);
224224
const extraHeight: boolean = this.checkExtraHeight(j, type, code);
@@ -236,8 +236,8 @@ export abstract class OneDimension extends BarcodeBase {
236236
renderText = true;
237237
}
238238
const canDrawCheck: boolean = (type === 'Code39' || type === 'Code93Extension' || type === 'Code32' || type === 'Code11' || type === 'Code39Extension');
239-
const candraw: boolean = canDrawCheck ? (k % 2 ? false : true) : (codeValue[k] === '1' ? true : false);
240-
const string: string = codeValue.toString(); const number: number = Number(string[k]); let width: number;
239+
const candraw: boolean = canDrawCheck ? (k % 2 ? false : true) : (codeValue[parseInt(k.toString(), 10)] === '1' ? true : false);
240+
const string: string = codeValue.toString(); const number: number = Number(string[parseInt(k.toString(), 10)]); let width: number;
241241
width = this.getWidthValue(number, width, type); width = width * ratio; textProperty = this.displayText;
242242
const text: string = this.getDisplayText(j, textProperty);
243243
textOptions = this.getBaseAttributes(
@@ -397,7 +397,7 @@ export abstract class OneDimension extends BarcodeBase {
397397
: void {
398398
const barcodeRenderer: BarcodeRenderer = this.getInstance(canvas.id);
399399
for (let i: number = 0; i < options.length; i++) {
400-
barcodeRenderer.renderRectElement(canvas as HTMLCanvasElement, options[i]);
400+
barcodeRenderer.renderRectElement(canvas as HTMLCanvasElement, options[parseInt(i.toString(), 10)]);
401401
}
402402
}
403403

controls/barcodegenerator/src/barcode/one-dimension/codabar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export class CodaBar extends OneDimension {
5757
private getPatternCollection(givenCharacter: string, codes: string[]): number[] {
5858
const code: number[] = [];
5959
for (let i: number = 0; i < givenCharacter.length; i++) {
60-
const char: string = givenCharacter[i];
61-
code.push(codes[char]);
60+
const char: string = givenCharacter[parseInt(i.toString(), 10)];
61+
code.push(codes[`${char}`]);
6262
}
6363
return code;
6464
}

controls/barcodegenerator/src/barcode/one-dimension/code11.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class Code11 extends OneDimension {
5050
const code: string[] = [];
5151
const codes: string[] = this.getCodeValue() as string[];
5252
for (let i: number = 0; i < givenChar.length; i++) {
53-
code.push(codes[givenChar[i]]);
53+
code.push(codes[givenChar[parseInt(i.toString(), 10)]]);
5454
}
5555
return code;
5656
}

controls/barcodegenerator/src/barcode/one-dimension/code128.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class Code128 extends OneDimension {
5151
private getBytes(givenWord: string): number[] {
5252
const bytes: number[] = [];
5353
for (let i: number = 0; i < givenWord.length; i++) {
54-
bytes.push(givenWord[i].charCodeAt(0));
54+
bytes.push(givenWord[parseInt(i.toString(), 10)].charCodeAt(0));
5555
}
5656
return bytes;
5757
}
@@ -215,7 +215,7 @@ export class Code128 extends OneDimension {
215215
// Get a bar symbol by index
216216
private getCodes(index: number): string {
217217
const codes: number[] = this.getCodeValue();
218-
return codes[index] ? codes[index].toString() : '';
218+
return codes[parseInt(index.toString(), 10)] ? codes[parseInt(index.toString(), 10)].toString() : '';
219219
}
220220

221221
}

controls/barcodegenerator/src/barcode/one-dimension/code32.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export class Code32 extends OneDimension {
4949
const codes: object[] = this.getCodeValue();
5050
for (let i: number = 0; i <= givenChar.length; i++) {
5151
for (let j: number = 0; j < codes.length; j++) {
52-
if (givenChar[i] === codes[j][0]) {
53-
code.push(codes[j][2][0]);
52+
if (givenChar[parseInt(i.toString(), 10)] === codes[parseInt(j.toString(), 10)][0]) {
53+
code.push(codes[parseInt(j.toString(), 10)][2][0]);
5454
}
5555
}
5656
}

controls/barcodegenerator/src/barcode/one-dimension/code39.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class Code39 extends OneDimension {
4444
private checkSum(char: string, characters: string): number {
4545
let checksum: number = 0;
4646
for (let i: number = 0; i < char.length; i++) {
47-
const codeNumber: number = characters.indexOf(char[i]);
47+
const codeNumber: number = characters.indexOf(char[parseInt(i.toString(), 10)]);
4848
checksum += codeNumber;
4949
}
5050
checksum = checksum % 43;
@@ -73,7 +73,7 @@ export class Code39 extends OneDimension {
7373
const codes: string[] = this.getCodeValue();
7474
for (let i: number = 0; i < givenChar.length; i++) {
7575
codeNumber = characters.indexOf(givenChar.charAt(i));
76-
code.push(codes[codeNumber]);
76+
code.push(codes[parseInt(codeNumber.toString(), 10)]);
7777
}
7878
return code;
7979
}

controls/barcodegenerator/src/barcode/one-dimension/code39Extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ export class Code39Extension extends Code39 {
125125
const code: object = this.code39ExtensionValues();
126126
let asciivalue: number;
127127
for (let i: number = 0; i < givenCharacter.length; i++) {
128-
asciivalue = givenCharacter[i].charCodeAt(0);
129-
encodedString += code[asciivalue];
128+
asciivalue = givenCharacter[parseInt(i.toString(), 10)].charCodeAt(0);
129+
encodedString += code[parseInt(asciivalue.toString(), 10)];
130130
}
131131
return encodedString;
132132
}

controls/barcodegenerator/src/barcode/one-dimension/code93.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ export class Code93 extends OneDimension {
137137
private getPatternCollection(givenCharacter: string, codes: string[], encodingValue: string[]): void {
138138
const code: string[] = encodingValue;
139139
for (let i: number = 0; i < givenCharacter.length; i++) {
140-
const char: string = givenCharacter[i];
141-
code.push(codes[char]);
140+
const char: string = givenCharacter[parseInt(i.toString(), 10)];
141+
code.push(codes[`${char}`]);
142142
}
143143
}
144144

@@ -150,13 +150,13 @@ export class Code93 extends OneDimension {
150150
// eslint-disable-next-line
151151
const codes: object = this.getCharacterWeight();
152152
for (let i: number = value.length; i > 0; i--) {
153-
const characterValue: number = codes[value[j]] * i;
153+
const characterValue: number = codes[value[parseInt(j.toString(), 10)]] * i;
154154
weightSum += characterValue;
155155
j++;
156156
}
157157
const moduloValue: number = weightSum % 47;
158158
const objectValue: string[] = Object.keys(codes);
159-
const appendSymbol: string = objectValue[moduloValue];
159+
const appendSymbol: string = objectValue[parseInt(moduloValue.toString(), 10)];
160160
return appendSymbol;
161161
}
162162

0 commit comments

Comments
 (0)