@progress/kendo-react-barcodes 7.2.4-develop.3 → 7.2.4-develop.4
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/Barcode.js +8 -0
- package/Barcode.mjs +95 -0
- package/BarcodeContext.js +8 -0
- package/BarcodeContext.mjs +14 -0
- package/BaseBarcode.js +8 -0
- package/BaseBarcode.mjs +137 -0
- package/QRCode.js +8 -0
- package/QRCode.mjs +96 -0
- package/dist/cdn/js/kendo-react-barcodes.js +8 -5
- package/index.d.mts +418 -5
- package/index.d.ts +418 -10
- package/index.js +8 -5
- package/index.mjs +11 -333
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +3 -3
- package/store/reducer.js +8 -0
- package/store/reducer.mjs +24 -0
- package/store/store.js +8 -0
- package/store/store.mjs +20 -0
- package/utils/common.js +8 -0
- package/utils/common.mjs +29 -0
- package/Barcode.d.ts +0 -53
- package/BarcodeContext.d.ts +0 -16
- package/BarcodeProps.d.ts +0 -65
- package/BaseBarcode.d.ts +0 -79
- package/BaseBarcodeProps.d.ts +0 -48
- package/QRCode.d.ts +0 -53
- package/QRCodeProps.d.ts +0 -77
- package/common/barcodes.d.ts +0 -8
- package/package-metadata.d.ts +0 -9
- package/store/reducer.d.ts +0 -14
- package/store/store.d.ts +0 -29
- package/types/barcode-text.d.ts +0 -36
- package/types/barcode-type.d.ts +0 -8
- package/types/border.interface.d.ts +0 -22
- package/types/dash-type.interface.d.ts +0 -8
- package/types/margin.interface.d.ts +0 -25
- package/types/padding.interface.d.ts +0 -25
- package/types/qrcode-encoding.d.ts +0 -8
- package/types/qrcode-error-correction.d.ts +0 -13
- package/types/qrcode-overlay.d.ts +0 -29
- package/types/render-mode.d.ts +0 -12
- package/types.d.ts +0 -14
- package/utils/common.d.ts +0 -8
package/index.d.mts
CHANGED
|
@@ -1,5 +1,418 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { Group } from '@progress/kendo-drawing';
|
|
9
|
+
import { ImageExportOptions } from '@progress/kendo-drawing';
|
|
10
|
+
import * as React_2 from 'react';
|
|
11
|
+
import { Surface } from '@progress/kendo-drawing';
|
|
12
|
+
import { SVGExportOptions } from '@progress/kendo-drawing';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the KendoReact Barcode component.
|
|
16
|
+
*/
|
|
17
|
+
export declare class Barcode extends React_2.Component<BarcodeProps, {}> {
|
|
18
|
+
private _baseBarcode;
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
get barcodeInstance(): any;
|
|
23
|
+
/**
|
|
24
|
+
* The Drawing `Surface` of the Barcode.
|
|
25
|
+
*/
|
|
26
|
+
get surface(): Surface | null;
|
|
27
|
+
/**
|
|
28
|
+
* The DOM element of the Barcode.
|
|
29
|
+
*/
|
|
30
|
+
get element(): HTMLDivElement | null;
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
render(): any;
|
|
35
|
+
/**
|
|
36
|
+
* Exports the component as an image. The export operation is asynchronous and returns a promise.
|
|
37
|
+
*
|
|
38
|
+
* @param {ImageExportOptions} options - The parameters for the exported image.
|
|
39
|
+
* @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
|
|
40
|
+
*/
|
|
41
|
+
exportImage(options?: ImageExportOptions): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
|
|
44
|
+
*
|
|
45
|
+
* @param options - The parameters for the exported file.
|
|
46
|
+
* @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
|
|
47
|
+
*/
|
|
48
|
+
exportSVG(options?: SVGExportOptions): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Exports a Barcode component as a Drawing `Scene`.
|
|
51
|
+
*
|
|
52
|
+
* @param {any} options - The parameters for the export operation.
|
|
53
|
+
* @returns {Group} - A promise that returns the root `Group` of the scene.
|
|
54
|
+
*/
|
|
55
|
+
exportVisual(options?: any): Group;
|
|
56
|
+
private getTarget;
|
|
57
|
+
private deriveOptionsFromParent;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Represents the props of the [KendoReact Barcode component]({% slug overview_barcode_barcodes %}).
|
|
62
|
+
*/
|
|
63
|
+
export declare interface BarcodeProps extends BaseBarcodeProps {
|
|
64
|
+
/**
|
|
65
|
+
* The background color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
|
|
66
|
+
*
|
|
67
|
+
* @default "white"
|
|
68
|
+
*/
|
|
69
|
+
background?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The border of the Barcode.
|
|
72
|
+
*/
|
|
73
|
+
border?: Border;
|
|
74
|
+
/**
|
|
75
|
+
* If set to `true`, the Barcode will display the checksum digit next to the value in the text area.
|
|
76
|
+
*
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
checksum?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The color of the Barcode. Accepts a valid CSS color string, including hex and rgb.
|
|
82
|
+
*
|
|
83
|
+
* @default "black"
|
|
84
|
+
*/
|
|
85
|
+
color?: string;
|
|
86
|
+
/**
|
|
87
|
+
* The height of the Barcode in pixels.
|
|
88
|
+
*
|
|
89
|
+
* The Barcode dimensions can also be set through regular CSS styling.
|
|
90
|
+
*/
|
|
91
|
+
height?: number;
|
|
92
|
+
/**
|
|
93
|
+
* The padding of the Barcode. A numeric value sets all paddings.
|
|
94
|
+
*
|
|
95
|
+
* @default 0
|
|
96
|
+
*/
|
|
97
|
+
padding?: Padding | number;
|
|
98
|
+
/**
|
|
99
|
+
* The Barcode text label configuration.
|
|
100
|
+
*/
|
|
101
|
+
text?: BarcodeText;
|
|
102
|
+
/**
|
|
103
|
+
* The symbology (encoding) the Barcode will use.
|
|
104
|
+
*
|
|
105
|
+
* @default "Code39"
|
|
106
|
+
*/
|
|
107
|
+
type: BarcodeType | string;
|
|
108
|
+
/**
|
|
109
|
+
* The value of the Barcode.
|
|
110
|
+
*/
|
|
111
|
+
value: number | string;
|
|
112
|
+
/**
|
|
113
|
+
* The width of the Barcode in pixels.
|
|
114
|
+
*
|
|
115
|
+
* The Barcode dimensions can also be set through regular CSS styling.
|
|
116
|
+
*/
|
|
117
|
+
width?: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The Barcode text label configuration.
|
|
122
|
+
*/
|
|
123
|
+
export declare interface BarcodeText {
|
|
124
|
+
/**
|
|
125
|
+
* The color of the text. Any valid CSS color string will work here, including hex and rgb.
|
|
126
|
+
*
|
|
127
|
+
* @default "black"
|
|
128
|
+
*/
|
|
129
|
+
color?: string;
|
|
130
|
+
/**
|
|
131
|
+
* The font of the text.
|
|
132
|
+
*
|
|
133
|
+
* @default "16px Consolas, Monaco, Sans Mono, monospace, sans-serif"
|
|
134
|
+
*/
|
|
135
|
+
font?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The margin of the text. A numeric value sets all margins.
|
|
138
|
+
*
|
|
139
|
+
* @default 0
|
|
140
|
+
*/
|
|
141
|
+
margin?: Margin | number;
|
|
142
|
+
/**
|
|
143
|
+
* A flag indicating that the Barcode text label is visible.
|
|
144
|
+
*
|
|
145
|
+
* If set to `false`, the Barcode will not display the value as a text below the barcode lines.
|
|
146
|
+
*
|
|
147
|
+
* @default true
|
|
148
|
+
*/
|
|
149
|
+
visible?: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Supported symbologies (encodings) for the Barcode component.
|
|
154
|
+
*/
|
|
155
|
+
export declare type BarcodeType = 'EAN8' | 'EAN13' | 'UPCE' | 'UPCA' | 'Code11' | 'Code39' | 'Code39Extended' | 'Code93' | 'Code93Extended' | 'Code128' | 'Code128A' | 'Code128B' | 'Code128C' | 'GS1-128' | 'MSImod10' | 'MSImod11' | 'MSImod1010' | 'MSImod1110' | 'POSTNET';
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @hidden
|
|
159
|
+
*/
|
|
160
|
+
declare interface BaseBarcodeProps {
|
|
161
|
+
/**
|
|
162
|
+
* @hidden
|
|
163
|
+
*/
|
|
164
|
+
children?: React.ReactNode;
|
|
165
|
+
/**
|
|
166
|
+
* The styles that are applied to the component.
|
|
167
|
+
*/
|
|
168
|
+
style?: React.CSSProperties;
|
|
169
|
+
/**
|
|
170
|
+
* Sets additional CSS classes to the component.
|
|
171
|
+
*/
|
|
172
|
+
className?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Sets the preferred rendering engine.
|
|
175
|
+
*
|
|
176
|
+
* The supported values are:
|
|
177
|
+
* - `"svg"`—If available, renders the component as an inline `svg` element.
|
|
178
|
+
* - `"canvas"`—If available, renders the component as a `canvas` element.
|
|
179
|
+
*/
|
|
180
|
+
renderAs?: RenderMode;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The appearance settings for the border lines.
|
|
185
|
+
*/
|
|
186
|
+
export declare interface Border {
|
|
187
|
+
/**
|
|
188
|
+
* The color of the border line. Accepts valid CSS color strings, including hex and rgb.
|
|
189
|
+
*/
|
|
190
|
+
color?: string;
|
|
191
|
+
/**
|
|
192
|
+
* The dash type of the border line.
|
|
193
|
+
*/
|
|
194
|
+
dashType?: DashType;
|
|
195
|
+
/**
|
|
196
|
+
* The width of the border line in pixels.
|
|
197
|
+
*/
|
|
198
|
+
width?: number;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The dash line type.
|
|
203
|
+
*/
|
|
204
|
+
export declare type DashType = 'dash' | 'dashDot' | 'dot' | 'longDash' | 'longDashDot' | 'longDashDotDot' | 'solid';
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The margin size for each side.
|
|
208
|
+
*/
|
|
209
|
+
export declare interface Margin {
|
|
210
|
+
/**
|
|
211
|
+
* The top margin in pixels.
|
|
212
|
+
*/
|
|
213
|
+
top?: number;
|
|
214
|
+
/**
|
|
215
|
+
* The right margin in pixels.
|
|
216
|
+
*/
|
|
217
|
+
right?: number;
|
|
218
|
+
/**
|
|
219
|
+
* The bottom margin in pixels.
|
|
220
|
+
*/
|
|
221
|
+
bottom?: number;
|
|
222
|
+
/**
|
|
223
|
+
* The left margin in pixels.
|
|
224
|
+
*/
|
|
225
|
+
left?: number;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* The padding size for each side.
|
|
230
|
+
*/
|
|
231
|
+
export declare interface Padding {
|
|
232
|
+
/**
|
|
233
|
+
* The top padding in pixels.
|
|
234
|
+
*/
|
|
235
|
+
top?: number;
|
|
236
|
+
/**
|
|
237
|
+
* The right padding in pixels.
|
|
238
|
+
*/
|
|
239
|
+
right?: number;
|
|
240
|
+
/**
|
|
241
|
+
* The bottom padding in pixels.
|
|
242
|
+
*/
|
|
243
|
+
bottom?: number;
|
|
244
|
+
/**
|
|
245
|
+
* The left padding in pixels.
|
|
246
|
+
*/
|
|
247
|
+
left?: number;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Represents the KendoReact QRCode component.
|
|
252
|
+
*/
|
|
253
|
+
export declare class QRCode extends React_2.Component<QRCodeProps, {}> {
|
|
254
|
+
private _baseBarcode;
|
|
255
|
+
/**
|
|
256
|
+
* @hidden
|
|
257
|
+
*/
|
|
258
|
+
get barcodeInstance(): any;
|
|
259
|
+
/**
|
|
260
|
+
* The Drawing `Surface` of the Barcode.
|
|
261
|
+
*/
|
|
262
|
+
get surface(): Surface | null;
|
|
263
|
+
/**
|
|
264
|
+
* The DOM element of the Barcode.
|
|
265
|
+
*/
|
|
266
|
+
get element(): HTMLDivElement | null;
|
|
267
|
+
/**
|
|
268
|
+
* @hidden
|
|
269
|
+
*/
|
|
270
|
+
render(): any;
|
|
271
|
+
/**
|
|
272
|
+
* Exports the component as an image. The export operation is asynchronous and returns a promise.
|
|
273
|
+
*
|
|
274
|
+
* @param {ImageExportOptions} options - The parameters for the exported image.
|
|
275
|
+
* @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
|
|
276
|
+
*/
|
|
277
|
+
exportImage(options?: ImageExportOptions): Promise<string>;
|
|
278
|
+
/**
|
|
279
|
+
* Exports the component as an SVG document. The export operation is asynchronous and returns a promise.
|
|
280
|
+
*
|
|
281
|
+
* @param options - The parameters for the exported file.
|
|
282
|
+
* @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
|
|
283
|
+
*/
|
|
284
|
+
exportSVG(options?: SVGExportOptions): Promise<string>;
|
|
285
|
+
/**
|
|
286
|
+
* Exports a Barcode component as a Drawing `Scene`.
|
|
287
|
+
*
|
|
288
|
+
* @param {any} options - The parameters for the export operation.
|
|
289
|
+
* @returns {Group} - A promise that returns the root `Group` of the scene.
|
|
290
|
+
*/
|
|
291
|
+
exportVisual(options?: any): Group;
|
|
292
|
+
private getTarget;
|
|
293
|
+
private deriveOptionsFromParent;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* The QR Code encoding modes.
|
|
298
|
+
*/
|
|
299
|
+
export declare type QRCodeEncoding = 'ISO_8859_1' | 'UTF_8';
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* The QR Code error correction levels.
|
|
303
|
+
*
|
|
304
|
+
* * `"L"`—Approximately 7% of the codewords can be restored.
|
|
305
|
+
* * `"M"`—Approximately 15% of the codewords can be restored.
|
|
306
|
+
* * `"Q"`—Approximately 25% of the codewords can be restored.
|
|
307
|
+
* * `"H"`—Approximately 30% of the codewords can be restored.
|
|
308
|
+
*/
|
|
309
|
+
export declare type QRCodeErrorCorrection = 'L' | 'M' | 'Q' | 'H';
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* The image overlay configuration of the QR Code.
|
|
313
|
+
*/
|
|
314
|
+
export declare interface QRCodeOverlay {
|
|
315
|
+
/**
|
|
316
|
+
* The overlay height in pixels.
|
|
317
|
+
*/
|
|
318
|
+
height?: number;
|
|
319
|
+
/**
|
|
320
|
+
* The source image for the overlay.
|
|
321
|
+
*
|
|
322
|
+
* Required only when `type` is set to `'image'`.
|
|
323
|
+
*/
|
|
324
|
+
imageUrl?: string;
|
|
325
|
+
/**
|
|
326
|
+
* The overlay type.
|
|
327
|
+
*
|
|
328
|
+
* @default 'image'
|
|
329
|
+
*/
|
|
330
|
+
type?: 'image' | 'swiss';
|
|
331
|
+
/**
|
|
332
|
+
* The overlay width in pixels.
|
|
333
|
+
*/
|
|
334
|
+
width?: number;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Represents the props of the [KendoReact QRCode component]({% slug overview_qrcode_barcodes %}).
|
|
339
|
+
*/
|
|
340
|
+
export declare interface QRCodeProps extends BaseBarcodeProps {
|
|
341
|
+
/**
|
|
342
|
+
* The background color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
|
|
343
|
+
*
|
|
344
|
+
* @default "white"
|
|
345
|
+
*/
|
|
346
|
+
background?: string;
|
|
347
|
+
/**
|
|
348
|
+
* The border of the QR Code.
|
|
349
|
+
*/
|
|
350
|
+
border?: Border;
|
|
351
|
+
/**
|
|
352
|
+
* The color of the QR Code. Accepts a valid CSS color string, including hex and rgb.
|
|
353
|
+
*
|
|
354
|
+
* @default "black"
|
|
355
|
+
*/
|
|
356
|
+
color?: string;
|
|
357
|
+
/**
|
|
358
|
+
* The encoding mode used to encode the value.
|
|
359
|
+
*
|
|
360
|
+
* > **Important** The UTF-8 encoding is not included in the specifications and is not supported by all readers.
|
|
361
|
+
*
|
|
362
|
+
* The possible values are:
|
|
363
|
+
* * `"ISO_8859_1"`—Supports all characters from the [ISO/IEC 8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1) character set.
|
|
364
|
+
* * `"UTF_8"`—Supports all [Unicode](https://en.wikipedia.org/wiki/List_of_Unicode_characters) characters.
|
|
365
|
+
*
|
|
366
|
+
* @default "ISO_8859_1"
|
|
367
|
+
*/
|
|
368
|
+
encoding?: QRCodeEncoding;
|
|
369
|
+
/**
|
|
370
|
+
* The error correction level to use.
|
|
371
|
+
*
|
|
372
|
+
* The possible values are:
|
|
373
|
+
* * `"L"`—Approximately 7% of the codewords can be restored.
|
|
374
|
+
* * `"M"`—Approximately 15% of the codewords can be restored.
|
|
375
|
+
* * `"Q"`—Approximately 25% of the codewords can be restored.
|
|
376
|
+
* * `"H"`—Approximately 30% of the codewords can be restored.
|
|
377
|
+
*
|
|
378
|
+
* @default "L"
|
|
379
|
+
*/
|
|
380
|
+
errorCorrection?: QRCodeErrorCorrection;
|
|
381
|
+
/**
|
|
382
|
+
* An optional image overlay that will placed over the QR Code.
|
|
383
|
+
*
|
|
384
|
+
* > **Note** Always test if the code reads correctly with the applied overlay.
|
|
385
|
+
* > 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"`.
|
|
386
|
+
*/
|
|
387
|
+
overlay?: QRCodeOverlay;
|
|
388
|
+
/**
|
|
389
|
+
* The padding of the QR Code. A numeric value sets all paddings.
|
|
390
|
+
*
|
|
391
|
+
* @default 0
|
|
392
|
+
*/
|
|
393
|
+
padding?: number;
|
|
394
|
+
/**
|
|
395
|
+
* Specifies the size of a QR Code. Numeric values are treated as pixels.
|
|
396
|
+
*
|
|
397
|
+
* If no size is specified, the size will be determined from the element width and height.
|
|
398
|
+
* If the element has width or height of zero, a default value of 200 pixels will be used.
|
|
399
|
+
*
|
|
400
|
+
* @default "200px"
|
|
401
|
+
*/
|
|
402
|
+
size?: number | string;
|
|
403
|
+
/**
|
|
404
|
+
* The value of the QR Code.
|
|
405
|
+
*/
|
|
406
|
+
value: number | string;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Sets the rendering mode of the component.
|
|
411
|
+
*
|
|
412
|
+
* The supported values are:
|
|
413
|
+
* * `"canvas"`—Renders the component as a Canvas element.
|
|
414
|
+
* * `"svg"`—Renders the component as an inline SVG document.
|
|
415
|
+
*/
|
|
416
|
+
export declare type RenderMode = 'svg' | 'canvas';
|
|
417
|
+
|
|
418
|
+
export { }
|