@progress/kendo-charts 1.19.0 → 1.20.0-dev.202111081615
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/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/chart/chart.js +13 -5
- package/dist/es/chart/constants.js +3 -1
- package/dist/es/chart/pan-and-zoom/mousewheel-zoom.js +8 -4
- package/dist/es/chart/selection.js +41 -1
- package/dist/es/common/create-hash-set.js +11 -1
- package/dist/es/common/mousewheel-delta.js +4 -7
- package/dist/es/core/axis.js +35 -0
- package/dist/es/core/category-axis.js +23 -17
- package/dist/es/core/date-category-axis.js +26 -38
- package/dist/es/core/date-value-axis.js +32 -33
- package/dist/es/core/logarithmic-axis.js +30 -27
- package/dist/es/core/numeric-axis.js +24 -20
- package/dist/es/main.js +1 -0
- package/dist/es/qrcode/encodings/data-modes/alpha-numeric-data-mode.js +103 -0
- package/dist/es/qrcode/encodings/data-modes/byte-data-mode.js +51 -0
- package/dist/es/qrcode/encodings/data-modes/data-mode-instances.js +12 -0
- package/dist/es/qrcode/encodings/data-modes/numeric-data-mode.js +49 -0
- package/dist/es/qrcode/encodings/data-modes/qr-data-mode.js +50 -0
- package/dist/es/qrcode/encodings/encoders/iso-encoder.js +29 -0
- package/dist/es/qrcode/encodings/encoders/utf8-encoder.js +91 -0
- package/dist/es/qrcode/encodings/encoding-result.js +16 -0
- package/dist/es/qrcode/encodings/encoding.js +701 -0
- package/dist/es/qrcode/encodings/free-cell-visitor.js +57 -0
- package/dist/es/qrcode/encodings/version-codewords.js +1289 -0
- package/dist/es/qrcode/qrcode.js +403 -0
- package/dist/es/qrcode/utils.js +28 -0
- package/dist/es/qrcode.js +1 -0
- package/dist/es/stock/navigator.js +3 -2
- package/dist/es2015/chart/chart.js +13 -5
- package/dist/es2015/chart/constants.js +3 -1
- package/dist/es2015/chart/pan-and-zoom/mousewheel-zoom.js +6 -4
- package/dist/es2015/chart/selection.js +40 -1
- package/dist/es2015/common/create-hash-set.js +11 -1
- package/dist/es2015/common/mousewheel-delta.js +4 -7
- package/dist/es2015/core/axis.js +28 -0
- package/dist/es2015/core/category-axis.js +21 -15
- package/dist/es2015/core/date-category-axis.js +27 -36
- package/dist/es2015/core/date-value-axis.js +33 -33
- package/dist/es2015/core/logarithmic-axis.js +29 -26
- package/dist/es2015/core/numeric-axis.js +24 -20
- package/dist/es2015/main.js +1 -0
- package/dist/es2015/qrcode/encodings/data-modes/alpha-numeric-data-mode.js +91 -0
- package/dist/es2015/qrcode/encodings/data-modes/byte-data-mode.js +41 -0
- package/dist/es2015/qrcode/encodings/data-modes/data-mode-instances.js +13 -0
- package/dist/es2015/qrcode/encodings/data-modes/numeric-data-mode.js +39 -0
- package/dist/es2015/qrcode/encodings/data-modes/qr-data-mode.js +44 -0
- package/dist/es2015/qrcode/encodings/encoders/iso-encoder.js +19 -0
- package/dist/es2015/qrcode/encodings/encoders/utf8-encoder.js +83 -0
- package/dist/es2015/qrcode/encodings/encoding-result.js +10 -0
- package/dist/es2015/qrcode/encodings/encoding.js +701 -0
- package/dist/es2015/qrcode/encodings/free-cell-visitor.js +49 -0
- package/dist/es2015/qrcode/encodings/version-codewords.js +1289 -0
- package/dist/es2015/qrcode/qrcode.js +395 -0
- package/dist/es2015/qrcode/utils.js +28 -0
- package/dist/es2015/qrcode.js +1 -0
- package/dist/es2015/stock/navigator.js +3 -2
- package/dist/npm/main.d.ts +1 -0
- package/dist/npm/main.js +3058 -149
- package/dist/npm/qrcode.d.ts +5 -0
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Class } from '../../../common';
|
|
2
|
+
import { EncodingResult } from '../encoding-result';
|
|
3
|
+
import { DataModeInstances } from '../data-modes/data-mode-instances';
|
|
4
|
+
import { extend } from '../../utils';
|
|
5
|
+
import { toBitsString } from '../../utils';
|
|
6
|
+
import { getVersion } from '../encoding';
|
|
7
|
+
|
|
8
|
+
const BYTE = "byte";
|
|
9
|
+
|
|
10
|
+
export class Utf8Encoder extends Class {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
|
|
14
|
+
this.initProperties();
|
|
15
|
+
|
|
16
|
+
this.mode = DataModeInstances[this.encodingMode];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
initProperties() {
|
|
20
|
+
extend(this, {
|
|
21
|
+
encodingMode: BYTE,
|
|
22
|
+
utfBOM: "111011111011101110111111",
|
|
23
|
+
initialModeCountStringLength: 20,
|
|
24
|
+
ranges: [128, 2048, 65536, 2097152, 67108864]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getEncodingResult(inputString, errorCorrectionLevel) {
|
|
29
|
+
let data = this.encode(inputString),
|
|
30
|
+
dataCodewordsCount = this.getDataCodewordsCount(data),
|
|
31
|
+
version = getVersion(dataCodewordsCount, errorCorrectionLevel),
|
|
32
|
+
dataString = this.mode.getModeCountString(data.length / 8, version) + data;
|
|
33
|
+
|
|
34
|
+
return new EncodingResult(dataString, version);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
getDataCodewordsCount(data) {
|
|
38
|
+
let dataLength = data.length,
|
|
39
|
+
dataCodewordsCount = Math.ceil((this.initialModeCountStringLength + dataLength) / 8);
|
|
40
|
+
|
|
41
|
+
return dataCodewordsCount;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
encode(str) {
|
|
45
|
+
let result = this.utfBOM;
|
|
46
|
+
|
|
47
|
+
for (let i = 0; i < str.length; i++) {
|
|
48
|
+
result += this.encodeCharacter(str.charCodeAt(i));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
encodeCharacter(code) {
|
|
55
|
+
let bytesCount = this.getBytesCount(code),
|
|
56
|
+
bc = bytesCount - 1,
|
|
57
|
+
result = "";
|
|
58
|
+
|
|
59
|
+
if (bytesCount === 1) {
|
|
60
|
+
result = toBitsString(code, 8);
|
|
61
|
+
} else {
|
|
62
|
+
let significantOnes = 8 - bytesCount;
|
|
63
|
+
|
|
64
|
+
for (let i = 0; i < bc; i++) {
|
|
65
|
+
result = toBitsString(code >> (i * 6) & 63 | 128, 8) + result;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
result = ((code >> bc * 6) | ((255 >> significantOnes) << significantOnes)).toString(2) + result;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
getBytesCount(code) {
|
|
75
|
+
let ranges = this.ranges;
|
|
76
|
+
|
|
77
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
78
|
+
if (code < ranges[i]) {
|
|
79
|
+
return i + 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|