@10yun/cv-mobile-ui 0.4.12 → 0.5.2

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/extend/permission.js +44 -45
  2. package/package.json +4 -4
  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 +13 -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,167 +1,205 @@
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
- var _constants = require('./constants');
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; }
1
+ import { BarcodeFunc } from '../Barcode.js';
2
+ import _constants from './constants.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
+ }
22
43
 
23
44
  // This is the master class,
24
45
  // it does require the start code to be included in the string
25
- var CODE128 = function (_Barcode) {
26
- _inherits(CODE128, _Barcode);
27
-
28
- function CODE128(data, options) {
29
- _classCallCheck(this, CODE128);
30
-
31
- // Get array of ascii codes from data
32
- var _this = _possibleConstructorReturn(this, (CODE128.__proto__ || Object.getPrototypeOf(CODE128)).call(this, data.substring(1), options));
33
-
34
- _this.bytes = data.split('').map(function (char) {
35
- return char.charCodeAt(0);
36
- });
37
- return _this;
38
- }
39
-
40
- _createClass(CODE128, [{
41
- key: 'valid',
42
- value: function valid() {
43
- // ASCII value ranges 0-127, 200-211
44
- return (/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)
45
- );
46
- }
47
-
48
- // The public encoding function
49
-
50
- }, {
51
- key: 'encode',
52
- value: function encode() {
53
- var bytes = this.bytes;
54
- // Remove the start code from the bytes and set its index
55
- var startIndex = bytes.shift() - 105;
56
- // Get start set by index
57
- var startSet = _constants.SET_BY_CODE[startIndex];
58
-
59
- if (startSet === undefined) {
60
- throw new RangeError('The encoding does not start with a start character.');
61
- }
62
-
63
- if (this.shouldEncodeAsEan128() === true) {
64
- bytes.unshift(_constants.FNC1);
65
- }
66
-
67
- // Start encode with the right type
68
- var encodingResult = CODE128.next(bytes, 1, startSet);
69
-
70
- return {
71
- text: this.text === this.data ? this.text.replace(/[^\x20-\x7E]/g, '') : this.text,
72
- data:
73
- // Add the start bits
74
- CODE128.getBar(startIndex) +
75
- // Add the encoded bits
76
- encodingResult.result +
77
- // Add the checksum
78
- CODE128.getBar((encodingResult.checksum + startIndex) % _constants.MODULO) +
79
- // Add the end bits
80
- CODE128.getBar(_constants.STOP)
81
- };
82
- }
83
-
84
- // GS1-128/EAN-128
85
-
86
- }, {
87
- key: 'shouldEncodeAsEan128',
88
- value: function shouldEncodeAsEan128() {
89
- var isEAN128 = this.options.ean128 || false;
90
- if (typeof isEAN128 === 'string') {
91
- isEAN128 = isEAN128.toLowerCase() === 'true';
92
- }
93
- return isEAN128;
94
- }
95
-
96
- // Get a bar symbol by index
97
-
98
- }], [{
99
- key: 'getBar',
100
- value: function getBar(index) {
101
- return _constants.BARS[index] ? _constants.BARS[index].toString() : '';
102
- }
103
-
104
- // Correct an index by a set and shift it from the bytes array
105
-
106
- }, {
107
- key: 'correctIndex',
108
- value: function correctIndex(bytes, set) {
109
- if (set === _constants.SET_A) {
110
- var charCode = bytes.shift();
111
- return charCode < 32 ? charCode + 64 : charCode - 32;
112
- } else if (set === _constants.SET_B) {
113
- return bytes.shift() - 32;
114
- } else {
115
- return (bytes.shift() - 48) * 10 + bytes.shift() - 48;
116
- }
117
- }
118
- }, {
119
- key: 'next',
120
- value: function next(bytes, pos, set) {
121
- if (!bytes.length) {
122
- return { result: '', checksum: 0 };
123
- }
124
-
125
- var nextCode = void 0,
126
- index = void 0;
127
-
128
- // Special characters
129
- if (bytes[0] >= 200) {
130
- index = bytes.shift() - 105;
131
- var nextSet = _constants.SWAP[index];
132
-
133
- // Swap to other set
134
- if (nextSet !== undefined) {
135
- nextCode = CODE128.next(bytes, pos + 1, nextSet);
136
- }
137
- // Continue on current set but encode a special character
138
- else {
139
- // Shift
140
- if ((set === _constants.SET_A || set === _constants.SET_B) && index === _constants.SHIFT) {
141
- // Convert the next character so that is encoded correctly
142
- bytes[0] = set === _constants.SET_A ? bytes[0] > 95 ? bytes[0] - 96 : bytes[0] : bytes[0] < 32 ? bytes[0] + 96 : bytes[0];
143
- }
144
- nextCode = CODE128.next(bytes, pos + 1, set);
145
- }
146
- }
147
- // Continue encoding
148
- else {
149
- index = CODE128.correctIndex(bytes, set);
150
- nextCode = CODE128.next(bytes, pos + 1, set);
151
- }
152
-
153
- // Get the correct binary encoding and calculate the weight
154
- var enc = CODE128.getBar(index);
155
- var weight = index * pos;
156
-
157
- return {
158
- result: enc + nextCode.result,
159
- checksum: weight + nextCode.checksum
160
- };
161
- }
162
- }]);
163
-
164
- return CODE128;
165
- }(_Barcode3.default);
166
-
167
- exports.default = CODE128;
46
+ var CODE128 = (function (_Barcode) {
47
+ _inherits(CODE128, _Barcode);
48
+
49
+ function CODE128(data, options) {
50
+ _classCallCheck(this, CODE128);
51
+
52
+ // Get array of ascii codes from data
53
+ var _this = _possibleConstructorReturn(
54
+ this,
55
+ (CODE128.__proto__ || Object.getPrototypeOf(CODE128)).call(this, data.substring(1), options)
56
+ );
57
+
58
+ _this.bytes = data.split('').map(function (char) {
59
+ return char.charCodeAt(0);
60
+ });
61
+ return _this;
62
+ }
63
+
64
+ _createClass(
65
+ CODE128,
66
+ [
67
+ {
68
+ key: 'valid',
69
+ value: function valid() {
70
+ // ASCII value ranges 0-127, 200-211
71
+ return /^[\x00-\x7F\xC8-\xD3]+$/.test(this.data);
72
+ }
73
+
74
+ // The public encoding function
75
+ },
76
+ {
77
+ key: 'encode',
78
+ value: function encode() {
79
+ var bytes = this.bytes;
80
+ // Remove the start code from the bytes and set its index
81
+ var startIndex = bytes.shift() - 105;
82
+ // Get start set by index
83
+ var startSet = _constants.SET_BY_CODE[startIndex];
84
+
85
+ if (startSet === undefined) {
86
+ throw new RangeError('The encoding does not start with a start character.');
87
+ }
88
+
89
+ if (this.shouldEncodeAsEan128() === true) {
90
+ bytes.unshift(_constants.FNC1);
91
+ }
92
+
93
+ // Start encode with the right type
94
+ var encodingResult = CODE128.next(bytes, 1, startSet);
95
+
96
+ return {
97
+ text: this.text === this.data ? this.text.replace(/[^\x20-\x7E]/g, '') : this.text,
98
+ data:
99
+ // Add the start bits
100
+ CODE128.getBar(startIndex) +
101
+ // Add the encoded bits
102
+ encodingResult.result +
103
+ // Add the checksum
104
+ CODE128.getBar((encodingResult.checksum + startIndex) % _constants.MODULO) +
105
+ // Add the end bits
106
+ CODE128.getBar(_constants.STOP)
107
+ };
108
+ }
109
+
110
+ // GS1-128/EAN-128
111
+ },
112
+ {
113
+ key: 'shouldEncodeAsEan128',
114
+ value: function shouldEncodeAsEan128() {
115
+ var isEAN128 = this.options.ean128 || false;
116
+ if (typeof isEAN128 === 'string') {
117
+ isEAN128 = isEAN128.toLowerCase() === 'true';
118
+ }
119
+ return isEAN128;
120
+ }
121
+
122
+ // Get a bar symbol by index
123
+ }
124
+ ],
125
+ [
126
+ {
127
+ key: 'getBar',
128
+ value: function getBar(index) {
129
+ return _constants.BARS[index] ? _constants.BARS[index].toString() : '';
130
+ }
131
+
132
+ // Correct an index by a set and shift it from the bytes array
133
+ },
134
+ {
135
+ key: 'correctIndex',
136
+ value: function correctIndex(bytes, set) {
137
+ if (set === _constants.SET_A) {
138
+ var charCode = bytes.shift();
139
+ return charCode < 32 ? charCode + 64 : charCode - 32;
140
+ } else if (set === _constants.SET_B) {
141
+ return bytes.shift() - 32;
142
+ } else {
143
+ return (bytes.shift() - 48) * 10 + bytes.shift() - 48;
144
+ }
145
+ }
146
+ },
147
+ {
148
+ key: 'next',
149
+ value: function next(bytes, pos, set) {
150
+ if (!bytes.length) {
151
+ return { result: '', checksum: 0 };
152
+ }
153
+
154
+ var nextCode = void 0,
155
+ index = void 0;
156
+
157
+ // Special characters
158
+ if (bytes[0] >= 200) {
159
+ index = bytes.shift() - 105;
160
+ var nextSet = _constants.SWAP[index];
161
+
162
+ // Swap to other set
163
+ if (nextSet !== undefined) {
164
+ nextCode = CODE128.next(bytes, pos + 1, nextSet);
165
+ }
166
+ // Continue on current set but encode a special character
167
+ else {
168
+ // Shift
169
+ if ((set === _constants.SET_A || set === _constants.SET_B) && index === _constants.SHIFT) {
170
+ // Convert the next character so that is encoded correctly
171
+ bytes[0] =
172
+ set === _constants.SET_A
173
+ ? bytes[0] > 95
174
+ ? bytes[0] - 96
175
+ : bytes[0]
176
+ : bytes[0] < 32
177
+ ? bytes[0] + 96
178
+ : bytes[0];
179
+ }
180
+ nextCode = CODE128.next(bytes, pos + 1, set);
181
+ }
182
+ }
183
+ // Continue encoding
184
+ else {
185
+ index = CODE128.correctIndex(bytes, set);
186
+ nextCode = CODE128.next(bytes, pos + 1, set);
187
+ }
188
+
189
+ // Get the correct binary encoding and calculate the weight
190
+ var enc = CODE128.getBar(index);
191
+ var weight = index * pos;
192
+
193
+ return {
194
+ result: enc + nextCode.result,
195
+ checksum: weight + nextCode.checksum
196
+ };
197
+ }
198
+ }
199
+ ]
200
+ );
201
+
202
+ return CODE128;
203
+ })(BarcodeFunc);
204
+
205
+ export default CODE128;
@@ -1,42 +1,65 @@
1
- 'use strict';
1
+ import _constants from './constants.js';
2
+ import CODE128 from './CODE128.js';
2
3
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
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
+ })();
6
20
 
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; }; }();
21
+ function _classCallCheck(instance, Constructor) {
22
+ if (!(instance instanceof Constructor)) {
23
+ throw new TypeError('Cannot call a class as a function');
24
+ }
25
+ }
8
26
 
