@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,33 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import MSI_FUNC from './MSI.js';
|
|
2
|
+
import _checksums from './checksums.js';
|
|
3
|
+
|
|
4
|
+
function _classCallCheck(instance, Constructor) {
|
|
5
|
+
if (!(instance instanceof Constructor)) {
|
|
6
|
+
throw new TypeError('Cannot call a class as a function');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function _possibleConstructorReturn(self, call) {
|
|
10
|
+
if (!self) {
|
|
11
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
12
|
+
}
|
|
13
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
14
|
+
}
|
|
15
|
+
function _inherits(subClass, superClass) {
|
|
16
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
17
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
18
|
+
}
|
|
19
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
20
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
21
|
+
});
|
|
22
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var MSI10 = (function (_MSI) {
|
|
26
|
+
_inherits(MSI10, _MSI);
|
|
27
|
+
|
|
28
|
+
function MSI10(data, options) {
|
|
29
|
+
_classCallCheck(this, MSI10);
|
|
30
|
+
|
|
31
|
+
return _possibleConstructorReturn(
|
|
32
|
+
this,
|
|
33
|
+
(MSI10.__proto__ || Object.getPrototypeOf(MSI10)).call(this, data + (0, _checksums.mod10)(data), options)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return MSI10;
|
|
38
|
+
})(MSI_FUNC);
|
|
39
|
+
|
|
40
|
+
export default MSI10;
|
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import _checksums from './checksums.js';
|
|
2
|
+
import MSI_FUNC from './MSI.js';
|
|
3
|
+
|
|
4
|
+
function _classCallCheck(instance, Constructor) {
|
|
5
|
+
if (!(instance instanceof Constructor)) {
|
|
6
|
+
throw new TypeError('Cannot call a class as a function');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function _possibleConstructorReturn(self, call) {
|
|
11
|
+
if (!self) {
|
|
12
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
13
|
+
}
|
|
14
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) {
|
|
18
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
19
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
20
|
+
}
|
|
21
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
22
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
23
|
+
});
|
|
24
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var MSI1010 = (function (_MSI) {
|
|
28
|
+
_inherits(MSI1010, _MSI);
|
|
29
|
+
|
|
30
|
+
function MSI1010(data, options) {
|
|
31
|
+
_classCallCheck(this, MSI1010);
|
|
32
|
+
|
|
33
|
+
data += (0, _checksums.mod10)(data);
|
|
34
|
+
data += (0, _checksums.mod10)(data);
|
|
35
|
+
return _possibleConstructorReturn(this, (MSI1010.__proto__ || Object.getPrototypeOf(MSI1010)).call(this, data, options));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return MSI1010;
|
|
39
|
+
})(MSI_FUNC);
|
|
40
|
+
|
|
41
|
+
export default MSI1010;
|
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import _checksums from './checksums.js';
|
|
2
|
+
import MSI_FUNC from './MSI.js';
|
|
3
|
+
|
|
4
|
+
function _classCallCheck(instance, Constructor) {
|
|
5
|
+
if (!(instance instanceof Constructor)) {
|
|
6
|
+
throw new TypeError('Cannot call a class as a function');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function _possibleConstructorReturn(self, call) {
|
|
11
|
+
if (!self) {
|
|
12
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
13
|
+
}
|
|
14
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) {
|
|
18
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
19
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
20
|
+
}
|
|
21
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
22
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
23
|
+
});
|
|
24
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var MSI11 = (function (_MSI) {
|
|
28
|
+
_inherits(MSI11, _MSI);
|
|
29
|
+
|
|
30
|
+
function MSI11(data, options) {
|
|
31
|
+
_classCallCheck(this, MSI11);
|
|
32
|
+
|
|
33
|
+
return _possibleConstructorReturn(
|
|
34
|
+
this,
|
|
35
|
+
(MSI11.__proto__ || Object.getPrototypeOf(MSI11)).call(this, data + (0, _checksums.mod11)(data), options)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return MSI11;
|
|
40
|
+
})(MSI_FUNC);
|
|
41
|
+
|
|
42
|
+
export default MSI11;
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import _checksums from './checksums.js';
|
|
2
|
+
import MSI_FUNC from './MSI.js';
|
|
3
|
+
|
|
4
|
+
function _classCallCheck(instance, Constructor) {
|
|
5
|
+
if (!(instance instanceof Constructor)) {
|
|
6
|
+
throw new TypeError('Cannot call a class as a function');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function _possibleConstructorReturn(self, call) {
|
|
10
|
+
if (!self) {
|
|
11
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
12
|
+
}
|
|
13
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function _inherits(subClass, superClass) {
|
|
17
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
18
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
19
|
+
}
|
|
20
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
21
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
22
|
+
});
|
|
23
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var MSI1110 = (function (_MSI) {
|
|
27
|
+
_inherits(MSI1110, _MSI);
|
|
28
|
+
function MSI1110(data, options) {
|
|
29
|
+
_classCallCheck(this, MSI1110);
|
|
30
|
+
data += (0, _checksums.mod11)(data);
|
|
31
|
+
data += (0, _checksums.mod10)(data);
|
|
32
|
+
return _possibleConstructorReturn(this, (MSI1110.__proto__ || Object.getPrototypeOf(MSI1110)).call(this, data, options));
|
|
33
|
+
}
|
|
34
|
+
return MSI1110;
|
|
35
|
+
})(MSI_FUNC);
|
|
36
|
+
|
|
37
|
+
export default MSI1110;
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mod10 = mod10;
|
|
7
|
-
exports.mod11 = mod11;
|
|
8
1
|
function mod10(number) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
var sum = 0;
|
|
3
|
+
for (var i = 0; i < number.length; i++) {
|
|
4
|
+
var n = parseInt(number[i]);
|
|
5
|
+
if ((i + number.length) % 2 === 0) {
|
|
6
|
+
sum += n;
|
|
7
|
+
} else {
|
|
8
|
+
sum += ((n * 2) % 10) + Math.floor((n * 2) / 10);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return (10 - (sum % 10)) % 10;
|
|
19
12
|
}
|
|
20
13
|
|
|
21
14
|
function mod11(number) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
15
|
+
var sum = 0;
|
|
16
|
+
var weights = [2, 3, 4, 5, 6, 7];
|
|
17
|
+
for (var i = 0; i < number.length; i++) {
|
|
18
|
+
var n = parseInt(number[number.length - 1 - i]);
|
|
19
|
+
sum += weights[i % weights.length] * n;
|
|
20
|
+
}
|
|
21
|
+
return (11 - (sum % 11)) % 11;
|
|
22
|
+
}
|
|
23
|
+
export default {
|
|
24
|
+
mod10: mod10,
|
|
25
|
+
mod11: mod11
|
|
26
|
+
};
|
|
@@ -1,34 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _MSI4 = _interopRequireDefault(_MSI3);
|
|
15
|
-
|
|
16
|
-
var _MSI5 = require('./MSI11.js');
|
|
17
|
-
|
|
18
|
-
var _MSI6 = _interopRequireDefault(_MSI5);
|
|
19
|
-
|
|
20
|
-
var _MSI7 = require('./MSI1010.js');
|
|
21
|
-
|
|
22
|
-
var _MSI8 = _interopRequireDefault(_MSI7);
|
|
23
|
-
|
|
24
|
-
var _MSI9 = require('./MSI1110.js');
|
|
25
|
-
|
|
26
|
-
var _MSI10 = _interopRequireDefault(_MSI9);
|
|
27
|
-
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
|
-
exports.MSI = _MSI2.default;
|
|
31
|
-
exports.MSI10 = _MSI4.default;
|
|
32
|
-
exports.MSI11 = _MSI6.default;
|
|
33
|
-
exports.MSI1010 = _MSI8.default;
|
|
34
|
-
exports.MSI1110 = _MSI10.default;
|
|
1
|
+
import MSI from './MSI.js';
|
|
2
|
+
import MSI10 from './MSI10.js';
|
|
3
|
+
import MSI11 from './MSI11.js';
|
|
4
|
+
import MSI1010 from './MSI1010.js';
|
|
5
|
+
import MSI1110 from './MSI1110.js';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
MSI: MSI,
|
|
9
|
+
MSI10: MSI10,
|
|
10
|
+
MSI11: MSI11,
|
|
11
|
+
MSI1010: MSI1010,
|
|
12
|
+
MSI1110: MSI1110
|
|
13
|
+
};
|
|
@@ -1,92 +1,122 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function
|
|
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
|
+
function _possibleConstructorReturn(self, call) {
|
|
26
|
+
if (!self) {
|
|
27
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
28
|
+
}
|
|
29
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _inherits(subClass, superClass) {
|
|
33
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
34
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
35
|
+
}
|
|
36
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
37
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
38
|
+
});
|
|
39
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
40
|
+
}
|
|
41
|
+
// Encoding specification:
|
|
21
42
|
// http://www.barcodeisland.com/codabar.phtml
|
|
22
43
|
|
|
23
|
-
var codabar = function (_Barcode) {
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
44
|
+
var codabar = (function (_Barcode) {
|
|
45
|
+
_inherits(codabar, _Barcode);
|
|
46
|
+
|
|
47
|
+
function codabar(data, options) {
|
|
48
|
+
_classCallCheck(this, codabar);
|
|
49
|
+
|
|
50
|
+
if (data.search(/^[0-9\-\$\:\.\+\/]+$/) === 0) {
|
|
51
|
+
data = 'A' + data + 'A';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var _this = _possibleConstructorReturn(
|
|
55
|
+
this,
|
|
56
|
+
(codabar.__proto__ || Object.getPrototypeOf(codabar)).call(this, data.toUpperCase(), options)
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
_this.text = _this.options.text || _this.text.replace(/[A-D]/g, '');
|
|
60
|
+
return _this;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
_createClass(codabar, [
|
|
64
|
+
{
|
|
65
|
+
key: 'valid',
|
|
66
|
+
value: function valid() {
|
|
67
|
+
return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: 'encode',
|
|
72
|
+
value: function encode() {
|
|
73
|
+
var result = [];
|
|
74
|
+
var encodings = this.getEncodings();
|
|
75
|
+
for (var i = 0; i < this.data.length; i++) {
|
|
76
|
+
result.push(encodings[this.data.charAt(i)]);
|
|
77
|
+
// for all characters except the last, append a narrow-space ("0")
|
|
78
|
+
if (i !== this.data.length - 1) {
|
|
79
|
+
result.push('0');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
text: this.text,
|
|
84
|
+
data: result.join('')
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: 'getEncodings',
|
|
90
|
+
value: function getEncodings() {
|
|
91
|
+
return {
|
|
92
|
+
0: '101010011',
|
|
93
|
+
1: '101011001',
|
|
94
|
+
2: '101001011',
|
|
95
|
+
3: '110010101',
|
|
96
|
+
4: '101101001',
|
|
97
|
+
5: '110101001',
|
|
98
|
+
6: '100101011',
|
|
99
|
+
7: '100101101',
|
|
100
|
+
8: '100110101',
|
|
101
|
+
9: '110100101',
|
|
102
|
+
'-': '101001101',
|
|
103
|
+
$: '101100101',
|
|
104
|
+
':': '1101011011',
|
|
105
|
+
'/': '1101101011',
|
|
106
|
+
'.': '1101101101',
|
|
107
|
+
'+': '101100110011',
|
|
108
|
+
A: '1011001001',
|
|
109
|
+
B: '1001001011',
|
|
110
|
+
C: '1010010011',
|
|
111
|
+
D: '1010011001'
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
]);
|
|
116
|
+
|
|
117
|
+
return codabar;
|
|
118
|
+
})(BarcodeFunc);
|
|
119
|
+
|
|
120
|
+
export default {
|
|
121
|
+
codabar: codabar
|
|
122
|
+
};
|
|
File without changes
|