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