@10yun/cv-mobile-ui 0.4.12 → 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/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,167 +1,205 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function
|
|
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
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
|
|
1
|
+
import _constants from './constants.js';
|
|
2
|
+
import CODE128 from './CODE128.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
62
|
+
return CODE128A;
|
|
63
|
+
})(CODE128);
|
|
16
64
|
|
|
17
|
-
|
|
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
|
-
|
|
1
|
+
import _constants from './constants.js';
|
|
2
|
+
import CODE128 from './CODE128.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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;
|