9
- var _CODE2 = require('./CODE128.js');
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
+ }
10
33
 
11
- var _CODE3 = _interopRequireDefault(_CODE2);
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
+ }
12
43
 
13
- var _constants = require('./constants');
44
+ var CODE128A = (function (_CODE) {
45
+ _inherits(CODE128A, _CODE);
46
+ function CODE128A(string, options) {
47
+ _classCallCheck(this, CODE128A);
48
+ return _possibleConstructorReturn(
49
+ this,
50
+ (CODE128A.__proto__ || Object.getPrototypeOf(CODE128A)).call(this, _constants.A_START_CHAR + string, options)
51
+ );
52
+ }
53
+ _createClass(CODE128A, [
54
+ {
55
+ key: 'valid',
56
+ value: function valid() {
57
+ return new RegExp('^' + _constants.A_CHARS + '+$').test(this.data);
58
+ }
59
+ }
60
+ ]);
14
61
 
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
62
+ return CODE128A;
63
+ })(CODE128);
16
64
 
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 CODE128A = function (_CODE) {
24
- _inherits(CODE128A, _CODE);
25
-
26
- function CODE128A(string, options) {
27
- _classCallCheck(this, CODE128A);
28
-
29
- return _possibleConstructorReturn(this, (CODE128A.__proto__ || Object.getPrototypeOf(CODE128A)).call(this, _constants.A_START_CHAR + string, options));
30
- }
31
-
32
- _createClass(CODE128A, [{
33
- key: 'valid',
34
- value: function valid() {
35
- return new RegExp('^' + _constants.A_CHARS + '+$').test(this.data);
36
- }
37
- }]);
38
-
39
- return CODE128A;
40
- }(_CODE3.default);
41
-
42
- exports.default = CODE128A;
65
+ export default CODE128A;
@@ -1,42 +1,64 @@
1
- 'use strict';
1
+ import _constants from './constants.js';
2
+ import CODE128 from './CODE128.js';
2
3
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
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
+ })();
6
20
 
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; }; }();
21
+ function _classCallCheck(instance, Constructor) {
22
+ if (!(instance instanceof Constructor)) {
23
+ throw new TypeError('Cannot call a class as a function');
24
+ }
25
+ }
8
26
 
