yh-hiprint 2.3.5 → 2.4.0
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/HiprintDesigner.vue +494 -86
- package/hooks/useHiprint.js +48 -27
- package/libs/jquery.js +1 -0
- package/libs/jsbarcode/JsBarcode.js +225 -251
- package/libs/jsbarcode/barcodes/Barcode.js +9 -17
- package/libs/jsbarcode/barcodes/CODE128/CODE128.js +93 -133
- package/libs/jsbarcode/barcodes/CODE128/CODE128A.js +10 -38
- package/libs/jsbarcode/barcodes/CODE128/CODE128B.js +10 -38
- package/libs/jsbarcode/barcodes/CODE128/CODE128C.js +10 -38
- package/libs/jsbarcode/barcodes/CODE128/CODE128_AUTO.js +10 -36
- package/libs/jsbarcode/barcodes/CODE128/auto.js +32 -37
- package/libs/jsbarcode/barcodes/CODE128/constants.js +47 -30
- package/libs/jsbarcode/barcodes/CODE128/index.js +5 -28
- package/libs/jsbarcode/barcodes/CODE39/index.js +61 -61
- package/libs/jsbarcode/barcodes/EAN_UPC/EAN.js +58 -78
- package/libs/jsbarcode/barcodes/EAN_UPC/EAN13.js +66 -95
- package/libs/jsbarcode/barcodes/EAN_UPC/EAN2.js +22 -50
- package/libs/jsbarcode/barcodes/EAN_UPC/EAN5.js +29 -54
- package/libs/jsbarcode/barcodes/EAN_UPC/EAN8.js +42 -66
- package/libs/jsbarcode/barcodes/EAN_UPC/UPC.js +92 -125
- package/libs/jsbarcode/barcodes/EAN_UPC/UPCE.js +134 -142
- package/libs/jsbarcode/barcodes/EAN_UPC/constants.js +32 -21
- package/libs/jsbarcode/barcodes/EAN_UPC/encoder.js +11 -18
- package/libs/jsbarcode/barcodes/EAN_UPC/index.js +8 -39
- package/libs/jsbarcode/barcodes/GenericBarcode/index.js +16 -49
- package/libs/jsbarcode/barcodes/ITF/ITF.js +31 -63
- package/libs/jsbarcode/barcodes/ITF/ITF14.js +18 -40
- package/libs/jsbarcode/barcodes/ITF/constants.js +6 -8
- package/libs/jsbarcode/barcodes/ITF/index.js +3 -18
- package/libs/jsbarcode/barcodes/MSI/MSI.js +31 -57
- package/libs/jsbarcode/barcodes/MSI/MSI10.js +7 -30
- package/libs/jsbarcode/barcodes/MSI/MSI1010.js +10 -33
- package/libs/jsbarcode/barcodes/MSI/MSI11.js +7 -30
- package/libs/jsbarcode/barcodes/MSI/MSI1110.js +10 -33
- package/libs/jsbarcode/barcodes/MSI/checksums.js +11 -17
- package/libs/jsbarcode/barcodes/MSI/index.js +6 -33
- package/libs/jsbarcode/barcodes/codabar/index.js +49 -78
- package/libs/jsbarcode/barcodes/index.js +20 -33
- package/libs/jsbarcode/barcodes/pharmacode/index.js +32 -62
- package/libs/jsbarcode/exceptions/ErrorHandler.js +28 -43
- package/libs/jsbarcode/exceptions/exceptions.js +21 -59
- package/libs/jsbarcode/help/fixOptions.js +3 -9
- package/libs/jsbarcode/help/getOptionsFromElement.js +10 -23
- package/libs/jsbarcode/help/getRenderProperties.js +63 -69
- package/libs/jsbarcode/help/linearizeEncodings.js +8 -13
- package/libs/jsbarcode/help/merge.js +1 -11
- package/libs/jsbarcode/help/optionsFromStrings.js +19 -15
- package/libs/jsbarcode/options/defaults.js +2 -7
- package/libs/jsbarcode/renderers/canvas.js +106 -127
- package/libs/jsbarcode/renderers/index.js +4 -20
- package/libs/jsbarcode/renderers/object.js +7 -23
- package/libs/jsbarcode/renderers/shared.js +32 -39
- package/libs/jsbarcode/renderers/svg.js +136 -154
- package/package.json +1 -1
- package/libs/jsbarcode/barcodes/index.tmp.js +0 -33
|
@@ -1,55 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
-
|
|
9
|
-
var _ITF2 = require('./ITF');
|
|
10
|
-
|
|
11
|
-
var _ITF3 = _interopRequireDefault(_ITF2);
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
18
|
-
|
|
19
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
1
|
+
import ITF from './ITF';
|
|
20
2
|
|
|
21
3
|
// Calculate the checksum digit
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
4
|
+
const checksum = (data) => {
|
|
5
|
+
const res = data
|
|
6
|
+
.substr(0, 13)
|
|
7
|
+
.split('')
|
|
8
|
+
.map(num => parseInt(num, 10))
|
|
9
|
+
.reduce((sum, n, idx) => sum + (n * (3 - (idx % 2) * 2)), 0);
|
|
28
10
|
|
|
29
11
|
return Math.ceil(res / 10) * 10 - res;
|
|
30
12
|
};
|
|
31
13
|
|
|
32
|
-
|
|
33
|
-
_inherits(ITF14, _ITF);
|
|
34
|
-
|
|
35
|
-
function ITF14(data, options) {
|
|
36
|
-
_classCallCheck(this, ITF14);
|
|
14
|
+
class ITF14 extends ITF {
|
|
37
15
|
|
|
16
|
+
constructor(data, options) {
|
|
38
17
|
// Add checksum if it does not exist
|
|
39
18
|
if (data.search(/^[0-9]{13}$/) !== -1) {
|
|
40
19
|
data += checksum(data);
|
|
41
20
|
}
|
|
42
|
-
|
|
21
|
+
super(data, options);
|
|
43
22
|
}
|
|
44
23
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
24
|
+
valid() {
|
|
25
|
+
return (
|
|
26
|
+
this.data.search(/^[0-9]{14}$/) !== -1 &&
|
|
27
|
+
+this.data[13] === checksum(this.data)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
51
30
|
|
|
52
|
-
|
|
53
|
-
}(_ITF3.default);
|
|
31
|
+
}
|
|
54
32
|
|
|
55
|
-
|
|
33
|
+
export default ITF14;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export const START_BIN = '1010';
|
|
2
|
+
export const END_BIN = '11101';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var END_BIN = exports.END_BIN = '11101';
|
|
8
|
-
|
|
9
|
-
var BINARIES = exports.BINARIES = ['00110', '10001', '01001', '11000', '00101', '10100', '01100', '00011', '10010', '01010'];
|
|
4
|
+
export const BINARIES = [
|
|
5
|
+
'00110', '10001', '01001', '11000', '00101',
|
|
6
|
+
'10100', '01100', '00011', '10010', '01010',
|
|
7
|
+
];
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import ITF from './ITF';
|
|
2
|
+
import ITF14 from './ITF14';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ITF14 = exports.ITF = undefined;
|
|
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 { ITF, ITF14 };
|
|
@@ -1,74 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
-
|
|
9
|
-
var _Barcode2 = require("../Barcode.js");
|
|
10
|
-
|
|
11
|
-
var _Barcode3 = _interopRequireDefault(_Barcode2);
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
18
|
-
|
|
19
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation
|
|
1
|
+
// Encoding documentation
|
|
20
2
|
// https://en.wikipedia.org/wiki/MSI_Barcode#Character_set_and_binary_lookup
|
|
21
3
|
|
|
22
|
-
|
|
23
|
-
_inherits(MSI, _Barcode);
|
|
4
|
+
import Barcode from "../Barcode.js";
|
|
24
5
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return _possibleConstructorReturn(this, (MSI.__proto__ || Object.getPrototypeOf(MSI)).call(this, data, options));
|
|
6
|
+
class MSI extends Barcode{
|
|
7
|
+
constructor(data, options){
|
|
8
|
+
super(data, options);
|
|
29
9
|
}
|
|
30
10
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// Start bits
|
|
35
|
-
var ret = "110";
|
|
11
|
+
encode(){
|
|
12
|
+
// Start bits
|
|
13
|
+
var ret = "110";
|
|
36
14
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
15
|
+
for(var i = 0; i < this.data.length; i++){
|
|
16
|
+
// Convert the character to binary (always 4 binary digits)
|
|
17
|
+
var digit = parseInt(this.data[i]);
|
|
18
|
+
var bin = digit.toString(2);
|
|
19
|
+
bin = addZeroes(bin, 4 - bin.length);
|
|
42
20
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
21
|
+
// Add 100 for every zero and 110 for every 1
|
|
22
|
+
for(var b = 0; b < bin.length; b++){
|
|
23
|
+
ret += bin[b] == "0" ? "100" : "110";
|
|
47
24
|
}
|
|
25
|
+
}
|
|
48
26
|
|
|
49
|
-
|
|
50
|
-
|
|
27
|
+
// End bits
|
|
28
|
+
ret += "1001";
|
|
51
29
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, {
|
|
58
|
-
key: "valid",
|
|
59
|
-
value: function valid() {
|
|
60
|
-
return this.data.search(/^[0-9]+$/) !== -1;
|
|
61
|
-
}
|
|
62
|
-
}]);
|
|
30
|
+
return {
|
|
31
|
+
data: ret,
|
|
32
|
+
text: this.text
|
|
33
|
+
};
|
|
34
|
+
}
|
|
63
35
|
|
|
64
|
-
|
|
65
|
-
|
|
36
|
+
valid(){
|
|
37
|
+
return this.data.search(/^[0-9]+$/) !== -1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
66
40
|
|
|
67
|
-
function addZeroes(number, n)
|
|
68
|
-
for
|
|
41
|
+
function addZeroes(number, n){
|
|
42
|
+
for(var i = 0; i < n; i++){
|
|
69
43
|
number = "0" + number;
|
|
70
44
|
}
|
|
71
45
|
return number;
|
|
72
46
|
}
|
|
73
47
|
|
|
74
|
-
|
|
48
|
+
export default MSI;
|
|
@@ -1,33 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import MSI from './MSI.js';
|
|
2
|
+
import {mod10} from './checksums.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _MSI2 = require('./MSI.js');
|
|
8
|
-
|
|
9
|
-
var _MSI3 = _interopRequireDefault(_MSI2);
|
|
10
|
-
|
|
11
|
-
var _checksums = require('./checksums.js');
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
18
|
-
|
|
19
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
20
|
-
|
|
21
|
-
var MSI10 = function (_MSI) {
|
|
22
|
-
_inherits(MSI10, _MSI);
|
|
23
|
-
|
|
24
|
-
function MSI10(data, options) {
|
|
25
|
-
_classCallCheck(this, MSI10);
|
|
26
|
-
|
|
27
|
-
return _possibleConstructorReturn(this, (MSI10.__proto__ || Object.getPrototypeOf(MSI10)).call(this, data + (0, _checksums.mod10)(data), options));
|
|
4
|
+
class MSI10 extends MSI{
|
|
5
|
+
constructor(data, options){
|
|
6
|
+
super(data + mod10(data), options);
|
|
28
7
|
}
|
|
8
|
+
}
|
|
29
9
|
|
|
30
|
-
|
|
31
|
-
}(_MSI3.default);
|
|
32
|
-
|
|
33
|
-
exports.default = MSI10;
|
|
10
|
+
export default MSI10;
|
|
@@ -1,35 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _MSI3 = _interopRequireDefault(_MSI2);
|
|
10
|
-
|
|
11
|
-
var _checksums = require('./checksums.js');
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
18
|
-
|
|
19
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
20
|
-
|
|
21
|
-
var MSI1010 = function (_MSI) {
|
|
22
|
-
_inherits(MSI1010, _MSI);
|
|
23
|
-
|
|
24
|
-
function MSI1010(data, options) {
|
|
25
|
-
_classCallCheck(this, MSI1010);
|
|
26
|
-
|
|
27
|
-
data += (0, _checksums.mod10)(data);
|
|
28
|
-
data += (0, _checksums.mod10)(data);
|
|
29
|
-
return _possibleConstructorReturn(this, (MSI1010.__proto__ || Object.getPrototypeOf(MSI1010)).call(this, data, options));
|
|
1
|
+
import MSI from './MSI.js';
|
|
2
|
+
import {mod10} from './checksums.js';
|
|
3
|
+
|
|
4
|
+
class MSI1010 extends MSI{
|
|
5
|
+
constructor(data, options){
|
|
6
|
+
data += mod10(data);
|
|
7
|
+
data += mod10(data);
|
|
8
|
+
super(data, options);
|
|
30
9
|
}
|
|
10
|
+
}
|
|
31
11
|
|
|
32
|
-
|
|
33
|
-
}(_MSI3.default);
|
|
34
|
-
|
|
35
|
-
exports.default = MSI1010;
|
|
12
|
+
export default MSI1010;
|
|
@@ -1,33 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import MSI from './MSI.js';
|
|
2
|
+
import {mod11} from './checksums.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _MSI2 = require('./MSI.js');
|
|
8
|
-
|
|
9
|
-
var _MSI3 = _interopRequireDefault(_MSI2);
|
|
10
|
-
|
|
11
|
-
var _checksums = require('./checksums.js');
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
18
|
-
|
|
19
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
20
|
-
|
|
21
|
-
var MSI11 = function (_MSI) {
|
|
22
|
-
_inherits(MSI11, _MSI);
|
|
23
|
-
|
|
24
|
-
function MSI11(data, options) {
|
|
25
|
-
_classCallCheck(this, MSI11);
|
|
26
|
-
|
|
27
|
-
return _possibleConstructorReturn(this, (MSI11.__proto__ || Object.getPrototypeOf(MSI11)).call(this, data + (0, _checksums.mod11)(data), options));
|
|
4
|
+
class MSI11 extends MSI{
|
|
5
|
+
constructor(data, options){
|
|
6
|
+
super(data + mod11(data), options);
|
|
28
7
|
}
|
|
8
|
+
}
|
|
29
9
|
|
|
30
|
-
|
|
31
|
-
}(_MSI3.default);
|
|
32
|
-
|
|
33
|
-
exports.default = MSI11;
|
|
10
|
+
export default MSI11;
|
|
@@ -1,35 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _MSI3 = _interopRequireDefault(_MSI2);
|
|
10
|
-
|
|
11
|
-
var _checksums = require('./checksums.js');
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
18
|
-
|
|
19
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
20
|
-
|
|
21
|
-
var MSI1110 = function (_MSI) {
|
|
22
|
-
_inherits(MSI1110, _MSI);
|
|
23
|
-
|
|
24
|
-
function MSI1110(data, options) {
|
|
25
|
-
_classCallCheck(this, MSI1110);
|
|
26
|
-
|
|
27
|
-
data += (0, _checksums.mod11)(data);
|
|
28
|
-
data += (0, _checksums.mod10)(data);
|
|
29
|
-
return _possibleConstructorReturn(this, (MSI1110.__proto__ || Object.getPrototypeOf(MSI1110)).call(this, data, options));
|
|
1
|
+
import MSI from './MSI.js';
|
|
2
|
+
import {mod10, mod11} from './checksums.js';
|
|
3
|
+
|
|
4
|
+
class MSI1110 extends MSI{
|
|
5
|
+
constructor(data, options){
|
|
6
|
+
data += mod11(data);
|
|
7
|
+
data += mod10(data);
|
|
8
|
+
super(data, options);
|
|
30
9
|
}
|
|
10
|
+
}
|
|
31
11
|
|
|
32
|
-
|
|
33
|
-
}(_MSI3.default);
|
|
34
|
-
|
|
35
|
-
exports.default = MSI1110;
|
|
12
|
+
export default MSI1110;
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mod10 = mod10;
|
|
7
|
-
exports.mod11 = mod11;
|
|
8
|
-
function mod10(number) {
|
|
1
|
+
export function mod10(number){
|
|
9
2
|
var sum = 0;
|
|
10
|
-
for
|
|
3
|
+
for(var i = 0; i < number.length; i++){
|
|
11
4
|
var n = parseInt(number[i]);
|
|
12
|
-
if
|
|
5
|
+
if((i + number.length) % 2 === 0){
|
|
13
6
|
sum += n;
|
|
14
|
-
}
|
|
15
|
-
|
|
7
|
+
}
|
|
8
|
+
else{
|
|
9
|
+
sum += (n * 2) % 10 + Math.floor((n * 2) / 10);
|
|
16
10
|
}
|
|
17
11
|
}
|
|
18
|
-
return (10 - sum % 10) % 10;
|
|
12
|
+
return (10 - (sum % 10)) % 10;
|
|
19
13
|
}
|
|
20
14
|
|
|
21
|
-
function mod11(number)
|
|
15
|
+
export function mod11(number){
|
|
22
16
|
var sum = 0;
|
|
23
17
|
var weights = [2, 3, 4, 5, 6, 7];
|
|
24
|
-
for
|
|
18
|
+
for(var i = 0; i < number.length; i++){
|
|
25
19
|
var n = parseInt(number[number.length - 1 - i]);
|
|
26
20
|
sum += weights[i % weights.length] * n;
|
|
27
21
|
}
|
|
28
|
-
return (11 - sum % 11) % 11;
|
|
29
|
-
}
|
|
22
|
+
return (11 - (sum % 11)) % 11;
|
|
23
|
+
}
|
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
|
|
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';
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MSI1110 = exports.MSI1010 = exports.MSI11 = exports.MSI10 = exports.MSI = undefined;
|
|
7
|
-
|
|
8
|
-
var _MSI = require('./MSI.js');
|
|
9
|
-
|
|
10
|
-
var _MSI2 = _interopRequireDefault(_MSI);
|
|
11
|
-
|
|
12
|
-
var _MSI3 = require('./MSI10.js');
|
|
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;
|
|
7
|
+
export {MSI, MSI10, MSI11, MSI1010, MSI1110};
|
|
@@ -1,92 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.codabar = undefined;
|
|
7
|
-
|
|
8
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
9
|
-
|
|
10
|
-
var _Barcode2 = require("../Barcode.js");
|
|
11
|
-
|
|
12
|
-
var _Barcode3 = _interopRequireDefault(_Barcode2);
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
-
|
|
18
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
19
|
-
|
|
20
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding specification:
|
|
1
|
+
// Encoding specification:
|
|
21
2
|
// http://www.barcodeisland.com/codabar.phtml
|
|
22
3
|
|
|
23
|
-
|
|
24
|
-
_inherits(codabar, _Barcode);
|
|
25
|
-
|
|
26
|
-
function codabar(data, options) {
|
|
27
|
-
_classCallCheck(this, codabar);
|
|
4
|
+
import Barcode from "../Barcode.js";
|
|
28
5
|
|
|
6
|
+
class codabar extends Barcode{
|
|
7
|
+
constructor(data, options){
|
|
29
8
|
if (data.search(/^[0-9\-\$\:\.\+\/]+$/) === 0) {
|
|
30
9
|
data = "A" + data + "A";
|
|
31
10
|
}
|
|
32
11
|
|
|
33
|
-
|
|
12
|
+
super(data.toUpperCase(), options);
|
|
34
13
|
|
|
35
|
-
|
|
36
|
-
return _this;
|
|
14
|
+
this.text = this.options.text || this.text.replace(/[A-D]/g, '');
|
|
37
15
|
}
|
|
38
16
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
result.push(
|
|
51
|
-
// for all characters except the last, append a narrow-space ("0")
|
|
52
|
-
if (i !== this.data.length - 1) {
|
|
53
|
-
result.push("0");
|
|
54
|
-
}
|
|
17
|
+
valid(){
|
|
18
|
+
return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
encode(){
|
|
22
|
+
var result = [];
|
|
23
|
+
var encodings = this.getEncodings();
|
|
24
|
+
for(var i = 0; i < this.data.length; i++){
|
|
25
|
+
result.push(encodings[this.data.charAt(i)]);
|
|
26
|
+
// for all characters except the last, append a narrow-space ("0")
|
|
27
|
+
if (i !== this.data.length - 1) {
|
|
28
|
+
result.push("0");
|
|
55
29
|
}
|
|
56
|
-
return {
|
|
57
|
-
text: this.text,
|
|
58
|
-
data: result.join('')
|
|
59
|
-
};
|
|
60
30
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"1": "101011001",
|
|
67
|
-
"2": "101001011",
|
|
68
|
-
"3": "110010101",
|
|
69
|
-
"4": "101101001",
|
|
70
|
-
"5": "110101001",
|
|
71
|
-
"6": "100101011",
|
|
72
|
-
"7": "100101101",
|
|
73
|
-
"8": "100110101",
|
|
74
|
-
"9": "110100101",
|
|
75
|
-
"-": "101001101",
|
|
76
|
-
"$": "101100101",
|
|
77
|
-
":": "1101011011",
|
|
78
|
-
"/": "1101101011",
|
|
79
|
-
".": "1101101101",
|
|
80
|
-
"+": "1011011011",
|
|
81
|
-
"A": "1011001001",
|
|
82
|
-
"B": "1001001011",
|
|
83
|
-
"C": "1010010011",
|
|
84
|
-
"D": "1010011001"
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}]);
|
|
31
|
+
return {
|
|
32
|
+
text: this.text,
|
|
33
|
+
data: result.join('')
|
|
34
|
+
};
|
|
35
|
+
}
|
|
88
36
|
|
|
89
|
-
|
|
90
|
-
|
|
37
|
+
getEncodings(){
|
|
38
|
+
return {
|
|
39
|
+
"0": "101010011",
|
|
40
|
+
"1": "101011001",
|
|
41
|
+
"2": "101001011",
|
|
42
|
+
"3": "110010101",
|
|
43
|
+
"4": "101101001",
|
|
44
|
+
"5": "110101001",
|
|
45
|
+
"6": "100101011",
|
|
46
|
+
"7": "100101101",
|
|
47
|
+
"8": "100110101",
|
|
48
|
+
"9": "110100101",
|
|
49
|
+
"-": "101001101",
|
|
50
|
+
"$": "101100101",
|
|
51
|
+
":": "1101011011",
|
|
52
|
+
"/": "1101101011",
|
|
53
|
+
".": "1101101101",
|
|
54
|
+
"+": "1011011011",
|
|
55
|
+
"A": "1011001001",
|
|
56
|
+
"B": "1001001011",
|
|
57
|
+
"C": "1010010011",
|
|
58
|
+
"D": "1010011001"
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
91
62
|
|
|
92
|
-
|
|
63
|
+
export {codabar};
|