@progress/kendo-react-barcodes 6.1.1 → 7.0.0-develop.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.
- package/{dist/npm/Barcode.d.ts → Barcode.d.ts} +4 -0
- package/BarcodeContext.d.ts +16 -0
- package/{dist/es/BarcodeProps.d.ts → BarcodeProps.d.ts} +4 -0
- package/{dist/npm/BaseBarcode.d.ts → BaseBarcode.d.ts} +4 -0
- package/{dist/npm/BaseBarcodeProps.d.ts → BaseBarcodeProps.d.ts} +4 -1
- package/LICENSE.md +1 -1
- package/{dist/npm/QRCode.d.ts → QRCode.d.ts} +4 -0
- package/{dist/es/QRCodeProps.d.ts → QRCodeProps.d.ts} +4 -0
- package/common/barcodes.d.ts +8 -0
- package/dist/cdn/js/kendo-react-barcodes.js +5 -1
- package/index.d.ts +10 -0
- package/index.js +5 -0
- package/index.mjs +335 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +30 -45
- package/store/reducer.d.ts +14 -0
- package/{dist/es/store → store}/store.d.ts +4 -0
- package/{dist/es/types → types}/barcode-text.d.ts +4 -0
- package/types/barcode-type.d.ts +8 -0
- package/{dist/npm/types → types}/border.interface.d.ts +4 -0
- package/types/dash-type.interface.d.ts +8 -0
- package/types/margin.interface.d.ts +25 -0
- package/{dist/npm/types → types}/padding.interface.d.ts +4 -0
- package/types/qrcode-encoding.d.ts +8 -0
- package/types/qrcode-error-correction.d.ts +13 -0
- package/{dist/npm/types → types}/qrcode-overlay.d.ts +4 -0
- package/types/render-mode.d.ts +12 -0
- package/types.d.ts +14 -0
- package/utils/common.d.ts +8 -0
- package/about.md +0 -3
- package/dist/es/Barcode.d.ts +0 -49
- package/dist/es/Barcode.js +0 -151
- package/dist/es/BarcodeContext.d.ts +0 -12
- package/dist/es/BarcodeContext.js +0 -6
- package/dist/es/BarcodeProps.js +0 -1
- package/dist/es/BaseBarcode.d.ts +0 -75
- package/dist/es/BaseBarcode.js +0 -187
- package/dist/es/BaseBarcodeProps.d.ts +0 -45
- package/dist/es/BaseBarcodeProps.js +0 -1
- package/dist/es/QRCode.d.ts +0 -49
- package/dist/es/QRCode.js +0 -154
- package/dist/es/QRCodeProps.js +0 -1
- package/dist/es/common/barcodes.d.ts +0 -4
- package/dist/es/common/barcodes.js +0 -1
- package/dist/es/main.d.ts +0 -6
- package/dist/es/main.js +0 -4
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/store/reducer.d.ts +0 -10
- package/dist/es/store/reducer.js +0 -50
- package/dist/es/store/store.js +0 -28
- package/dist/es/types/barcode-text.js +0 -1
- package/dist/es/types/barcode-type.d.ts +0 -4
- package/dist/es/types/barcode-type.js +0 -1
- package/dist/es/types/border.interface.d.ts +0 -18
- package/dist/es/types/border.interface.js +0 -1
- package/dist/es/types/dash-type.interface.d.ts +0 -4
- package/dist/es/types/dash-type.interface.js +0 -1
- package/dist/es/types/margin.interface.d.ts +0 -21
- package/dist/es/types/margin.interface.js +0 -1
- package/dist/es/types/padding.interface.d.ts +0 -21
- package/dist/es/types/padding.interface.js +0 -1
- package/dist/es/types/qrcode-encoding.d.ts +0 -4
- package/dist/es/types/qrcode-encoding.js +0 -1
- package/dist/es/types/qrcode-error-correction.d.ts +0 -9
- package/dist/es/types/qrcode-error-correction.js +0 -1
- package/dist/es/types/qrcode-overlay.d.ts +0 -25
- package/dist/es/types/qrcode-overlay.js +0 -1
- package/dist/es/types/render-mode.d.ts +0 -8
- package/dist/es/types/render-mode.js +0 -1
- package/dist/es/types.d.ts +0 -10
- package/dist/es/types.js +0 -1
- package/dist/es/utils/common.d.ts +0 -4
- package/dist/es/utils/common.js +0 -39
- package/dist/npm/Barcode.js +0 -154
- package/dist/npm/BarcodeContext.d.ts +0 -12
- package/dist/npm/BarcodeContext.js +0 -9
- package/dist/npm/BarcodeProps.d.ts +0 -61
- package/dist/npm/BarcodeProps.js +0 -2
- package/dist/npm/BaseBarcode.js +0 -190
- package/dist/npm/BaseBarcodeProps.js +0 -2
- package/dist/npm/QRCode.js +0 -157
- package/dist/npm/QRCodeProps.d.ts +0 -73
- package/dist/npm/QRCodeProps.js +0 -2
- package/dist/npm/common/barcodes.d.ts +0 -4
- package/dist/npm/common/barcodes.js +0 -2
- package/dist/npm/main.d.ts +0 -6
- package/dist/npm/main.js +0 -22
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/store/reducer.d.ts +0 -10
- package/dist/npm/store/reducer.js +0 -54
- package/dist/npm/store/store.d.ts +0 -25
- package/dist/npm/store/store.js +0 -31
- package/dist/npm/types/barcode-text.d.ts +0 -32
- package/dist/npm/types/barcode-text.js +0 -2
- package/dist/npm/types/barcode-type.d.ts +0 -4
- package/dist/npm/types/barcode-type.js +0 -2
- package/dist/npm/types/border.interface.js +0 -2
- package/dist/npm/types/dash-type.interface.d.ts +0 -4
- package/dist/npm/types/dash-type.interface.js +0 -2
- package/dist/npm/types/margin.interface.d.ts +0 -21
- package/dist/npm/types/margin.interface.js +0 -2
- package/dist/npm/types/padding.interface.js +0 -2
- package/dist/npm/types/qrcode-encoding.d.ts +0 -4
- package/dist/npm/types/qrcode-encoding.js +0 -2
- package/dist/npm/types/qrcode-error-correction.d.ts +0 -9
- package/dist/npm/types/qrcode-error-correction.js +0 -2
- package/dist/npm/types/qrcode-overlay.js +0 -2
- package/dist/npm/types/render-mode.d.ts +0 -8
- package/dist/npm/types/render-mode.js +0 -2
- package/dist/npm/types.d.ts +0 -10
- package/dist/npm/types.js +0 -2
- package/dist/npm/utils/common.d.ts +0 -4
- package/dist/npm/utils/common.js +0 -43
- package/dist/systemjs/kendo-react-barcodes.js +0 -1
- package/e2e-next/barcode.basic.tests.ts +0 -24
- package/e2e-next/qrcode.basic.tests.ts +0 -24
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Store } from './store/store';
|
|
3
|
-
/**
|
|
4
|
-
* @hidden
|
|
5
|
-
*/
|
|
6
|
-
export interface BarcodeContextType {
|
|
7
|
-
observersStore: Store;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export declare const BarcodeContext: React.Context<BarcodeContextType | null>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BarcodeContext = void 0;
|
|
4
|
-
var React = require("react");
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
exports.BarcodeContext = React.createContext(null);
|
|
9
|
-
exports.BarcodeContext.displayName = 'BarcodeContext';
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { BaseBarcodeProps } from './BaseBarcodeProps';
|
|
2
|
-
import { BarcodeText, BarcodeType, Border, Padding } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the props of the [KendoReact Barcode component]({% slug overview_barcode_barcodes %}).
|
|
5
|
-
*/
|
|
6
|
-
export interface BarcodeProps extends BaseBarcodeProps {
|
|
7
|
-
/**
|
|
8
|
-
* The background color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
|
|
9
|
-
*
|
|
10
|
-
* @default "white"
|
|
11
|
-
*/
|
|
12
|
-
background?: string;
|
|
13
|
-
/**
|
|
14
|
-
* The border of the Barcode.
|
|
15
|
-
*/
|
|
16
|
-
border?: Border;
|
|
17
|
-
/**
|
|
18
|
-
* If set to `true`, the Barcode will display the checksum digit next to the value in the text area.
|
|
19
|
-
*
|
|
20
|
-
* @default false
|
|
21
|
-
*/
|
|
22
|
-
checksum?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* The color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
|
|
25
|
-
*
|
|
26
|
-
* @default "black"
|
|
27
|
-
*/
|
|
28
|
-
color?: string;
|
|
29
|
-
/**
|
|
30
|
-
* The height of the Barcode in pixels.
|
|
31
|
-
*
|
|
32
|
-
* The Barcode dimensions can also be set through regular CSS styling.
|
|
33
|
-
*/
|
|
34
|
-
height?: number;
|
|
35
|
-
/**
|
|
36
|
-
* The padding of the Barcode. A numeric value sets all paddings.
|
|
37
|
-
*
|
|
38
|
-
* @default 0
|
|
39
|
-
*/
|
|
40
|
-
padding?: Padding | number;
|
|
41
|
-
/**
|
|
42
|
-
* The Barcode text label configuration.
|
|
43
|
-
*/
|
|
44
|
-
text?: BarcodeText;
|
|
45
|
-
/**
|
|
46
|
-
* The symbology (encoding) the Barcode will use.
|
|
47
|
-
*
|
|
48
|
-
* @default "Code39"
|
|
49
|
-
*/
|
|
50
|
-
type: BarcodeType | string;
|
|
51
|
-
/**
|
|
52
|
-
* The value of the Barcode.
|
|
53
|
-
*/
|
|
54
|
-
value: number | string;
|
|
55
|
-
/**
|
|
56
|
-
* The width of the Barcode in pixels.
|
|
57
|
-
*
|
|
58
|
-
* The Barcode dimensions can also be set through regular CSS styling.
|
|
59
|
-
*/
|
|
60
|
-
width?: number;
|
|
61
|
-
}
|
package/dist/npm/BarcodeProps.js
DELETED
package/dist/npm/BaseBarcode.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
-
var t = {};
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
-
t[p[i]] = s[p[i]];
|
|
25
|
-
}
|
|
26
|
-
return t;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.BaseBarcode = void 0;
|
|
30
|
-
var React = require("react");
|
|
31
|
-
var PropTypes = require("prop-types");
|
|
32
|
-
var store_1 = require("./store/store");
|
|
33
|
-
var reducer_1 = require("./store/reducer");
|
|
34
|
-
var common_1 = require("./utils/common");
|
|
35
|
-
var BarcodeContext_1 = require("./BarcodeContext");
|
|
36
|
-
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
37
|
-
var package_metadata_1 = require("./package-metadata");
|
|
38
|
-
/**
|
|
39
|
-
* @hidden
|
|
40
|
-
*/
|
|
41
|
-
var BaseBarcode = /** @class */ (function (_super) {
|
|
42
|
-
__extends(BaseBarcode, _super);
|
|
43
|
-
function BaseBarcode(props) {
|
|
44
|
-
var _this = _super.call(this, props) || this;
|
|
45
|
-
/**
|
|
46
|
-
* @hidden
|
|
47
|
-
*/
|
|
48
|
-
_this.barcodeInstance = null;
|
|
49
|
-
/**
|
|
50
|
-
* @hidden
|
|
51
|
-
*/
|
|
52
|
-
_this.surface = null;
|
|
53
|
-
_this._element = null;
|
|
54
|
-
_this.observersStore = {};
|
|
55
|
-
/* DOM event handlers */
|
|
56
|
-
/**
|
|
57
|
-
* @hidden
|
|
58
|
-
*/
|
|
59
|
-
_this.onWindowResize = function () {
|
|
60
|
-
if (_this.barcodeInstance !== null) {
|
|
61
|
-
_this.barcodeInstance.redraw();
|
|
62
|
-
_this.trigger('render', { sender: _this });
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
(0, kendo_react_common_1.validatePackage)(package_metadata_1.packageMetadata);
|
|
66
|
-
_this.observersStore = (0, store_1.default)(reducer_1.observersReducer);
|
|
67
|
-
_this.contextValue = {
|
|
68
|
-
observersStore: _this.observersStore
|
|
69
|
-
};
|
|
70
|
-
return _this;
|
|
71
|
-
}
|
|
72
|
-
Object.defineProperty(BaseBarcode.prototype, "element", {
|
|
73
|
-
/**
|
|
74
|
-
* @hidden
|
|
75
|
-
*/
|
|
76
|
-
get: function () {
|
|
77
|
-
return this._element;
|
|
78
|
-
},
|
|
79
|
-
enumerable: false,
|
|
80
|
-
configurable: true
|
|
81
|
-
});
|
|
82
|
-
/**
|
|
83
|
-
* @hidden
|
|
84
|
-
*/
|
|
85
|
-
BaseBarcode.prototype.componentDidMount = function () {
|
|
86
|
-
this.instantiateCoreBarcode();
|
|
87
|
-
window.addEventListener('resize', this.onWindowResize);
|
|
88
|
-
this.trigger('render', { sender: this });
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* @hidden
|
|
92
|
-
*/
|
|
93
|
-
BaseBarcode.prototype.componentDidUpdate = function (prevProps) {
|
|
94
|
-
var _a = this.props, children = _a.children, deriveOptionsFromParent = _a.deriveOptionsFromParent, getTarget = _a.getTarget, barcodeConstructor = _a.barcodeConstructor, className = _a.className, renderAs = _a.renderAs, currentOthers = __rest(_a, ["children", "deriveOptionsFromParent", "getTarget", "barcodeConstructor", "className", "renderAs"]);
|
|
95
|
-
var prevChildren = prevProps.children, prevDeriveOptionsFromParent = prevProps.deriveOptionsFromParent, prevGetTarget = prevProps.getTarget, prevBarcodeConstructor = prevProps.barcodeConstructor, prevClassName = prevProps.className, prevRenderAs = prevProps.renderAs, prevOthers = __rest(prevProps, ["children", "deriveOptionsFromParent", "getTarget", "barcodeConstructor", "className", "renderAs"]);
|
|
96
|
-
if (this.barcodeInstance !== null) {
|
|
97
|
-
var optionsChanged = (0, common_1.isOptionsChanged)(prevOthers, currentOthers);
|
|
98
|
-
if ((renderAs || 'svg') !== (prevRenderAs || 'svg')) {
|
|
99
|
-
if (this.barcodeInstance !== null) {
|
|
100
|
-
this.barcodeInstance.destroy();
|
|
101
|
-
this.barcodeInstance = null;
|
|
102
|
-
}
|
|
103
|
-
this.instantiateCoreBarcode();
|
|
104
|
-
}
|
|
105
|
-
else if (optionsChanged) {
|
|
106
|
-
this.refresh();
|
|
107
|
-
}
|
|
108
|
-
this.trigger('render', { sender: this });
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* @hidden
|
|
113
|
-
*/
|
|
114
|
-
BaseBarcode.prototype.componentWillUnmount = function () {
|
|
115
|
-
if (this.barcodeInstance !== null) {
|
|
116
|
-
this.barcodeInstance.destroy();
|
|
117
|
-
this.barcodeInstance = null;
|
|
118
|
-
}
|
|
119
|
-
window.removeEventListener('resize', this.onWindowResize);
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* @hidden
|
|
123
|
-
*/
|
|
124
|
-
BaseBarcode.prototype.render = function () {
|
|
125
|
-
var _this = this;
|
|
126
|
-
var _a = this.props, _b = _a.style, style = _b === void 0 ? {} : _b, className = _a.className, children = _a.children;
|
|
127
|
-
return (React.createElement(BarcodeContext_1.BarcodeContext.Provider, { value: this.contextValue },
|
|
128
|
-
React.createElement("div", { style: style, ref: function (el) { return _this._element = el; }, className: className }, children)));
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* @hidden
|
|
132
|
-
*/
|
|
133
|
-
BaseBarcode.prototype.instantiateCoreBarcode = function () {
|
|
134
|
-
var barcodeConstructor = this.props.barcodeConstructor;
|
|
135
|
-
var barcodeOptions = this.getBarcodeOptions();
|
|
136
|
-
this.barcodeInstance = new barcodeConstructor(this.element, barcodeOptions, function (error) {
|
|
137
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
138
|
-
throw error;
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
console.warn(error);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* @hidden
|
|
147
|
-
*/
|
|
148
|
-
BaseBarcode.prototype.refresh = function () {
|
|
149
|
-
if (this.barcodeInstance !== null) {
|
|
150
|
-
var barcodeOptions = this.getBarcodeOptions();
|
|
151
|
-
this.barcodeInstance.setOptions(barcodeOptions);
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* @hidden
|
|
156
|
-
*/
|
|
157
|
-
BaseBarcode.prototype.getBarcodeOptions = function () {
|
|
158
|
-
var _a = this.props, renderAs = _a.renderAs, deriveOptionsFromParent = _a.deriveOptionsFromParent;
|
|
159
|
-
var barcodeOptions = { renderAs: renderAs };
|
|
160
|
-
if (deriveOptionsFromParent) {
|
|
161
|
-
// Add options from parent - required by TS
|
|
162
|
-
barcodeOptions = deriveOptionsFromParent(barcodeOptions);
|
|
163
|
-
}
|
|
164
|
-
return barcodeOptions;
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* @hidden
|
|
168
|
-
*/
|
|
169
|
-
BaseBarcode.prototype.trigger = function (name, e) {
|
|
170
|
-
var observers = this.observersStore.getState();
|
|
171
|
-
for (var idx = 0; idx < observers.length; idx++) {
|
|
172
|
-
observers[idx].trigger(name, e);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
/**
|
|
176
|
-
* @hidden
|
|
177
|
-
*/
|
|
178
|
-
BaseBarcode.propTypes = {
|
|
179
|
-
dir: PropTypes.string,
|
|
180
|
-
renderAs: PropTypes.oneOf(['svg', 'canvas'])
|
|
181
|
-
};
|
|
182
|
-
/**
|
|
183
|
-
* @hidden
|
|
184
|
-
*/
|
|
185
|
-
BaseBarcode.defaultProps = {
|
|
186
|
-
renderAs: 'svg'
|
|
187
|
-
};
|
|
188
|
-
return BaseBarcode;
|
|
189
|
-
}(React.Component));
|
|
190
|
-
exports.BaseBarcode = BaseBarcode;
|
package/dist/npm/QRCode.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
29
|
-
var t = {};
|
|
30
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
31
|
-
t[p] = s[p];
|
|
32
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
33
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
34
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
35
|
-
t[p[i]] = s[p[i]];
|
|
36
|
-
}
|
|
37
|
-
return t;
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.QRCode = void 0;
|
|
41
|
-
var React = require("react");
|
|
42
|
-
var BaseBarcode_1 = require("./BaseBarcode");
|
|
43
|
-
var kendo_charts_1 = require("@progress/kendo-charts");
|
|
44
|
-
var kendo_drawing_1 = require("@progress/kendo-drawing");
|
|
45
|
-
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
46
|
-
var DEFAULT_COLOR = '#000';
|
|
47
|
-
var DEFAULT_BACKGROUND = '#fff';
|
|
48
|
-
var DEFAULT_ERROR_CORRECTION = 'L';
|
|
49
|
-
/**
|
|
50
|
-
* Represents the KendoReact QRCode component.
|
|
51
|
-
*/
|
|
52
|
-
var QRCode = /** @class */ (function (_super) {
|
|
53
|
-
__extends(QRCode, _super);
|
|
54
|
-
function QRCode() {
|
|
55
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
56
|
-
_this._baseBarcode = null;
|
|
57
|
-
_this.getTarget = function () {
|
|
58
|
-
return _this;
|
|
59
|
-
};
|
|
60
|
-
_this.deriveOptionsFromParent = function (options) {
|
|
61
|
-
return Object.assign({}, options, {
|
|
62
|
-
background: _this.props.background || DEFAULT_BACKGROUND,
|
|
63
|
-
border: _this.props.border,
|
|
64
|
-
color: _this.props.color || DEFAULT_COLOR,
|
|
65
|
-
encoding: _this.props.encoding,
|
|
66
|
-
errorCorrection: _this.props.errorCorrection || DEFAULT_ERROR_CORRECTION,
|
|
67
|
-
overlay: _this.props.overlay || {},
|
|
68
|
-
padding: _this.props.padding,
|
|
69
|
-
renderAs: _this.props.renderAs,
|
|
70
|
-
size: _this.props.size,
|
|
71
|
-
value: _this.props.value
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
return _this;
|
|
75
|
-
}
|
|
76
|
-
Object.defineProperty(QRCode.prototype, "barcodeInstance", {
|
|
77
|
-
/**
|
|
78
|
-
* @hidden
|
|
79
|
-
*/
|
|
80
|
-
get: function () {
|
|
81
|
-
if (this._baseBarcode !== null) {
|
|
82
|
-
return this._baseBarcode.barcodeInstance;
|
|
83
|
-
}
|
|
84
|
-
return null;
|
|
85
|
-
},
|
|
86
|
-
enumerable: false,
|
|
87
|
-
configurable: true
|
|
88
|
-
});
|
|
89
|
-
Object.defineProperty(QRCode.prototype, "surface", {
|
|
90
|
-
/**
|
|
91
|
-
* The Drawing `Surface` of the Barcode.
|
|
92
|
-
*/
|
|
93
|
-
get: function () {
|
|
94
|
-
if (this._baseBarcode !== null) {
|
|
95
|
-
return this._baseBarcode.surface;
|
|
96
|
-
}
|
|
97
|
-
return null;
|
|
98
|
-
},
|
|
99
|
-
enumerable: false,
|
|
100
|
-
configurable: true
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(QRCode.prototype, "element", {
|
|
103
|
-
/**
|
|
104
|
-
* The DOM element of the Barcode.
|
|
105
|
-
*/
|
|
106
|
-
get: function () {
|
|
107
|
-
if (this._baseBarcode !== null) {
|
|
108
|
-
return this._baseBarcode.element;
|
|
109
|
-
}
|
|
110
|
-
return null;
|
|
111
|
-
},
|
|
112
|
-
enumerable: false,
|
|
113
|
-
configurable: true
|
|
114
|
-
});
|
|
115
|
-
/**
|
|
116
|
-
* @hidden
|
|
117
|
-
*/
|
|
118
|
-
QRCode.prototype.render = function () {
|
|
119
|
-
var _this = this;
|
|
120
|
-
var _a = this.props, children = _a.children, className = _a.className, baseBarcodeProps = __rest(_a, ["children", "className"]);
|
|
121
|
-
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: (0, kendo_react_common_1.classNames)('k-qrcode', className) }), children));
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* Exports the component as an image. The export operation is asynchronous and returns a promise.
|
|
125
|
-
*
|
|
126
|
-
* @param {ImageExportOptions} options - The parameters for the exported image.
|
|
127
|
-
* @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
|
|
128
|
-
*/
|
|
129
|
-
QRCode.prototype.exportImage = function (options) {
|
|
130
|
-
if (options === void 0) { options = {}; }
|
|
131
|
-
return (0, kendo_drawing_1.exportImage)(this.exportVisual(), options);
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
|
|
135
|
-
*
|
|
136
|
-
* @param options - The parameters for the exported file.
|
|
137
|
-
* @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
|
|
138
|
-
*/
|
|
139
|
-
QRCode.prototype.exportSVG = function (options) {
|
|
140
|
-
if (options === void 0) { options = {}; }
|
|
141
|
-
return (0, kendo_drawing_1.exportSVG)(this.exportVisual(), options);
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Exports a Barcode component as a Drawing `Scene`.
|
|
145
|
-
*
|
|
146
|
-
* @param {any} options - The parameters for the export operation.
|
|
147
|
-
* @returns {Group} - A promise that returns the root `Group` of the scene.
|
|
148
|
-
*/
|
|
149
|
-
QRCode.prototype.exportVisual = function (options) {
|
|
150
|
-
if (this.barcodeInstance !== null) {
|
|
151
|
-
return this.barcodeInstance.exportVisual(options);
|
|
152
|
-
}
|
|
153
|
-
return new kendo_drawing_1.Group();
|
|
154
|
-
};
|
|
155
|
-
return QRCode;
|
|
156
|
-
}(React.Component));
|
|
157
|
-
exports.QRCode = QRCode;
|
|
@@ -1,73 +0,0 @@
|
|
|
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/QRCodeProps.js
DELETED
package/dist/npm/main.d.ts
DELETED
package/dist/npm/main.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.QRCode = exports.Barcode = void 0;
|
|
18
|
-
var Barcode_1 = require("./Barcode");
|
|
19
|
-
Object.defineProperty(exports, "Barcode", { enumerable: true, get: function () { return Barcode_1.Barcode; } });
|
|
20
|
-
var QRCode_1 = require("./QRCode");
|
|
21
|
-
Object.defineProperty(exports, "QRCode", { enumerable: true, get: function () { return QRCode_1.QRCode; } });
|
|
22
|
-
__exportStar(require("./types"), exports);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.packageMetadata = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
exports.packageMetadata = {
|
|
8
|
-
name: '@progress/kendo-react-barcodes',
|
|
9
|
-
productName: 'KendoReact',
|
|
10
|
-
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate: 1700063409,
|
|
12
|
-
version: '',
|
|
13
|
-
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'
|
|
14
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
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 };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.observersReducer = exports.optionsReducer = void 0;
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
var optionsReducer = function (currentState, action) {
|
|
17
|
-
if (action.barcodeKey) {
|
|
18
|
-
return reducers.configurationItem(currentState, action);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
return {};
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
exports.optionsReducer = optionsReducer;
|
|
25
|
-
/**
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
var observersReducer = function (currentState, action) {
|
|
29
|
-
if (action.type) {
|
|
30
|
-
switch (action.type) {
|
|
31
|
-
case 'add':
|
|
32
|
-
return __spreadArray(__spreadArray([], currentState, true), [action.payload], false);
|
|
33
|
-
case 'remove':
|
|
34
|
-
return currentState.filter(function (element) { return element !== action.payload; });
|
|
35
|
-
default:
|
|
36
|
-
return currentState;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return [];
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.observersReducer = observersReducer;
|
|
44
|
-
/**
|
|
45
|
-
* @hidden
|
|
46
|
-
*/
|
|
47
|
-
var reducers = {
|
|
48
|
-
configurationItem: function (currentState, action) {
|
|
49
|
-
var _a;
|
|
50
|
-
return Object.assign(currentState, (_a = {},
|
|
51
|
-
_a[action.barcodeKey] = action.payload,
|
|
52
|
-
_a));
|
|
53
|
-
}
|
|
54
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
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;
|