9
- var _CODE2 = require('./CODE128.js');
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
+ }
10
33
 
11
- var _CODE3 = _interopRequireDefault(_CODE2);
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
+ }
12
43
 
13
- var _constants = require('./constants');
44
+ var CODE128B = (function (_CODE) {
45
+ _inherits(CODE128B, _CODE);
46
+ function CODE128B(string, options) {
47
+ _classCallCheck(this, CODE128B);
48
+ return _possibleConstructorReturn(
49
+ this,
50
+ (CODE128B.__proto__ || Object.getPrototypeOf(CODE128B)).call(this, _constants.B_START_CHAR + string, options)
51
+ );
52
+ }
53
+ _createClass(CODE128B, [
54
+ {
55
+ key: 'valid',
56
+ value: function valid() {
57
+ return new RegExp('^' + _constants.B_CHARS + '+$').test(this.data);
58
+ }
59
+ }
60
+ ]);
61
+ return CODE128B;
62
+ })(CODE128);
14
63
 
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 CODE128B = function (_CODE) {
24
- _inherits(CODE128B, _CODE);
25
-
26
- function CODE128B(string, options) {
27
- _classCallCheck(this, CODE128B);
28
-
29
- return _possibleConstructorReturn(this, (CODE128B.__proto__ || Object.getPrototypeOf(CODE128B)).call(this, _constants.B_START_CHAR + string, options));
30
- }
31
-
32
- _createClass(CODE128B, [{
33
- key: 'valid',
34
- value: function valid() {
35
- return new RegExp('^' + _constants.B_CHARS + '+$').test(this.data);
36
- }
37
- }]);
38
-
39
- return CODE128B;
40
- }(_CODE3.default);
41
-
42
- exports.default = CODE128B;
64
+ export default CODE128B;