@10yun/cv-mobile-ui 0.4.11 → 0.5.1
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/package.json +1 -1
- package/plugins/MessageBox.js +2 -2
- package/plugins/MessageTip.js +4 -4
- package/plugins/request.js +54 -39
- package/plugins/storage.js +1 -4
- package/plugins/utils.js +13 -0
- package/ui-cv/cv-draw-barcode/barcode.js +225 -202
- package/ui-cv/cv-draw-barcode/barcodes/Barcode.js +14 -17
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128.js +202 -164
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128A.js +58 -35
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128B.js +58 -36
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128C.js +58 -34
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128_AUTO.js +50 -41
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/auto.js +43 -57
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/constants.js +71 -30
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/index.js +11 -29
- package/ui-cv/cv-draw-barcode/barcodes/CODE39/index.js +150 -77
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN.js +122 -90
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN13.js +169 -111
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN2.js +77 -56
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN5.js +84 -60
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN8.js +133 -74
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/UPC.js +174 -156
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/UPCE.js +220 -174
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/constants.js +80 -21
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/encoder.js +18 -24
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/index.js +15 -39
- package/ui-cv/cv-draw-barcode/barcodes/GenericBarcode/index.js +80 -55
- package/ui-cv/cv-draw-barcode/barcodes/ITF/ITF.js +99 -69
- package/ui-cv/cv-draw-barcode/barcodes/ITF/ITF14.js +73 -45
- package/ui-cv/cv-draw-barcode/barcodes/ITF/constants.js +8 -8
- package/ui-cv/cv-draw-barcode/barcodes/ITF/index.js +6 -18
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI.js +86 -66
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI10.js +40 -33
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI1010.js +41 -35
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI11.js +42 -33
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI1110.js +37 -35
- package/ui-cv/cv-draw-barcode/barcodes/MSI/checksums.js +22 -25
- package/ui-cv/cv-draw-barcode/barcodes/MSI/index.js +13 -34
- package/ui-cv/cv-draw-barcode/barcodes/codabar/index.js +120 -90
- package/ui-cv/cv-draw-barcode/barcodes/common.js +0 -0
- package/ui-cv/cv-draw-barcode/barcodes/index.js +32 -33
- package/ui-cv/cv-draw-barcode/barcodes/index.tmp.js +32 -33
- package/ui-cv/cv-draw-barcode/barcodes/pharmacode/index.js +93 -71
- package/ui-cv/cv-draw-barcode/cv-draw-barcode.vue +4 -4
- package/ui-cv/cv-icons/icons/default-icons.js +132 -0
- package/ui-cv/cv-icons/icons/icons-action.js +72 -0
- package/ui-cv/cv-icons/icons/icons-arrow.js +46 -0
- package/ui-cv/cv-icons/icons/icons-base.js +89 -0
- package/ui-cv/cv-icons/icons/icons-mall.js +34 -0
- package/ui-cv/cv-icons/icons/icons-media.js +44 -0
- package/ui-cv/cv-icons/icons/icons-order.js +33 -0
- package/ui-cv/cv-icons/icons/icons-people.js +46 -0
- package/ui-cv/cv-icons/icons/icons-status.js +32 -0
- package/ui-cv/cv-icons/icons/icons-wallet.js +15 -0
- package/ui-cv/cv-icons/icons.js +14 -13
- package/ui-cv/cv-lists-base/cv-lists-base.vue +0 -2
- package/ui-cv/cv-tab-lists/cv-tab-lists.vue +0 -2
- package/ui-uni/u-charts/u-charts.js +1093 -744
- package/ui-uni/uni-list/uni-refresh.wxs +1 -1
- package/ui-uni/uni-swipe-action-item/index.wxs +6 -6
|
@@ -1,55 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import { BarcodeFunc } from '../Barcode.js';
|
|
2
|
+
|
|
3
|
+
var _createClass = (function () {
|
|
4
|
+
function defineProperties(target, props) {
|
|
5
|
+
for (var i = 0; i < props.length; i++) {
|
|
6
|
+
var descriptor = props[i];
|
|
7
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
8
|
+
descriptor.configurable = true;
|
|
9
|
+
if ('value' in descriptor) descriptor.writable = true;
|
|
10
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return function (Constructor, protoProps, staticProps) {
|
|
14
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
15
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
16
|
+
return Constructor;
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
|
+
|
|
20
|
+
function _classCallCheck(instance, Constructor) {
|
|
21
|
+
if (!(instance instanceof Constructor)) {
|
|
22
|
+
throw new TypeError('Cannot call a class as a function');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function _possibleConstructorReturn(self, call) {
|
|
27
|
+
if (!self) {
|
|
28
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
29
|
+
}
|
|
30
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function _inherits(subClass, superClass) {
|
|
34
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
35
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
36
|
+
}
|
|
37
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
38
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
39
|
+
});
|
|
40
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var GenericBarcode = (function (_Barcode) {
|
|
44
|
+
_inherits(GenericBarcode, _Barcode);
|
|
45
|
+
|
|
46
|
+
function GenericBarcode(data, options) {
|
|
47
|
+
_classCallCheck(this, GenericBarcode);
|
|
48
|
+
|
|
49
|
+
return _possibleConstructorReturn(
|
|
50
|
+
this,
|
|
51
|
+
(GenericBarcode.__proto__ || Object.getPrototypeOf(GenericBarcode)).call(this, data, options)
|
|
52
|
+
); // Sets this.data and this.text
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Return the corresponding binary numbers for the data provided
|
|
56
|
+
|
|
57
|
+
_createClass(GenericBarcode, [
|
|
58
|
+
{
|
|
59
|
+
key: 'encode',
|
|
60
|
+
value: function encode() {
|
|
61
|
+
return {
|
|
62
|
+
data: '10101010101010101010101010101010101010101',
|
|
63
|
+
text: this.text
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Resturn true/false if the string provided is valid for this encoder
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'valid',
|
|
71
|
+
value: function valid() {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
return GenericBarcode;
|
|
78
|
+
})(BarcodeFunc);
|
|
79
|
+
|
|
80
|
+
export default GenericBarcode;
|
|
@@ -1,69 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
import _constants from './constants';
|
|
2
|
+
import { BarcodeFunc } from '../Barcode.js';
|
|
3
|
+
|
|
4
|
+
var _createClass = (function () {
|
|
5
|
+
function defineProperties(target, props) {
|
|
6
|
+
for (var i = 0; i < props.length; i++) {
|
|
7
|
+
var descriptor = props[i];
|
|
8
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
9
|
+
descriptor.configurable = true;
|
|
10
|
+
if ('value' in descriptor) descriptor.writable = true;
|
|
11
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return function (Constructor, protoProps, staticProps) {
|
|
15
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
16
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
17
|
+
return Constructor;
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
|
|
21
|
+
function _classCallCheck(instance, Constructor) {
|
|
22
|
+
if (!(instance instanceof Constructor)) {
|
|
23
|
+
throw new TypeError('Cannot call a class as a function');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _possibleConstructorReturn(self, call) {
|
|
28
|
+
if (!self) {
|
|
29
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
30
|
+
}
|
|
31
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _inherits(subClass, superClass) {
|
|
35
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
36
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
37
|
+
}
|
|
38
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
39
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
40
|
+
});
|
|
41
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var ITF = (function (_Barcode) {
|
|
45
|
+
_inherits(ITF, _Barcode);
|
|
46
|
+
|
|
47
|
+
function ITF() {
|
|
48
|
+
_classCallCheck(this, ITF);
|
|
49
|
+
|
|
50
|
+
return _possibleConstructorReturn(this, (ITF.__proto__ || Object.getPrototypeOf(ITF)).apply(this, arguments));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
_createClass(ITF, [
|
|
54
|
+
{
|
|
55
|
+
key: 'valid',
|
|
56
|
+
value: function valid() {
|
|
57
|
+
return this.data.search(/^([0-9]{2})+$/) !== -1;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: 'encode',
|
|
62
|
+
value: function encode() {
|
|
63
|
+
var _this2 = this;
|
|
64
|
+
|
|
65
|
+
// Calculate all the digit pairs
|
|
66
|
+
var encoded = this.data
|
|
67
|
+
.match(/.{2}/g)
|
|
68
|
+
.map(function (pair) {
|
|
69
|
+
return _this2.encodePair(pair);
|
|
70
|
+
})
|
|
71
|
+
.join('');
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
data: _constants.START_BIN + encoded + _constants.END_BIN,
|
|
75
|
+
text: this.text
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Calculate the data of a number pair
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: 'encodePair',
|
|
83
|
+
value: function encodePair(pair) {
|
|
84
|
+
var second = _constants.BINARIES[pair[1]];
|
|
85
|
+
|
|
86
|
+
return _constants.BINARIES[pair[0]]
|
|
87
|
+
.split('')
|
|
88
|
+
.map(function (first, idx) {
|
|
89
|
+
return (first === '1' ? '111' : '1') + (second[idx] === '1' ? '000' : '0');
|
|
90
|
+
})
|
|
91
|
+
.join('');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
]);
|
|
95
|
+
|
|
96
|
+
return ITF;
|
|
97
|
+
})(BarcodeFunc);
|
|
98
|
+
|
|
99
|
+
export default ITF;
|
|
@@ -1,55 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import ITF from './ITF';
|
|
2
|
+
|
|
3
|
+
var _createClass = (function () {
|
|
4
|
+
function defineProperties(target, props) {
|
|
5
|
+
for (var i = 0; i < props.length; i++) {
|
|
6
|
+
var descriptor = props[i];
|
|
7
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
8
|
+
descriptor.configurable = true;
|
|
9
|
+
if ('value' in descriptor) descriptor.writable = true;
|
|
10
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return function (Constructor, protoProps, staticProps) {
|
|
14
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
15
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
16
|
+
return Constructor;
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
|
+
|
|
20
|
+
function _classCallCheck(instance, Constructor) {
|
|
21
|
+
if (!(instance instanceof Constructor)) {
|
|
22
|
+
throw new TypeError('Cannot call a class as a function');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function _possibleConstructorReturn(self, call) {
|
|
27
|
+
if (!self) {
|
|
28
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
29
|
+
}
|
|
30
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function _inherits(subClass, superClass) {
|
|
34
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
35
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
36
|
+
}
|
|
37
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
38
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
39
|
+
});
|
|
40
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
41
|
+
}
|
|
20
42
|
|
|
21
43
|
// Calculate the checksum digit
|
|
22
44
|
var checksum = function checksum(data) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
var res = data
|
|
46
|
+
.substr(0, 13)
|
|
47
|
+
.split('')
|
|
48
|
+
.map(function (num) {
|
|
49
|
+
return parseInt(num, 10);
|
|
50
|
+
})
|
|
51
|
+
.reduce(function (sum, n, idx) {
|
|
52
|
+
return sum + n * (3 - (idx % 2) * 2);
|
|
53
|
+
}, 0);
|
|
54
|
+
|
|
55
|
+
return Math.ceil(res / 10) * 10 - res;
|
|
30
56
|
};
|
|
31
57
|
|
|
32
|
-
var ITF14 = function (_ITF) {
|
|
33
|
-
|
|
58
|
+
var ITF14 = (function (_ITF) {
|
|
59
|
+
_inherits(ITF14, _ITF);
|
|
34
60
|
|
|
35
|
-
|
|
36
|
-
|
|
61
|
+
function ITF14(data, options) {
|
|
62
|
+
_classCallCheck(this, ITF14);
|
|
37
63
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
64
|
+
// Add checksum if it does not exist
|
|
65
|
+
if (data.search(/^[0-9]{13}$/) !== -1) {
|
|
66
|
+
data += checksum(data);
|
|
67
|
+
}
|
|
68
|
+
return _possibleConstructorReturn(this, (ITF14.__proto__ || Object.getPrototypeOf(ITF14)).call(this, data, options));
|
|
69
|
+
}
|
|
44
70
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
71
|
+
_createClass(ITF14, [
|
|
72
|
+
{
|
|
73
|
+
key: 'valid',
|
|
74
|
+
value: function valid() {
|
|
75
|
+
return this.data.search(/^[0-9]{14}$/) !== -1 && +this.data[13] === checksum(this.data);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]);
|
|
51
79
|
|
|
52
|
-
|
|
53
|
-
}(
|
|
80
|
+
return ITF14;
|
|
81
|
+
})(ITF);
|
|
54
82
|
|
|
55
|
-
|
|
83
|
+
export default ITF14;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
var START_BIN = '1010';
|
|
2
|
+
var END_BIN = '11101';
|
|
3
|
+
var BINARIES = ['00110', '10001', '01001', '11000', '00101', '10100', '01100', '00011', '10010', '01010'];
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var BINARIES = exports.BINARIES = ['00110', '10001', '01001', '11000', '00101', '10100', '01100', '00011', '10010', '01010'];
|
|
5
|
+
export default {
|
|
6
|
+
START_BIN: START_BIN,
|
|
7
|
+
END_BIN: END_BIN,
|
|
8
|
+
BINARIES: BINARIES
|
|
9
|
+
};
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import ITF from './ITF';
|
|
2
|
+
import ITF14 from './ITF14';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _ITF = require('./ITF');
|
|
9
|
-
|
|
10
|
-
var _ITF2 = _interopRequireDefault(_ITF);
|
|
11
|
-
|
|
12
|
-
var _ITF3 = require('./ITF14');
|
|
13
|
-
|
|
14
|
-
var _ITF4 = _interopRequireDefault(_ITF3);
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
exports.ITF = _ITF2.default;
|
|
19
|
-
exports.ITF14 = _ITF4.default;
|
|
4
|
+
export default {
|
|
5
|
+
ITF: ITF,
|
|
6
|
+
ITF14: ITF14
|
|
7
|
+
};
|
|
@@ -1,74 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var _createClass = (function () {
|
|
2
|
+
function defineProperties(target, props) {
|
|
3
|
+
for (var i = 0; i < props.length; i++) {
|
|
4
|
+
var descriptor = props[i];
|
|
5
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
6
|
+
descriptor.configurable = true;
|
|
7
|
+
if ('value' in descriptor) descriptor.writable = true;
|
|
8
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return function (Constructor, protoProps, staticProps) {
|
|
12
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
13
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
14
|
+
return Constructor;
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
|
|
18
|
+
function _classCallCheck(instance, Constructor) {
|
|
19
|
+
if (!(instance instanceof Constructor)) {
|
|
20
|
+
throw new TypeError('Cannot call a class as a function');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
16
23
|
|
|
17
|
-
function _possibleConstructorReturn(self, call) {
|
|
24
|
+
function _possibleConstructorReturn(self, call) {
|
|
25
|
+
if (!self) {
|
|
26
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
27
|
+
}
|
|
28
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
29
|
+
}
|
|
18
30
|
|
|
19
|
-
function _inherits(subClass, superClass) {
|
|
31
|
+
function _inherits(subClass, superClass) {
|
|
32
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
33
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
34
|
+
}
|
|
35
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
36
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
37
|
+
});
|
|
38
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
39
|
+
} // Encoding documentation
|
|
20
40
|
// https://en.wikipedia.org/wiki/MSI_Barcode#Character_set_and_binary_lookup
|
|
21
41
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}(
|
|
42
|
+
import { BarcodeFunc } from '../Barcode.js';
|
|
43
|
+
|
|
44
|
+
var MSI = (function (_Barcode) {
|
|
45
|
+
_inherits(MSI, _Barcode);
|
|
46
|
+
function MSI(data, options) {
|
|
47
|
+
_classCallCheck(this, MSI);
|
|
48
|
+
return _possibleConstructorReturn(this, (MSI.__proto__ || Object.getPrototypeOf(MSI)).call(this, data, options));
|
|
49
|
+
}
|
|
50
|
+
_createClass(MSI, [
|
|
51
|
+
{
|
|
52
|
+
key: 'encode',
|
|
53
|
+
value: function encode() {
|
|
54
|
+
// Start bits
|
|
55
|
+
var ret = '110';
|
|
56
|
+
|
|
57
|
+
for (var i = 0; i < this.data.length; i++) {
|
|
58
|
+
// Convert the character to binary (always 4 binary digits)
|
|
59
|
+
var digit = parseInt(this.data[i]);
|
|
60
|
+
var bin = digit.toString(2);
|
|
61
|
+
bin = addZeroes(bin, 4 - bin.length);
|
|
62
|
+
|
|
63
|
+
// Add 100 for every zero and 110 for every 1
|
|
64
|
+
for (var b = 0; b < bin.length; b++) {
|
|
65
|
+
ret += bin[b] == '0' ? '100' : '110';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// End bits
|
|
69
|
+
ret += '1001';
|
|
70
|
+
return {
|
|
71
|
+
data: ret,
|
|
72
|
+
text: this.text
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: 'valid',
|
|
78
|
+
value: function valid() {
|
|
79
|
+
return this.data.search(/^[0-9]+$/) !== -1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]);
|
|
83
|
+
|
|
84
|
+
return MSI;
|
|
85
|
+
})(BarcodeFunc);
|
|
66
86
|
|
|
67
87
|
function addZeroes(number, n) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
88
|
+
for (var i = 0; i < n; i++) {
|
|
89
|
+
number = '0' + number;
|
|
90
|
+
}
|
|
91
|
+
return number;
|
|
72
92
|
}
|
|
73
93
|
|
|
74
|
-
|
|
94
|
+
export default MSI;
|