@progress/kendo-react-barcodes 4.14.0-dev.202112141254
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/LICENSE.md +11 -0
- package/NOTICE.txt +78 -0
- package/README.md +59 -0
- package/about.md +3 -0
- package/dist/cdn/js/kendo-react-barcodes.js +1 -0
- package/dist/es/Barcode.d.ts +49 -0
- package/dist/es/Barcode.js +146 -0
- package/dist/es/BarcodeContext.d.ts +12 -0
- package/dist/es/BarcodeContext.js +6 -0
- package/dist/es/BarcodeProps.d.ts +61 -0
- package/dist/es/BarcodeProps.js +0 -0
- package/dist/es/BaseBarcode.d.ts +75 -0
- package/dist/es/BaseBarcode.js +179 -0
- package/dist/es/BaseBarcodeProps.d.ts +41 -0
- package/dist/es/BaseBarcodeProps.js +0 -0
- package/dist/es/QRCode.d.ts +49 -0
- package/dist/es/QRCode.js +149 -0
- package/dist/es/QRCodeProps.d.ts +73 -0
- package/dist/es/QRCodeProps.js +0 -0
- package/dist/es/common/barcodes.d.ts +4 -0
- package/dist/es/common/barcodes.js +0 -0
- package/dist/es/main.d.ts +6 -0
- package/dist/es/main.js +3 -0
- package/dist/es/package-metadata.d.ts +5 -0
- package/dist/es/package-metadata.js +11 -0
- package/dist/es/store/reducer.d.ts +10 -0
- package/dist/es/store/reducer.js +41 -0
- package/dist/es/store/store.d.ts +25 -0
- package/dist/es/store/store.js +28 -0
- package/dist/es/types/barcode-text.d.ts +32 -0
- package/dist/es/types/barcode-text.js +0 -0
- package/dist/es/types/barcode-type.d.ts +4 -0
- package/dist/es/types/barcode-type.js +0 -0
- package/dist/es/types/border.interface.d.ts +18 -0
- package/dist/es/types/border.interface.js +0 -0
- package/dist/es/types/dash-type.interface.d.ts +4 -0
- package/dist/es/types/dash-type.interface.js +0 -0
- package/dist/es/types/margin.interface.d.ts +21 -0
- package/dist/es/types/margin.interface.js +0 -0
- package/dist/es/types/padding.interface.d.ts +21 -0
- package/dist/es/types/padding.interface.js +0 -0
- package/dist/es/types/qrcode-encoding.d.ts +4 -0
- package/dist/es/types/qrcode-encoding.js +0 -0
- package/dist/es/types/qrcode-error-correction.d.ts +9 -0
- package/dist/es/types/qrcode-error-correction.js +0 -0
- package/dist/es/types/qrcode-overlay.d.ts +25 -0
- package/dist/es/types/qrcode-overlay.js +0 -0
- package/dist/es/types/render-mode.d.ts +8 -0
- package/dist/es/types/render-mode.js +0 -0
- package/dist/es/types.d.ts +10 -0
- package/dist/es/types.js +0 -0
- package/dist/es/utils/common.d.ts +4 -0
- package/dist/es/utils/common.js +39 -0
- package/dist/npm/Barcode.d.ts +49 -0
- package/dist/npm/Barcode.js +148 -0
- package/dist/npm/BarcodeContext.d.ts +12 -0
- package/dist/npm/BarcodeContext.js +8 -0
- package/dist/npm/BarcodeProps.d.ts +61 -0
- package/dist/npm/BarcodeProps.js +2 -0
- package/dist/npm/BaseBarcode.d.ts +75 -0
- package/dist/npm/BaseBarcode.js +181 -0
- package/dist/npm/BaseBarcodeProps.d.ts +41 -0
- package/dist/npm/BaseBarcodeProps.js +2 -0
- package/dist/npm/QRCode.d.ts +49 -0
- package/dist/npm/QRCode.js +151 -0
- package/dist/npm/QRCodeProps.d.ts +73 -0
- package/dist/npm/QRCodeProps.js +2 -0
- package/dist/npm/common/barcodes.d.ts +4 -0
- package/dist/npm/common/barcodes.js +2 -0
- package/dist/npm/main.d.ts +6 -0
- package/dist/npm/main.js +6 -0
- package/dist/npm/package-metadata.d.ts +5 -0
- package/dist/npm/package-metadata.js +13 -0
- package/dist/npm/store/reducer.d.ts +10 -0
- package/dist/npm/store/reducer.js +44 -0
- package/dist/npm/store/store.d.ts +25 -0
- package/dist/npm/store/store.js +30 -0
- package/dist/npm/types/barcode-text.d.ts +32 -0
- package/dist/npm/types/barcode-text.js +2 -0
- package/dist/npm/types/barcode-type.d.ts +4 -0
- package/dist/npm/types/barcode-type.js +2 -0
- package/dist/npm/types/border.interface.d.ts +18 -0
- package/dist/npm/types/border.interface.js +2 -0
- package/dist/npm/types/dash-type.interface.d.ts +4 -0
- package/dist/npm/types/dash-type.interface.js +2 -0
- package/dist/npm/types/margin.interface.d.ts +21 -0
- package/dist/npm/types/margin.interface.js +2 -0
- package/dist/npm/types/padding.interface.d.ts +21 -0
- package/dist/npm/types/padding.interface.js +2 -0
- package/dist/npm/types/qrcode-encoding.d.ts +4 -0
- package/dist/npm/types/qrcode-encoding.js +2 -0
- package/dist/npm/types/qrcode-error-correction.d.ts +9 -0
- package/dist/npm/types/qrcode-error-correction.js +2 -0
- package/dist/npm/types/qrcode-overlay.d.ts +25 -0
- package/dist/npm/types/qrcode-overlay.js +2 -0
- package/dist/npm/types/render-mode.d.ts +8 -0
- package/dist/npm/types/render-mode.js +2 -0
- package/dist/npm/types.d.ts +10 -0
- package/dist/npm/types.js +2 -0
- package/dist/npm/utils/common.d.ts +4 -0
- package/dist/npm/utils/common.js +41 -0
- package/dist/systemjs/kendo-react-barcodes.js +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __assign = (this && this.__assign) || function () {
|
|
16
|
+
__assign = Object.assign || function(t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
27
|
+
var t = {};
|
|
28
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
29
|
+
t[p] = s[p];
|
|
30
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
31
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
return t;
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
var React = require("react");
|
|
37
|
+
var BaseBarcode_1 = require("./BaseBarcode");
|
|
38
|
+
var kendo_charts_1 = require("@progress/kendo-charts");
|
|
39
|
+
var kendo_drawing_1 = require("@progress/kendo-drawing");
|
|
40
|
+
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
41
|
+
var DEFAULT_COLOR = '#000';
|
|
42
|
+
var DEFAULT_BACKGROUND = '#fff';
|
|
43
|
+
var DEFAULT_ERROR_CORRECTION = 'L';
|
|
44
|
+
/**
|
|
45
|
+
* Represents the KendoReact QRCode component.
|
|
46
|
+
*/
|
|
47
|
+
var QRCode = /** @class */ (function (_super) {
|
|
48
|
+
__extends(QRCode, _super);
|
|
49
|
+
function QRCode() {
|
|
50
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
51
|
+
_this.getTarget = function () {
|
|
52
|
+
return _this;
|
|
53
|
+
};
|
|
54
|
+
_this.deriveOptionsFromParent = function (options) {
|
|
55
|
+
return Object.assign({}, options, {
|
|
56
|
+
background: _this.props.background || DEFAULT_BACKGROUND,
|
|
57
|
+
border: _this.props.border,
|
|
58
|
+
color: _this.props.color || DEFAULT_COLOR,
|
|
59
|
+
encoding: _this.props.encoding,
|
|
60
|
+
errorCorrection: _this.props.errorCorrection || DEFAULT_ERROR_CORRECTION,
|
|
61
|
+
overlay: _this.props.overlay || {},
|
|
62
|
+
padding: _this.props.padding,
|
|
63
|
+
renderAs: _this.props.renderAs,
|
|
64
|
+
size: _this.props.size,
|
|
65
|
+
value: _this.props.value
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
Object.defineProperty(QRCode.prototype, "barcodeInstance", {
|
|
71
|
+
/**
|
|
72
|
+
* @hidden
|
|
73
|
+
*/
|
|
74
|
+
get: function () {
|
|
75
|
+
if (this._baseBarcode !== null) {
|
|
76
|
+
return this._baseBarcode.barcodeInstance;
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
},
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(QRCode.prototype, "surface", {
|
|
84
|
+
/**
|
|
85
|
+
* The Drawing `Surface` of the Barcode.
|
|
86
|
+
*/
|
|
87
|
+
get: function () {
|
|
88
|
+
if (this._baseBarcode !== null) {
|
|
89
|
+
return this._baseBarcode.surface;
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
},
|
|
93
|
+
enumerable: true,
|
|
94
|
+
configurable: true
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(QRCode.prototype, "element", {
|
|
97
|
+
/**
|
|
98
|
+
* The DOM element of the Barcode.
|
|
99
|
+
*/
|
|
100
|
+
get: function () {
|
|
101
|
+
if (this._baseBarcode !== null) {
|
|
102
|
+
return this._baseBarcode.element;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
},
|
|
106
|
+
enumerable: true,
|
|
107
|
+
configurable: true
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* @hidden
|
|
111
|
+
*/
|
|
112
|
+
QRCode.prototype.render = function () {
|
|
113
|
+
var _this = this;
|
|
114
|
+
var _a = this.props, children = _a.children, className = _a.className, baseBarcodeProps = __rest(_a, ["children", "className"]);
|
|
115
|
+
return (React.createElement(BaseBarcode_1.BaseBarcode, __assign({}, baseBarcodeProps, { deriveOptionsFromParent: this.deriveOptionsFromParent, ref: function (baseBarcode) { return _this._baseBarcode = baseBarcode; }, barcodeConstructor: kendo_charts_1.QRCode, getTarget: this.getTarget, className: kendo_react_common_1.classNames('k-qrcode', className) }), children));
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Exports the component as an image. The export operation is asynchronous and returns a promise.
|
|
119
|
+
*
|
|
120
|
+
* @param {ImageExportOptions} options - The parameters for the exported image.
|
|
121
|
+
* @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
|
|
122
|
+
*/
|
|
123
|
+
QRCode.prototype.exportImage = function (options) {
|
|
124
|
+
if (options === void 0) { options = {}; }
|
|
125
|
+
return kendo_drawing_1.exportImage(this.exportVisual(), options);
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
|
|
129
|
+
*
|
|
130
|
+
* @param options - The parameters for the exported file.
|
|
131
|
+
* @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
|
|
132
|
+
*/
|
|
133
|
+
QRCode.prototype.exportSVG = function (options) {
|
|
134
|
+
if (options === void 0) { options = {}; }
|
|
135
|
+
return kendo_drawing_1.exportSVG(this.exportVisual(), options);
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Exports a Barcode component as a Drawing `Scene`.
|
|
139
|
+
*
|
|
140
|
+
* @param {any} options - The parameters for the export operation.
|
|
141
|
+
* @returns {Group} - A promise that returns the root `Group` of the scene.
|
|
142
|
+
*/
|
|
143
|
+
QRCode.prototype.exportVisual = function (options) {
|
|
144
|
+
if (this.barcodeInstance !== null) {
|
|
145
|
+
return this.barcodeInstance.exportVisual(options);
|
|
146
|
+
}
|
|
147
|
+
return new kendo_drawing_1.Group();
|
|
148
|
+
};
|
|
149
|
+
return QRCode;
|
|
150
|
+
}(React.Component));
|
|
151
|
+
exports.QRCode = QRCode;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { BaseBarcodeProps } from './BaseBarcodeProps';
|
|
2
|
+
import { Border, QRCodeEncoding, QRCodeErrorCorrection, QRCodeOverlay } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the props of the [KendoReact QRCode component]({% slug overview_qrcode_barcodes %}).
|
|
5
|
+
*/
|
|
6
|
+
export interface QRCodeProps extends BaseBarcodeProps {
|
|
7
|
+
/**
|
|
8
|
+
* The background color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
|
|
9
|
+
*
|
|
10
|
+
* @default "white"
|
|
11
|
+
*/
|
|
12
|
+
background?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The border of the QR Code.
|
|
15
|
+
*/
|
|
16
|
+
border?: Border;
|
|
17
|
+
/**
|
|
18
|
+
* The color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
|
|
19
|
+
*
|
|
20
|
+
* @default "black"
|
|
21
|
+
*/
|
|
22
|
+
color?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The encoding mode used to encode the value.
|
|
25
|
+
*
|
|
26
|
+
* > **Important** The UTF-8 encoding is not included in the specifications and is not supported by all readers.
|
|
27
|
+
*
|
|
28
|
+
* The possible values are:
|
|
29
|
+
* * `"ISO_8859_1"`—Supports all characters from the [ISO/IEC 8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1) character set.
|
|
30
|
+
* * `"UTF_8"`—Supports all [Unicode](https://en.wikipedia.org/wiki/List_of_Unicode_characters) characters.
|
|
31
|
+
*
|
|
32
|
+
* @default "ISO_8859_1"
|
|
33
|
+
*/
|
|
34
|
+
encoding?: QRCodeEncoding;
|
|
35
|
+
/**
|
|
36
|
+
* The error correction level to use.
|
|
37
|
+
*
|
|
38
|
+
* The possible values are:
|
|
39
|
+
* * `"L"`—Approximately 7% of the codewords can be restored.
|
|
40
|
+
* * `"M"`—Approximately 15% of the codewords can be restored.
|
|
41
|
+
* * `"Q"`—Approximately 25% of the codewords can be restored.
|
|
42
|
+
* * `"H"`—Approximately 30% of the codewords can be restored.
|
|
43
|
+
*
|
|
44
|
+
* @default "L"
|
|
45
|
+
*/
|
|
46
|
+
errorCorrection?: QRCodeErrorCorrection;
|
|
47
|
+
/**
|
|
48
|
+
* An optional image overlay that will placed over the QR Code.
|
|
49
|
+
*
|
|
50
|
+
* > **Note** Always test if the code reads correctly with the applied overlay.
|
|
51
|
+
* > Depending on the length of the value and the size of the overlay, you might need to raise the `errorCorrection` level to `"M"` or `"H"`.
|
|
52
|
+
*/
|
|
53
|
+
overlay?: QRCodeOverlay;
|
|
54
|
+
/**
|
|
55
|
+
* The padding of the QR Code. A numeric value sets all paddings.
|
|
56
|
+
*
|
|
57
|
+
* @default 0
|
|
58
|
+
*/
|
|
59
|
+
padding?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Specifies the size of a QR Code. Numeric values are treated as pixels.
|
|
62
|
+
*
|
|
63
|
+
* If no size is specified, the size will be determined from the element width and height.
|
|
64
|
+
* If the element has width or height of zero, a default value of 200 pixels will be used.
|
|
65
|
+
*
|
|
66
|
+
* @default "200px"
|
|
67
|
+
*/
|
|
68
|
+
size?: number | string;
|
|
69
|
+
/**
|
|
70
|
+
* The value of the QR Code.
|
|
71
|
+
*/
|
|
72
|
+
value: number | string;
|
|
73
|
+
}
|
package/dist/npm/main.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
exports.packageMetadata = {
|
|
7
|
+
name: '@progress/kendo-react-barcodes',
|
|
8
|
+
productName: 'KendoReact',
|
|
9
|
+
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
10
|
+
publishDate: 1639486389,
|
|
11
|
+
version: '',
|
|
12
|
+
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StoreAction } from './store';
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
*/
|
|
5
|
+
declare const optionsReducer: (currentState: any, action: StoreAction) => object;
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
declare const observersReducer: (currentState: any, action: StoreAction) => any;
|
|
10
|
+
export { optionsReducer, observersReducer };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
var optionsReducer = function (currentState, action) {
|
|
7
|
+
if (action.barcodeKey) {
|
|
8
|
+
return reducers.configurationItem(currentState, action);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
exports.optionsReducer = optionsReducer;
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
var observersReducer = function (currentState, action) {
|
|
19
|
+
if (action.type) {
|
|
20
|
+
switch (action.type) {
|
|
21
|
+
case 'add':
|
|
22
|
+
return currentState.concat([action.payload]);
|
|
23
|
+
case 'remove':
|
|
24
|
+
return currentState.filter(function (element) { return element !== action.payload; });
|
|
25
|
+
default:
|
|
26
|
+
return currentState;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.observersReducer = observersReducer;
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
var reducers = {
|
|
38
|
+
configurationItem: function (currentState, action) {
|
|
39
|
+
var _a;
|
|
40
|
+
return Object.assign(currentState, (_a = {},
|
|
41
|
+
_a[action.barcodeKey] = action.payload,
|
|
42
|
+
_a));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export declare const THROTTLE_MS: number;
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export interface StoreAction {
|
|
9
|
+
barcodeKey?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
payload: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export interface Store {
|
|
17
|
+
getState(): any;
|
|
18
|
+
dispatch(action: StoreAction | object): void;
|
|
19
|
+
subscribe(f: Function): Function;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
declare const createStore: (reducer: any) => Store;
|
|
25
|
+
export default createStore;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
exports.THROTTLE_MS = 1000 / 60;
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
var createStore = function (reducer) {
|
|
12
|
+
var state;
|
|
13
|
+
var timerId;
|
|
14
|
+
var listeners = [];
|
|
15
|
+
var getState = function () { return state; };
|
|
16
|
+
var dispatch = function (action) {
|
|
17
|
+
state = reducer(state, action);
|
|
18
|
+
if (kendo_react_common_1.canUseDOM) {
|
|
19
|
+
window.clearTimeout(timerId);
|
|
20
|
+
timerId = window.setTimeout(function () { return listeners.forEach(function (l) { return l(); }); }, exports.THROTTLE_MS);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var subscribe = function (listener) {
|
|
24
|
+
listeners.push(listener);
|
|
25
|
+
return function () { return listeners = listeners.filter(function (l) { return l !== listener; }); };
|
|
26
|
+
};
|
|
27
|
+
dispatch({});
|
|
28
|
+
return { getState: getState, dispatch: dispatch, subscribe: subscribe };
|
|
29
|
+
};
|
|
30
|
+
exports.default = createStore;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Margin } from './margin.interface';
|
|
2
|
+
/**
|
|
3
|
+
* The Barcode text label configuration.
|
|
4
|
+
*/
|
|
5
|
+
export interface BarcodeText {
|
|
6
|
+
/**
|
|
7
|
+
* The color of the text. Any valid CSS color string will work here, including hex and rgb.
|
|
8
|
+
*
|
|
9
|
+
* @default "black"
|
|
10
|
+
*/
|
|
11
|
+
color?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The font of the text.
|
|
14
|
+
*
|
|
15
|
+
* @default "16px Consolas, Monaco, Sans Mono, monospace, sans-serif"
|
|
16
|
+
*/
|
|
17
|
+
font?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The margin of the text. A numeric value sets all margins.
|
|
20
|
+
*
|
|
21
|
+
* @default 0
|
|
22
|
+
*/
|
|
23
|
+
margin?: Margin | number;
|
|
24
|
+
/**
|
|
25
|
+
* A flag indicating that the Barcode text label is visible.
|
|
26
|
+
*
|
|
27
|
+
* If set to `false`, the Barcode will not display the value as a text below the barcode lines.
|
|
28
|
+
*
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
visible?: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported symbologies (encodings) for the Barcode component.
|
|
3
|
+
*/
|
|
4
|
+
export declare type BarcodeType = 'EAN8' | 'EAN13' | 'UPCE' | 'UPCA' | 'Code11' | 'Code39' | 'Code39Extended' | 'Code93' | 'Code93Extended' | 'Code128' | 'Code128A' | 'Code128B' | 'Code128C' | 'GS1-128' | 'MSImod10' | 'MSImod11' | 'MSImod1010' | 'MSImod1110' | 'POSTNET' | 'ean8' | 'ean13' | 'upce' | 'upca' | 'code11' | 'code39' | 'code39extended' | 'code93' | 'code93extended' | 'code128' | 'code128a' | 'code128b' | 'code128c' | 'gs1-128' | 'msimod10' | 'msimod11' | 'msimod1010' | 'msimod1110' | 'postnet';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DashType } from './dash-type.interface';
|
|
2
|
+
/**
|
|
3
|
+
* The appearance settings for the border lines.
|
|
4
|
+
*/
|
|
5
|
+
export interface Border {
|
|
6
|
+
/**
|
|
7
|
+
* The color of the border line. Accepts valid CSS color strings, including hex and rgb.
|
|
8
|
+
*/
|
|
9
|
+
color?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The dash type of the border line.
|
|
12
|
+
*/
|
|
13
|
+
dashType?: DashType;
|
|
14
|
+
/**
|
|
15
|
+
* The width of the border line in pixels.
|
|
16
|
+
*/
|
|
17
|
+
width?: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The margin size for each side.
|
|
3
|
+
*/
|
|
4
|
+
export interface Margin {
|
|
5
|
+
/**
|
|
6
|
+
* The top margin in pixels.
|
|
7
|
+
*/
|
|
8
|
+
top?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The right margin in pixels.
|
|
11
|
+
*/
|
|
12
|
+
right?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The bottom margin in pixels.
|
|
15
|
+
*/
|
|
16
|
+
bottom?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The left margin in pixels.
|
|
19
|
+
*/
|
|
20
|
+
left?: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The padding size for each side.
|
|
3
|
+
*/
|
|
4
|
+
export interface Padding {
|
|
5
|
+
/**
|
|
6
|
+
* The top padding in pixels.
|
|
7
|
+
*/
|
|
8
|
+
top?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The right padding in pixels.
|
|
11
|
+
*/
|
|
12
|
+
right?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The bottom padding in pixels.
|
|
15
|
+
*/
|
|
16
|
+
bottom?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The left padding in pixels.
|
|
19
|
+
*/
|
|
20
|
+
left?: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The QR Code error correction levels.
|
|
3
|
+
*
|
|
4
|
+
* * `"L"`—Approximately 7% of the codewords can be restored.
|
|
5
|
+
* * `"M"`—Approximately 15% of the codewords can be restored.
|
|
6
|
+
* * `"Q"`—Approximately 25% of the codewords can be restored.
|
|
7
|
+
* * `"H"`—Approximately 30% of the codewords can be restored.
|
|
8
|
+
*/
|
|
9
|
+
export declare type QRCodeErrorCorrection = 'L' | 'M' | 'Q' | 'H' | 'l' | 'm' | 'q' | 'h';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The image overlay configuration of the QR Code.
|
|
3
|
+
*/
|
|
4
|
+
export interface QRCodeOverlay {
|
|
5
|
+
/**
|
|
6
|
+
* The overlay height in pixels.
|
|
7
|
+
*/
|
|
8
|
+
height?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The source image for the overlay.
|
|
11
|
+
*
|
|
12
|
+
* Required only when `type` is set to `'image'`.
|
|
13
|
+
*/
|
|
14
|
+
imageUrl?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The overlay type.
|
|
17
|
+
*
|
|
18
|
+
* @default 'image'
|
|
19
|
+
*/
|
|
20
|
+
type?: 'image' | 'swiss';
|
|
21
|
+
/**
|
|
22
|
+
* The overlay width in pixels.
|
|
23
|
+
*/
|
|
24
|
+
width?: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sets the rendering mode of the component.
|
|
3
|
+
*
|
|
4
|
+
* The supported values are:
|
|
5
|
+
* * `"canvas"`—Renders the component as a Canvas element.
|
|
6
|
+
* * `"svg"`—Renders the component as an inline SVG document.
|
|
7
|
+
*/
|
|
8
|
+
export declare type RenderMode = 'svg' | 'canvas';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Margin } from './types/margin.interface';
|
|
2
|
+
export { Padding } from './types/padding.interface';
|
|
3
|
+
export { Border } from './types/border.interface';
|
|
4
|
+
export { DashType } from './types/dash-type.interface';
|
|
5
|
+
export { BarcodeText } from './types/barcode-text';
|
|
6
|
+
export { BarcodeType } from './types/barcode-type';
|
|
7
|
+
export { QRCodeEncoding } from './types/qrcode-encoding';
|
|
8
|
+
export { QRCodeErrorCorrection } from './types/qrcode-error-correction';
|
|
9
|
+
export { QRCodeOverlay } from './types/qrcode-overlay';
|
|
10
|
+
export { RenderMode } from './types/render-mode';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var isObject = function (value) {
|
|
4
|
+
return typeof value === 'object';
|
|
5
|
+
};
|
|
6
|
+
var diffOptions = function (original, current) {
|
|
7
|
+
if (Object.keys(original).length !== Object.keys(current).length) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
for (var field in original) {
|
|
11
|
+
if (original.hasOwnProperty(field)) {
|
|
12
|
+
var originalValue = original[field];
|
|
13
|
+
var currentValue = current[field];
|
|
14
|
+
var diff = isObject(originalValue) && isObject(currentValue) ?
|
|
15
|
+
diffOptions(originalValue, currentValue) : originalValue !== currentValue;
|
|
16
|
+
if (diff) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
exports.isOptionsChanged = function (original, current) {
|
|
27
|
+
if (!original || !current) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
original = [].concat(original);
|
|
31
|
+
current = [].concat(current);
|
|
32
|
+
if (original.length !== current.length) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
for (var idx = 0; idx < original.length; idx++) {
|
|
36
|
+
if (diffOptions(original[idx], current[idx])) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
};
|