smart-webcomponents-react 13.1.1 → 13.1.26
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/alertwindow/alertwindow.d.ts +10 -0
- package/alertwindow/alertwindow.esm.js +23 -1
- package/alertwindow/alertwindow.umd.js +23 -1
- package/barcode/barcode.d.ts +4 -2
- package/datetimepicker/datetimepicker.d.ts +8 -0
- package/datetimepicker/datetimepicker.esm.js +55 -0
- package/datetimepicker/datetimepicker.umd.js +860 -805
- package/dialogwindow/dialogwindow.d.ts +10 -0
- package/dialogwindow/dialogwindow.esm.js +23 -1
- package/dialogwindow/dialogwindow.umd.js +23 -1
- package/dockinglayout/dockinglayout.d.ts +6 -0
- package/dockinglayout/dockinglayout.esm.js +15 -0
- package/dockinglayout/dockinglayout.umd.js +15 -0
- package/grid/grid.d.ts +16 -1
- package/grid/grid.esm.js +29 -0
- package/grid/grid.umd.js +29 -0
- package/index.d.ts +225 -7
- package/kanban/kanban.d.ts +26 -1
- package/kanban/kanban.esm.js +56 -1
- package/kanban/kanban.umd.js +56 -1
- package/layout/dockinglayout.d.ts +6 -0
- package/multilinewindow/multilinewindow.d.ts +10 -0
- package/multilinewindow/multilinewindow.esm.js +23 -1
- package/multilinewindow/multilinewindow.umd.js +23 -1
- package/package.json +1 -1
- package/progresswindow/progresswindow.d.ts +10 -0
- package/progresswindow/progresswindow.esm.js +23 -1
- package/progresswindow/progresswindow.umd.js +23 -1
- package/promptwindow/promptwindow.d.ts +10 -0
- package/promptwindow/promptwindow.esm.js +23 -1
- package/promptwindow/promptwindow.umd.js +23 -1
- package/qrcode/package.json +7 -0
- package/qrcode/qrcode.d.ts +141 -0
- package/qrcode/qrcode.esm.js +376 -0
- package/qrcode/qrcode.umd.js +387 -0
- package/source/modules/smart.accordion.js +1 -1
- package/source/modules/smart.array.js +1 -1
- package/source/modules/smart.barcode.js +2 -2
- package/source/modules/smart.breadcrumb.js +1 -1
- package/source/modules/smart.button.js +1 -1
- package/source/modules/smart.buttongroup.js +1 -1
- package/source/modules/smart.calendar.js +2 -2
- package/source/modules/smart.card.js +1 -1
- package/source/modules/smart.cardview.js +5 -5
- package/source/modules/smart.carousel.js +1 -1
- package/source/modules/smart.chart.js +2 -2
- package/source/modules/smart.checkbox.js +1 -1
- package/source/modules/smart.checkinput.js +1 -1
- package/source/modules/smart.chip.js +1 -1
- package/source/modules/smart.colorinput.js +1 -1
- package/source/modules/smart.colorpanel.js +1 -1
- package/source/modules/smart.colorpicker.js +1 -1
- package/source/modules/smart.combobox.js +1 -1
- package/source/modules/smart.common.js +3 -3
- package/source/modules/smart.countryinput.js +1 -1
- package/source/modules/smart.dateinput.js +3 -3
- package/source/modules/smart.daterangeinput.js +3 -3
- package/source/modules/smart.datetimepicker.js +3 -3
- package/source/modules/smart.dockinglayout.js +4 -4
- package/source/modules/smart.dropdownbutton.js +1 -1
- package/source/modules/smart.dropdownlist.js +1 -1
- package/source/modules/smart.editor.js +3 -3
- package/source/modules/smart.element.js +1 -1
- package/source/modules/smart.fileupload.js +1 -1
- package/source/modules/smart.form.js +1 -1
- package/source/modules/smart.formulaparser.js +1 -1
- package/source/modules/smart.ganttchart.js +7 -7
- package/source/modules/smart.gauge.js +2 -2
- package/source/modules/smart.grid.js +16 -16
- package/source/modules/smart.gridpanel.js +5 -5
- package/source/modules/smart.input.js +1 -1
- package/source/modules/smart.kanban.js +6 -6
- package/source/modules/smart.layout.js +1 -1
- package/source/modules/smart.led.js +1 -1
- package/source/modules/smart.listbox.js +1 -1
- package/source/modules/smart.listmenu.js +1 -1
- package/source/modules/smart.map.js +1 -1
- package/source/modules/smart.maskedtextbox.js +1 -1
- package/source/modules/smart.menu.js +1 -1
- package/source/modules/smart.multicomboinput.js +1 -1
- package/source/modules/smart.multiinput.js +1 -1
- package/source/modules/smart.multilinetextbox.js +1 -1
- package/source/modules/smart.multisplitbutton.js +1 -1
- package/source/modules/smart.numberinput.js +1 -1
- package/source/modules/smart.numerictextbox.js +1 -1
- package/source/modules/smart.pager.js +1 -1
- package/source/modules/smart.passwordinput.js +1 -1
- package/source/modules/smart.passwordtextbox.js +1 -1
- package/source/modules/smart.path.js +1 -1
- package/source/modules/smart.phoneinput.js +1 -1
- package/source/modules/smart.pivottable.js +6 -6
- package/source/modules/smart.progressbar.js +1 -1
- package/source/modules/smart.qrcode.js +117 -0
- package/source/modules/smart.querybuilder.js +3 -3
- package/source/modules/smart.radiobutton.js +1 -1
- package/source/modules/smart.rating.js +1 -1
- package/source/modules/smart.router.js +2 -2
- package/source/modules/smart.scheduler.js +5 -5
- package/source/modules/smart.scrollbar.js +1 -1
- package/source/modules/smart.slider.js +2 -2
- package/source/modules/smart.sortable.js +1 -1
- package/source/modules/smart.splitter.js +1 -1
- package/source/modules/smart.switchbutton.js +1 -1
- package/source/modules/smart.table.js +5 -5
- package/source/modules/smart.tabs.js +2 -2
- package/source/modules/smart.tank.js +2 -2
- package/source/modules/smart.textarea.js +1 -1
- package/source/modules/smart.textbox.js +1 -1
- package/source/modules/smart.timeinput.js +1 -1
- package/source/modules/smart.timepicker.js +1 -1
- package/source/modules/smart.toast.js +1 -1
- package/source/modules/smart.tooltip.js +1 -1
- package/source/modules/smart.tree.js +2 -2
- package/source/modules/smart.validator.js +1 -1
- package/source/modules/smart.window.js +2 -2
- package/source/smart.accordion.js +1 -1
- package/source/smart.ajax.js +1 -1
- package/source/smart.array.js +1 -1
- package/source/smart.barcode.js +2 -2
- package/source/smart.bootstrap.js +1 -1
- package/source/smart.breadcrumb.js +1 -1
- package/source/smart.button.js +1 -1
- package/source/smart.buttongroup.js +1 -1
- package/source/smart.calendar.js +1 -1
- package/source/smart.card.js +1 -1
- package/source/smart.cardview.js +1 -1
- package/source/smart.carousel.js +1 -1
- package/source/smart.chart.annotations.js +1 -1
- package/source/smart.chart.api.js +1 -1
- package/source/smart.chart.core.js +1 -1
- package/source/smart.chart.js +1 -1
- package/source/smart.chart.rangeselector.js +1 -1
- package/source/smart.chart.waterfall.js +1 -1
- package/source/smart.checkbox.js +1 -1
- package/source/smart.checkinput.js +1 -1
- package/source/smart.chip.js +1 -1
- package/source/smart.colorinput.js +1 -1
- package/source/smart.colorpanel.js +1 -1
- package/source/smart.colorpicker.js +1 -1
- package/source/smart.combobox.js +1 -1
- package/source/smart.complex.js +1 -1
- package/source/smart.core.js +1 -1
- package/source/smart.countryinput.js +1 -1
- package/source/smart.data.js +2 -2
- package/source/smart.date.js +2 -2
- package/source/smart.dateformatpanel.js +1 -1
- package/source/smart.dateinput.js +2 -2
- package/source/smart.daterangeinput.js +1 -1
- package/source/smart.datetimepicker.js +2 -2
- package/source/smart.dockinglayout.js +2 -2
- package/source/smart.draw.js +1 -1
- package/source/smart.dropdownbutton.js +1 -1
- package/source/smart.dropdownlist.js +1 -1
- package/source/smart.editor.js +2 -2
- package/source/smart.element.js +1 -1
- package/source/smart.elements.js +21 -21
- package/source/smart.export.js +1 -1
- package/source/smart.fileupload.js +1 -1
- package/source/smart.filter.js +1 -1
- package/source/smart.filterbuilder.js +1 -1
- package/source/smart.filterpanel.js +1 -1
- package/source/smart.form.js +1 -1
- package/source/smart.format.js +1 -1
- package/source/smart.formulaparser.js +1 -1
- package/source/smart.ganttchart.js +1 -1
- package/source/smart.gauge.js +1 -1
- package/source/smart.grid.cell.js +2 -2
- package/source/smart.grid.chart.js +1 -1
- package/source/smart.grid.column.js +2 -2
- package/source/smart.grid.core.js +2 -2
- package/source/smart.grid.dialog.js +2 -2
- package/source/smart.grid.edit.js +2 -2
- package/source/smart.grid.export.js +1 -1
- package/source/smart.grid.filter.js +2 -2
- package/source/smart.grid.group.js +1 -1
- package/source/smart.grid.js +1 -1
- package/source/smart.grid.menu.js +1 -1
- package/source/smart.grid.pager.js +1 -1
- package/source/smart.grid.reorder.js +2 -2
- package/source/smart.grid.resize.js +1 -1
- package/source/smart.grid.row.js +1 -1
- package/source/smart.grid.select.js +2 -2
- package/source/smart.grid.sort.js +2 -2
- package/source/smart.grid.toolbar.js +1 -1
- package/source/smart.grid.tree.js +1 -1
- package/source/smart.grid.view.js +2 -2
- package/source/smart.gridpanel.js +1 -1
- package/source/smart.input.js +1 -1
- package/source/smart.kanban.js +2 -2
- package/source/smart.layout.js +1 -1
- package/source/smart.led.js +1 -1
- package/source/smart.listbox.js +1 -1
- package/source/smart.listmenu.js +1 -1
- package/source/smart.map.js +1 -1
- package/source/smart.maskedtextbox.js +1 -1
- package/source/smart.math.js +1 -1
- package/source/smart.menu.js +1 -1
- package/source/smart.multicomboinput.js +1 -1
- package/source/smart.multiinput.js +1 -1
- package/source/smart.multilinetextbox.js +1 -1
- package/source/smart.multisplitbutton.js +1 -1
- package/source/smart.numberformatpanel.js +1 -1
- package/source/smart.numberinput.js +1 -1
- package/source/smart.numeric.js +1 -1
- package/source/smart.numerictextbox.js +1 -1
- package/source/smart.pager.js +1 -1
- package/source/smart.passwordinput.js +1 -1
- package/source/smart.passwordtextbox.js +1 -1
- package/source/smart.path.js +1 -1
- package/source/smart.phoneinput.js +1 -1
- package/source/smart.pivottable.js +1 -1
- package/source/smart.powerbutton.js +1 -1
- package/source/smart.progressbar.js +1 -1
- package/source/smart.qrcode.js +6 -0
- package/source/smart.radiobutton.js +1 -1
- package/source/smart.rating.js +1 -1
- package/source/smart.router.js +1 -1
- package/source/smart.scheduler.js +1 -1
- package/source/smart.scrollbar.js +1 -1
- package/source/smart.slider.js +1 -1
- package/source/smart.sortable.js +1 -1
- package/source/smart.splitter.js +1 -1
- package/source/smart.switchbutton.js +1 -1
- package/source/smart.table.js +2 -2
- package/source/smart.tabs.js +2 -2
- package/source/smart.tank.js +1 -1
- package/source/smart.textarea.js +1 -1
- package/source/smart.textbox.js +1 -1
- package/source/smart.tickintervalhandler.js +1 -1
- package/source/smart.timeinput.js +1 -1
- package/source/smart.timepicker.js +1 -1
- package/source/smart.toast.js +1 -1
- package/source/smart.tooltip.js +1 -1
- package/source/smart.tree.js +2 -2
- package/source/smart.validationpanel.js +1 -1
- package/source/smart.validator.js +1 -1
- package/source/smart.window.js +2 -2
- package/source/styles/components/smart.base.css +1 -1
- package/source/styles/components/smart.grid.css +1 -1
- package/source/styles/components/smart.kanban.css +1 -1
- package/source/styles/default/scss/smart.grid.scss +13 -17
- package/source/styles/default/scss/smart.kanban.scss +289 -233
- package/source/styles/default/scss/smart.qrcode.scss +6 -0
- package/source/styles/default/smart.grid.css +15 -16
- package/source/styles/default/smart.kanban.css +247 -200
- package/source/styles/default/smart.qrcode.css +6 -0
- package/source/styles/default/smart.variables.css +2 -2
- package/source/styles/smart.default.css +3 -3
- package/source/typescript/smart.barcode.d.ts +4 -2
- package/source/typescript/smart.datetimepicker.d.ts +10 -0
- package/source/typescript/smart.dockinglayout.d.ts +7 -0
- package/source/typescript/smart.elements.d.ts +225 -7
- package/source/typescript/smart.grid.d.ts +18 -1
- package/source/typescript/smart.kanban.d.ts +27 -2
- package/source/typescript/smart.qrcode.d.ts +134 -0
- package/source/typescript/smart.tree.d.ts +17 -2
- package/source/typescript/smart.window.d.ts +10 -0
- package/tabs/tabswindow.d.ts +10 -0
- package/tabswindow/tabswindow.d.ts +10 -0
- package/tabswindow/tabswindow.esm.js +23 -1
- package/tabswindow/tabswindow.umd.js +23 -1
- package/timepicker/datetimepicker.d.ts +8 -0
- package/tree/tree.d.ts +14 -2
- package/tree/tree.esm.js +45 -2
- package/tree/tree.umd.js +45 -2
- package/waitwindow/waitwindow.d.ts +10 -0
- package/waitwindow/waitwindow.esm.js +23 -1
- package/waitwindow/waitwindow.umd.js +23 -1
- package/window/alertwindow.d.ts +10 -0
- package/window/dialogwindow.d.ts +10 -0
- package/window/multilinewindow.d.ts +10 -0
- package/window/progresswindow.d.ts +10 -0
- package/window/promptwindow.d.ts +10 -0
- package/window/tabswindow.d.ts +10 -0
- package/window/waitwindow.d.ts +10 -0
- package/window/window.d.ts +10 -0
- package/window/window.esm.js +23 -1
- package/window/window.umd.js +23 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { QRcodeProperties } from "./../index";
|
|
3
|
+
import { QRcodeLabelPosition, QRcodeRenderAs } from './../index';
|
|
4
|
+
export { QRcodeProperties } from "./../index";
|
|
5
|
+
export { QRcodeLabelPosition, QRcodeRenderAs } from './../index';
|
|
6
|
+
export declare const Smart: any;
|
|
7
|
+
export interface QRcodeProps extends QRcodeProperties {
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
onInvalid?: ((event?: Event) => void) | undefined;
|
|
11
|
+
onCreate?: ((event?: Event) => void) | undefined;
|
|
12
|
+
onReady?: ((event?: Event) => void) | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
QR Codes encode text values in a two-dimensional pattern.
|
|
16
|
+
*/
|
|
17
|
+
export declare class QRcode extends React.Component<React.HTMLAttributes<Element> & QRcodeProps, any> {
|
|
18
|
+
private _id;
|
|
19
|
+
private nativeElement;
|
|
20
|
+
private componentRef;
|
|
21
|
+
get id(): string;
|
|
22
|
+
/** Sets the background color of the QR Code element.
|
|
23
|
+
* Property type: string
|
|
24
|
+
*/
|
|
25
|
+
get backgroundColor(): string;
|
|
26
|
+
set backgroundColor(value: string);
|
|
27
|
+
/** Sets whether the QR Code label is visible.
|
|
28
|
+
* Property type: boolean
|
|
29
|
+
*/
|
|
30
|
+
get disaplyLabel(): boolean;
|
|
31
|
+
set disaplyLabel(value: boolean);
|
|
32
|
+
/** Sets an embedded image.
|
|
33
|
+
* Property type: string
|
|
34
|
+
*/
|
|
35
|
+
get embedImage(): string;
|
|
36
|
+
set embedImage(value: string);
|
|
37
|
+
/** Sets the height of the embedded image.
|
|
38
|
+
* Property type: number
|
|
39
|
+
*/
|
|
40
|
+
get imageHeight(): number;
|
|
41
|
+
set imageHeight(value: number);
|
|
42
|
+
/** Sets the width of the embedded image.
|
|
43
|
+
* Property type: number
|
|
44
|
+
*/
|
|
45
|
+
get imageWidth(): number;
|
|
46
|
+
set imageWidth(value: number);
|
|
47
|
+
/** Sets the color of the QR Code label.
|
|
48
|
+
* Property type: string
|
|
49
|
+
*/
|
|
50
|
+
get labelCOlor(): string;
|
|
51
|
+
set labelCOlor(value: string);
|
|
52
|
+
/** Sets the font family of the QR Code label.
|
|
53
|
+
* Property type: string
|
|
54
|
+
*/
|
|
55
|
+
get labelFont(): string;
|
|
56
|
+
set labelFont(value: string);
|
|
57
|
+
/** Sets the font size of the QR Code label.
|
|
58
|
+
* Property type: number
|
|
59
|
+
*/
|
|
60
|
+
get labelFontSize(): number;
|
|
61
|
+
set labelFontSize(value: number);
|
|
62
|
+
/** Sets the bottom margin of the QR Code label.
|
|
63
|
+
* Property type: number
|
|
64
|
+
*/
|
|
65
|
+
get labelMarginBottom(): number;
|
|
66
|
+
set labelMarginBottom(value: number);
|
|
67
|
+
/** Sets the top margin of the QR Code label.
|
|
68
|
+
* Property type: number
|
|
69
|
+
*/
|
|
70
|
+
get labelMarginTop(): number;
|
|
71
|
+
set labelMarginTop(value: number);
|
|
72
|
+
/** Sets the position of the QR Code label.
|
|
73
|
+
* Property type: QRcodeLabelPosition
|
|
74
|
+
*/
|
|
75
|
+
get labelPosition(): QRcodeLabelPosition;
|
|
76
|
+
set labelPosition(value: QRcodeLabelPosition);
|
|
77
|
+
/** Sets the color of the QR Code lines.
|
|
78
|
+
* Property type: string
|
|
79
|
+
*/
|
|
80
|
+
get lineColor(): string;
|
|
81
|
+
set lineColor(value: string);
|
|
82
|
+
/** Sets the width of the QR Code square.
|
|
83
|
+
* Property type: number
|
|
84
|
+
*/
|
|
85
|
+
get squareWidth(): number;
|
|
86
|
+
set squareWidth(value: number);
|
|
87
|
+
/** Sets the rendering mode of the QR Code.
|
|
88
|
+
* Property type: QRcodeRenderAs
|
|
89
|
+
*/
|
|
90
|
+
get renderAs(): QRcodeRenderAs;
|
|
91
|
+
set renderAs(value: QRcodeRenderAs);
|
|
92
|
+
/** Sets or gets the value of the QR Code.
|
|
93
|
+
* Property type: string
|
|
94
|
+
*/
|
|
95
|
+
get value(): string;
|
|
96
|
+
set value(value: string);
|
|
97
|
+
get properties(): string[];
|
|
98
|
+
/** This event is triggered when the value of the QR Code is invalid.
|
|
99
|
+
* @param event. The custom event. Custom event was created with: event.detail( invalidCharacters, lengthValidity, patternValidity, value)
|
|
100
|
+
* invalidCharacters - An array indicating the invalid characters.
|
|
101
|
+
* lengthValidity - A boolean indicating the length validity.
|
|
102
|
+
* patternValidity - A boolean indicating the pattern validity.
|
|
103
|
+
* value - the invalid value of the QR Code.
|
|
104
|
+
*/
|
|
105
|
+
onInvalid?: ((event?: Event) => void) | undefined;
|
|
106
|
+
/** This event occurs, when the React component is created.
|
|
107
|
+
* @param event. The custom event. */
|
|
108
|
+
onCreate?: ((event?: Event) => void) | undefined;
|
|
109
|
+
/** This event occurs, when the React component is completely rendered.
|
|
110
|
+
* @param event. The custom event. */
|
|
111
|
+
onReady?: ((event?: Event) => void) | undefined;
|
|
112
|
+
get eventListeners(): string[];
|
|
113
|
+
/** Exports the QR Code.
|
|
114
|
+
* @param {string} format. The format of the exported file - svg, png, jpg
|
|
115
|
+
* @param {string} fileName?. The name of the exported file
|
|
116
|
+
*/
|
|
117
|
+
export(format: string, fileName?: string): void;
|
|
118
|
+
/** Gets the base64 string of the QR Code
|
|
119
|
+
* @param {string} format. The dataURL format of the string - svg, png, jpg
|
|
120
|
+
* @returns {string}
|
|
121
|
+
*/
|
|
122
|
+
getDataURL(format: string): Promise<any>;
|
|
123
|
+
/** Gets the base64 string of the QR Code
|
|
124
|
+
* @param {string} format. The dataURL format of the string - svg, png, jpg
|
|
125
|
+
* @returns {any}
|
|
126
|
+
*/
|
|
127
|
+
getDataURLAsync(format: string): Promise<any>;
|
|
128
|
+
/** Gets the validity of the QR Code
|
|
129
|
+
* @returns {boolean}
|
|
130
|
+
*/
|
|
131
|
+
isValid(): Promise<any>;
|
|
132
|
+
constructor(props: any);
|
|
133
|
+
componentDidRender(initialize: boolean): void;
|
|
134
|
+
componentDidMount(): void;
|
|
135
|
+
componentDidUpdate(): void;
|
|
136
|
+
componentWillUnmount(): void;
|
|
137
|
+
render(): React.ReactElement<{
|
|
138
|
+
ref: any;
|
|
139
|
+
}, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
140
|
+
}
|
|
141
|
+
export default QRcode;
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
|
|
2
|
+
import '../source/modules/smart.qrcode';
|
|
3
|
+
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
/*! *****************************************************************************
|
|
7
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
9
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
10
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
13
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
14
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
15
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
16
|
+
|
|
17
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
18
|
+
and limitations under the License.
|
|
19
|
+
***************************************************************************** */
|
|
20
|
+
|
|
21
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const Smart = window.Smart;
|
|
32
|
+
/**
|
|
33
|
+
QR Codes encode text values in a two-dimensional pattern.
|
|
34
|
+
*/
|
|
35
|
+
class QRcode extends React.Component {
|
|
36
|
+
constructor(props) {
|
|
37
|
+
super(props);
|
|
38
|
+
this.componentRef = React.createRef();
|
|
39
|
+
}
|
|
40
|
+
// Gets the id of the React component.
|
|
41
|
+
get id() {
|
|
42
|
+
if (!this._id) {
|
|
43
|
+
this._id = 'QRcode' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
44
|
+
}
|
|
45
|
+
return this._id;
|
|
46
|
+
}
|
|
47
|
+
/** Sets the background color of the QR Code element.
|
|
48
|
+
* Property type: string
|
|
49
|
+
*/
|
|
50
|
+
get backgroundColor() {
|
|
51
|
+
return this.nativeElement ? this.nativeElement.backgroundColor : undefined;
|
|
52
|
+
}
|
|
53
|
+
set backgroundColor(value) {
|
|
54
|
+
if (this.nativeElement) {
|
|
55
|
+
this.nativeElement.backgroundColor = value;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Sets whether the QR Code label is visible.
|
|
59
|
+
* Property type: boolean
|
|
60
|
+
*/
|
|
61
|
+
get disaplyLabel() {
|
|
62
|
+
return this.nativeElement ? this.nativeElement.disaplyLabel : undefined;
|
|
63
|
+
}
|
|
64
|
+
set disaplyLabel(value) {
|
|
65
|
+
if (this.nativeElement) {
|
|
66
|
+
this.nativeElement.disaplyLabel = value;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** Sets an embedded image.
|
|
70
|
+
* Property type: string
|
|
71
|
+
*/
|
|
72
|
+
get embedImage() {
|
|
73
|
+
return this.nativeElement ? this.nativeElement.embedImage : undefined;
|
|
74
|
+
}
|
|
75
|
+
set embedImage(value) {
|
|
76
|
+
if (this.nativeElement) {
|
|
77
|
+
this.nativeElement.embedImage = value;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** Sets the height of the embedded image.
|
|
81
|
+
* Property type: number
|
|
82
|
+
*/
|
|
83
|
+
get imageHeight() {
|
|
84
|
+
return this.nativeElement ? this.nativeElement.imageHeight : undefined;
|
|
85
|
+
}
|
|
86
|
+
set imageHeight(value) {
|
|
87
|
+
if (this.nativeElement) {
|
|
88
|
+
this.nativeElement.imageHeight = value;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Sets the width of the embedded image.
|
|
92
|
+
* Property type: number
|
|
93
|
+
*/
|
|
94
|
+
get imageWidth() {
|
|
95
|
+
return this.nativeElement ? this.nativeElement.imageWidth : undefined;
|
|
96
|
+
}
|
|
97
|
+
set imageWidth(value) {
|
|
98
|
+
if (this.nativeElement) {
|
|
99
|
+
this.nativeElement.imageWidth = value;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Sets the color of the QR Code label.
|
|
103
|
+
* Property type: string
|
|
104
|
+
*/
|
|
105
|
+
get labelCOlor() {
|
|
106
|
+
return this.nativeElement ? this.nativeElement.labelCOlor : undefined;
|
|
107
|
+
}
|
|
108
|
+
set labelCOlor(value) {
|
|
109
|
+
if (this.nativeElement) {
|
|
110
|
+
this.nativeElement.labelCOlor = value;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/** Sets the font family of the QR Code label.
|
|
114
|
+
* Property type: string
|
|
115
|
+
*/
|
|
116
|
+
get labelFont() {
|
|
117
|
+
return this.nativeElement ? this.nativeElement.labelFont : undefined;
|
|
118
|
+
}
|
|
119
|
+
set labelFont(value) {
|
|
120
|
+
if (this.nativeElement) {
|
|
121
|
+
this.nativeElement.labelFont = value;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** Sets the font size of the QR Code label.
|
|
125
|
+
* Property type: number
|
|
126
|
+
*/
|
|
127
|
+
get labelFontSize() {
|
|
128
|
+
return this.nativeElement ? this.nativeElement.labelFontSize : undefined;
|
|
129
|
+
}
|
|
130
|
+
set labelFontSize(value) {
|
|
131
|
+
if (this.nativeElement) {
|
|
132
|
+
this.nativeElement.labelFontSize = value;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/** Sets the bottom margin of the QR Code label.
|
|
136
|
+
* Property type: number
|
|
137
|
+
*/
|
|
138
|
+
get labelMarginBottom() {
|
|
139
|
+
return this.nativeElement ? this.nativeElement.labelMarginBottom : undefined;
|
|
140
|
+
}
|
|
141
|
+
set labelMarginBottom(value) {
|
|
142
|
+
if (this.nativeElement) {
|
|
143
|
+
this.nativeElement.labelMarginBottom = value;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** Sets the top margin of the QR Code label.
|
|
147
|
+
* Property type: number
|
|
148
|
+
*/
|
|
149
|
+
get labelMarginTop() {
|
|
150
|
+
return this.nativeElement ? this.nativeElement.labelMarginTop : undefined;
|
|
151
|
+
}
|
|
152
|
+
set labelMarginTop(value) {
|
|
153
|
+
if (this.nativeElement) {
|
|
154
|
+
this.nativeElement.labelMarginTop = value;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** Sets the position of the QR Code label.
|
|
158
|
+
* Property type: QRcodeLabelPosition
|
|
159
|
+
*/
|
|
160
|
+
get labelPosition() {
|
|
161
|
+
return this.nativeElement ? this.nativeElement.labelPosition : undefined;
|
|
162
|
+
}
|
|
163
|
+
set labelPosition(value) {
|
|
164
|
+
if (this.nativeElement) {
|
|
165
|
+
this.nativeElement.labelPosition = value;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/** Sets the color of the QR Code lines.
|
|
169
|
+
* Property type: string
|
|
170
|
+
*/
|
|
171
|
+
get lineColor() {
|
|
172
|
+
return this.nativeElement ? this.nativeElement.lineColor : undefined;
|
|
173
|
+
}
|
|
174
|
+
set lineColor(value) {
|
|
175
|
+
if (this.nativeElement) {
|
|
176
|
+
this.nativeElement.lineColor = value;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/** Sets the width of the QR Code square.
|
|
180
|
+
* Property type: number
|
|
181
|
+
*/
|
|
182
|
+
get squareWidth() {
|
|
183
|
+
return this.nativeElement ? this.nativeElement.squareWidth : undefined;
|
|
184
|
+
}
|
|
185
|
+
set squareWidth(value) {
|
|
186
|
+
if (this.nativeElement) {
|
|
187
|
+
this.nativeElement.squareWidth = value;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/** Sets the rendering mode of the QR Code.
|
|
191
|
+
* Property type: QRcodeRenderAs
|
|
192
|
+
*/
|
|
193
|
+
get renderAs() {
|
|
194
|
+
return this.nativeElement ? this.nativeElement.renderAs : undefined;
|
|
195
|
+
}
|
|
196
|
+
set renderAs(value) {
|
|
197
|
+
if (this.nativeElement) {
|
|
198
|
+
this.nativeElement.renderAs = value;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** Sets or gets the value of the QR Code.
|
|
202
|
+
* Property type: string
|
|
203
|
+
*/
|
|
204
|
+
get value() {
|
|
205
|
+
return this.nativeElement ? this.nativeElement.value : undefined;
|
|
206
|
+
}
|
|
207
|
+
set value(value) {
|
|
208
|
+
if (this.nativeElement) {
|
|
209
|
+
this.nativeElement.value = value;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Gets the properties of the React component.
|
|
213
|
+
get properties() {
|
|
214
|
+
return ["backgroundColor", "disaplyLabel", "embedImage", "imageHeight", "imageWidth", "labelCOlor", "labelFont", "labelFontSize", "labelMarginBottom", "labelMarginTop", "labelPosition", "lineColor", "squareWidth", "renderAs", "value"];
|
|
215
|
+
}
|
|
216
|
+
// Gets the events of the React component.
|
|
217
|
+
get eventListeners() {
|
|
218
|
+
return ["onInvalid", "onCreate", "onReady"];
|
|
219
|
+
}
|
|
220
|
+
/** Exports the QR Code.
|
|
221
|
+
* @param {string} format. The format of the exported file - svg, png, jpg
|
|
222
|
+
* @param {string} fileName?. The name of the exported file
|
|
223
|
+
*/
|
|
224
|
+
export(format, fileName) {
|
|
225
|
+
if (this.nativeElement.isRendered) {
|
|
226
|
+
this.nativeElement.export(format, fileName);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
this.nativeElement.whenRendered(() => {
|
|
230
|
+
this.nativeElement.export(format, fileName);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/** Gets the base64 string of the QR Code
|
|
235
|
+
* @param {string} format. The dataURL format of the string - svg, png, jpg
|
|
236
|
+
* @returns {string}
|
|
237
|
+
*/
|
|
238
|
+
getDataURL(format) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
+
const getResultOnRender = () => {
|
|
241
|
+
return new Promise(resolve => {
|
|
242
|
+
this.nativeElement.whenRendered(() => {
|
|
243
|
+
const result = this.nativeElement.getDataURL(format);
|
|
244
|
+
resolve(result);
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
const result = yield getResultOnRender();
|
|
249
|
+
return result;
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
/** Gets the base64 string of the QR Code
|
|
253
|
+
* @param {string} format. The dataURL format of the string - svg, png, jpg
|
|
254
|
+
* @returns {any}
|
|
255
|
+
*/
|
|
256
|
+
getDataURLAsync(format) {
|
|
257
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
+
const getResultOnRender = () => {
|
|
259
|
+
return new Promise(resolve => {
|
|
260
|
+
this.nativeElement.whenRendered(() => {
|
|
261
|
+
const result = this.nativeElement.getDataURLAsync(format);
|
|
262
|
+
resolve(result);
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
const result = yield getResultOnRender();
|
|
267
|
+
return result;
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/** Gets the validity of the QR Code
|
|
271
|
+
* @returns {boolean}
|
|
272
|
+
*/
|
|
273
|
+
isValid() {
|
|
274
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
275
|
+
const getResultOnRender = () => {
|
|
276
|
+
return new Promise(resolve => {
|
|
277
|
+
this.nativeElement.whenRendered(() => {
|
|
278
|
+
const result = this.nativeElement.isValid();
|
|
279
|
+
resolve(result);
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
const result = yield getResultOnRender();
|
|
284
|
+
return result;
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
componentDidRender(initialize) {
|
|
288
|
+
const that = this;
|
|
289
|
+
const props = {};
|
|
290
|
+
const events = {};
|
|
291
|
+
let styles = null;
|
|
292
|
+
for (let prop in that.props) {
|
|
293
|
+
if (prop === 'children') {
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
if (prop === 'style') {
|
|
297
|
+
styles = that.props[prop];
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
if (prop.startsWith('on') && that.properties.indexOf(prop) === -1) {
|
|
301
|
+
events[prop] = that.props[prop];
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
props[prop] = that.props[prop];
|
|
305
|
+
}
|
|
306
|
+
if (initialize) {
|
|
307
|
+
that.nativeElement = this.componentRef.current;
|
|
308
|
+
}
|
|
309
|
+
for (let prop in props) {
|
|
310
|
+
if (prop === 'class') {
|
|
311
|
+
const classNames = props[prop].trim().split(' ');
|
|
312
|
+
for (let className in classNames) {
|
|
313
|
+
if (!that.nativeElement.classList.contains(classNames[className]) && classNames[className] !== "") {
|
|
314
|
+
that.nativeElement.classList.add(classNames[className]);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
if (props[prop] !== that.nativeElement[prop]) {
|
|
320
|
+
const normalizeProp = (str) => {
|
|
321
|
+
return str.replace(/-([a-z])/g, function (g) {
|
|
322
|
+
return g[1].toUpperCase();
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
if (prop === 'hover' || prop === 'active' || prop === 'focus' || prop === 'selected') {
|
|
326
|
+
that.nativeElement.setAttribute(prop, '');
|
|
327
|
+
}
|
|
328
|
+
const normalizedProp = normalizeProp(prop);
|
|
329
|
+
that.nativeElement[normalizedProp] = props[prop];
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
for (let eventName in events) {
|
|
333
|
+
that[eventName] = events[eventName];
|
|
334
|
+
that.nativeElement[eventName.toLowerCase()] = events[eventName];
|
|
335
|
+
}
|
|
336
|
+
if (initialize) {
|
|
337
|
+
if (that.onCreate) {
|
|
338
|
+
that.onCreate();
|
|
339
|
+
}
|
|
340
|
+
that.nativeElement.whenRendered(() => {
|
|
341
|
+
if (that.onReady) {
|
|
342
|
+
that.onReady();
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
// setup styles.
|
|
347
|
+
if (styles) {
|
|
348
|
+
for (let styleName in styles) {
|
|
349
|
+
that.nativeElement.style[styleName] = styles[styleName];
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
componentDidMount() {
|
|
354
|
+
this.componentDidRender(true);
|
|
355
|
+
}
|
|
356
|
+
componentDidUpdate() {
|
|
357
|
+
this.componentDidRender(false);
|
|
358
|
+
}
|
|
359
|
+
componentWillUnmount() {
|
|
360
|
+
const that = this;
|
|
361
|
+
if (!that.nativeElement) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
that.nativeElement.whenRenderedCallbacks = [];
|
|
365
|
+
for (let i = 0; i < that.eventListeners.length; i++) {
|
|
366
|
+
const eventName = that.eventListeners[i];
|
|
367
|
+
that.nativeElement.removeEventListener(eventName.substring(2).toLowerCase(), that[eventName]);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
render() {
|
|
371
|
+
return (React.createElement("smart-qrcode", { ref: this.componentRef }, this.props.children));
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export default QRcode;
|
|
376
|
+
export { Smart, QRcode };
|