smart-webcomponents-react 14.2.92 → 14.3.0
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 +5 -5
- package/alertwindow/alertwindow.esm.js +10 -85
- package/alertwindow/alertwindow.umd.js +1134 -1209
- package/array/array.d.ts +5 -5
- package/array/array.esm.js +13 -88
- package/array/array.umd.js +752 -827
- package/barcode/barcode.d.ts +3 -3
- package/barcode/barcode.esm.js +6 -61
- package/barcode/barcode.umd.js +311 -366
- package/button/dropdownbutton.d.ts +2 -2
- package/button/multisplitbutton.d.ts +2 -2
- package/calendar/calendar.d.ts +2 -2
- package/calendar/calendar.esm.js +4 -49
- package/calendar/calendar.umd.js +710 -755
- package/card/cardview.d.ts +1 -1
- package/cardview/cardview.d.ts +1 -1
- package/cardview/cardview.esm.js +2 -37
- package/cardview/cardview.umd.js +515 -550
- package/chart/chart.d.ts +9 -9
- package/chart/chart.esm.js +18 -133
- package/chart/chart.umd.js +822 -937
- package/chart/ganttchart.d.ts +20 -20
- package/combobox/combobox.d.ts +4 -4
- package/combobox/combobox.esm.js +8 -73
- package/combobox/combobox.umd.js +1341 -1406
- package/datetimepicker/datetimepicker.d.ts +1 -1
- package/datetimepicker/datetimepicker.esm.js +2 -37
- package/datetimepicker/datetimepicker.umd.js +826 -861
- package/dialogwindow/dialogwindow.d.ts +5 -5
- package/dialogwindow/dialogwindow.esm.js +10 -85
- package/dialogwindow/dialogwindow.umd.js +1134 -1209
- package/dockinglayout/dockinglayout.d.ts +7 -7
- package/dockinglayout/dockinglayout.esm.js +14 -109
- package/dockinglayout/dockinglayout.umd.js +765 -860
- package/dropdownbutton/dropdownbutton.d.ts +2 -2
- package/dropdownbutton/dropdownbutton.esm.js +4 -49
- package/dropdownbutton/dropdownbutton.umd.js +527 -572
- package/dropdownlist/dropdownlist.d.ts +4 -4
- package/dropdownlist/dropdownlist.esm.js +8 -73
- package/dropdownlist/dropdownlist.umd.js +1275 -1340
- package/editor/editor.d.ts +11 -9
- package/editor/editor.esm.js +14 -109
- package/editor/editor.umd.js +911 -1006
- package/fileupload/fileupload.d.ts +2 -1
- package/filterbuilder/filterbuilder.d.ts +1 -1
- package/filterbuilder/filterbuilder.esm.js +2 -37
- package/filterbuilder/filterbuilder.umd.js +463 -498
- package/filterpanel/filterpanel.d.ts +1 -1
- package/filterpanel/filterpanel.esm.js +2 -37
- package/filterpanel/filterpanel.umd.js +354 -389
- package/form/form.d.ts +1 -1
- package/form/form.esm.js +4 -49
- package/form/form.umd.js +1016 -1061
- package/form/formgroup.d.ts +1 -1
- package/ganttchart/ganttchart.d.ts +20 -20
- package/ganttchart/ganttchart.esm.js +40 -265
- package/ganttchart/ganttchart.umd.js +1666 -1891
- package/gauge/gauge.d.ts +2 -2
- package/gauge/gauge.esm.js +4 -49
- package/gauge/gauge.umd.js +664 -709
- package/grid/grid.d.ts +56 -51
- package/grid/grid.esm.js +96 -460
- package/grid/grid.umd.js +2107 -2471
- package/index.d.ts +45 -3
- package/input/input.d.ts +2 -2
- package/input/input.esm.js +4 -49
- package/input/input.umd.js +505 -550
- package/input/numberinput.d.ts +2 -2
- package/input/phoneinput.d.ts +4 -4
- package/kanban/kanban.d.ts +6 -6
- package/kanban/kanban.esm.js +12 -97
- package/kanban/kanban.umd.js +1334 -1419
- package/layout/dockinglayout.d.ts +7 -7
- package/listbox/listbox.d.ts +5 -5
- package/listbox/listbox.esm.js +10 -85
- package/listbox/listbox.umd.js +1170 -1245
- package/listmenu/listmenu.d.ts +1 -1
- package/listmenu/listmenu.esm.js +2 -37
- package/listmenu/listmenu.umd.js +1005 -1040
- package/menu/listmenu.d.ts +1 -1
- package/menu/menu.d.ts +1 -1
- package/menu/menu.esm.js +2 -37
- package/menu/menu.umd.js +1025 -1060
- package/multilinetextbox/multilinetextbox.d.ts +1 -1
- package/multilinetextbox/multilinetextbox.esm.js +2 -37
- package/multilinetextbox/multilinetextbox.umd.js +907 -942
- package/multilinewindow/multilinewindow.d.ts +5 -5
- package/multilinewindow/multilinewindow.esm.js +10 -85
- package/multilinewindow/multilinewindow.umd.js +1134 -1209
- package/multisplitbutton/multisplitbutton.d.ts +2 -2
- package/multisplitbutton/multisplitbutton.esm.js +4 -49
- package/multisplitbutton/multisplitbutton.umd.js +941 -986
- package/numberinput/numberinput.d.ts +2 -2
- package/numberinput/numberinput.esm.js +4 -49
- package/numberinput/numberinput.umd.js +348 -393
- package/numerictextbox/numerictextbox.d.ts +1 -1
- package/numerictextbox/numerictextbox.esm.js +2 -37
- package/numerictextbox/numerictextbox.umd.js +592 -627
- package/package.json +1 -1
- package/phoneinput/phoneinput.d.ts +4 -4
- package/phoneinput/phoneinput.esm.js +8 -73
- package/phoneinput/phoneinput.umd.js +386 -451
- package/pivottable/pivottable.d.ts +3 -3
- package/pivottable/pivottable.esm.js +6 -61
- package/pivottable/pivottable.umd.js +762 -817
- package/progresswindow/progresswindow.d.ts +5 -5
- package/progresswindow/progresswindow.esm.js +10 -85
- package/progresswindow/progresswindow.umd.js +1134 -1209
- package/promptwindow/promptwindow.d.ts +5 -5
- package/promptwindow/promptwindow.esm.js +10 -85
- package/promptwindow/promptwindow.umd.js +1134 -1209
- package/qrcode/qrcode.d.ts +3 -3
- package/qrcode/qrcode.esm.js +6 -61
- package/qrcode/qrcode.umd.js +333 -388
- package/querybuilder/querybuilder.d.ts +6 -1
- package/querybuilder/querybuilder.esm.js +14 -38
- package/querybuilder/querybuilder.umd.js +446 -470
- package/rating/rating.d.ts +1 -1
- package/rating/rating.esm.js +2 -37
- package/rating/rating.umd.js +261 -296
- package/scheduler/scheduler.d.ts +17 -17
- package/scheduler/scheduler.esm.js +34 -229
- package/scheduler/scheduler.umd.js +1782 -1977
- package/slider/slider.d.ts +2 -2
- package/slider/slider.esm.js +4 -49
- package/slider/slider.umd.js +642 -687
- package/source/modules/smart.accordion.js +1 -1
- package/source/modules/smart.array.js +2 -2
- package/source/modules/smart.barcode.js +1 -1
- 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 +3 -3
- package/source/modules/smart.carousel.js +1 -1
- package/source/modules/smart.chart.js +1 -1
- package/source/modules/smart.checkbox.js +1 -1
- package/source/modules/smart.checkinput.js +2 -2
- package/source/modules/smart.chip.js +1 -1
- package/source/modules/smart.colorinput.js +2 -2
- package/source/modules/smart.colorpanel.js +2 -2
- package/source/modules/smart.colorpicker.js +2 -2
- package/source/modules/smart.combobox.js +2 -2
- package/source/modules/smart.common.js +1 -1
- package/source/modules/smart.countryinput.js +2 -2
- package/source/modules/smart.dateinput.js +2 -2
- package/source/modules/smart.daterangeinput.js +3 -3
- package/source/modules/smart.datetimepicker.js +2 -2
- package/source/modules/smart.dockinglayout.js +1 -1
- package/source/modules/smart.dropdownbutton.js +1 -1
- package/source/modules/smart.dropdownlist.js +2 -2
- package/source/modules/smart.editor.js +5 -5
- package/source/modules/smart.element.js +1 -1
- package/source/modules/smart.fileupload.js +3 -3
- package/source/modules/smart.form.js +2 -2
- package/source/modules/smart.formulaparser.js +1 -1
- package/source/modules/smart.ganttchart.js +4 -4
- package/source/modules/smart.gauge.js +1 -1
- package/source/modules/smart.grid.js +9 -9
- package/source/modules/smart.gridpanel.js +3 -3
- package/source/modules/smart.input.js +2 -2
- package/source/modules/smart.kanban.js +4 -4
- package/source/modules/smart.layout.js +1 -1
- package/source/modules/smart.led.js +1 -1
- package/source/modules/smart.listbox.js +2 -2
- package/source/modules/smart.listmenu.js +1 -1
- package/source/modules/smart.map.js +1 -1
- package/source/modules/smart.maskedtextbox.js +2 -2
- package/source/modules/smart.menu.js +1 -1
- package/source/modules/smart.multicomboinput.js +2 -2
- package/source/modules/smart.multiinput.js +2 -2
- package/source/modules/smart.multilinetextbox.js +2 -2
- package/source/modules/smart.multisplitbutton.js +2 -2
- package/source/modules/smart.numberinput.js +2 -2
- package/source/modules/smart.numerictextbox.js +2 -2
- package/source/modules/smart.pager.js +2 -2
- package/source/modules/smart.passwordinput.js +2 -2
- package/source/modules/smart.passwordtextbox.js +2 -2
- package/source/modules/smart.path.js +1 -1
- package/source/modules/smart.phoneinput.js +2 -2
- package/source/modules/smart.pivottable.js +3 -3
- package/source/modules/smart.progressbar.js +1 -1
- package/source/modules/smart.qrcode.js +1 -1
- package/source/modules/smart.querybuilder.js +4 -4
- package/source/modules/smart.radiobutton.js +1 -1
- package/source/modules/smart.rating.js +1 -1
- package/source/modules/smart.router.js +1 -1
- package/source/modules/smart.scheduler.js +3 -3
- package/source/modules/smart.scrollbar.js +1 -1
- package/source/modules/smart.slider.js +1 -1
- 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 +3 -3
- package/source/modules/smart.tabs.js +1 -1
- package/source/modules/smart.tank.js +1 -1
- package/source/modules/smart.textarea.js +2 -2
- package/source/modules/smart.textbox.js +2 -2
- package/source/modules/smart.timeinput.js +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/source/smart.date.js +1 -1
- package/source/smart.dateformatpanel.js +1 -1
- package/source/smart.dateinput.js +1 -1
- package/source/smart.daterangeinput.js +1 -1
- package/source/smart.datetimepicker.js +1 -1
- package/source/smart.dockinglayout.js +1 -1
- 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 +13 -13
- package/source/smart.export.js +1 -1
- package/source/smart.fileupload.js +2 -2
- package/source/smart.filter.js +1 -1
- package/source/smart.filterbuilder.js +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/source/smart.grid.toolbar.js +1 -1
- package/source/smart.grid.tree.js +1 -1
- package/source/smart.grid.view.js +1 -1
- package/source/smart.gridpanel.js +1 -1
- package/source/smart.input.js +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- package/source/smart.tabs.js +1 -1
- 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 +1 -1
- package/source/smart.validationpanel.js +1 -1
- package/source/smart.validator.js +1 -1
- package/source/smart.window.js +1 -1
- package/source/typescript/smart.editor.d.ts +4 -2
- package/source/typescript/smart.elements.d.ts +45 -3
- package/source/typescript/smart.fileupload.d.ts +2 -1
- package/source/typescript/smart.grid.d.ts +34 -0
- package/source/typescript/smart.querybuilder.d.ts +5 -0
- package/splitter/splitter.d.ts +3 -3
- package/splitter/splitter.esm.js +6 -61
- package/splitter/splitter.umd.js +901 -956
- package/table/pivottable.d.ts +3 -3
- package/table/table.d.ts +7 -7
- package/table/table.esm.js +14 -109
- package/table/table.umd.js +1278 -1373
- package/tabs/tabs.d.ts +4 -4
- package/tabs/tabs.esm.js +8 -73
- package/tabs/tabs.umd.js +875 -940
- package/tabs/tabswindow.d.ts +5 -5
- package/tabswindow/tabswindow.d.ts +5 -5
- package/tabswindow/tabswindow.esm.js +10 -85
- package/tabswindow/tabswindow.umd.js +1134 -1209
- package/tank/tank.d.ts +2 -2
- package/tank/tank.esm.js +4 -49
- package/tank/tank.umd.js +598 -643
- package/textbox/multilinetextbox.d.ts +1 -1
- package/textbox/numerictextbox.d.ts +1 -1
- package/timepicker/datetimepicker.d.ts +1 -1
- package/toast/toast.d.ts +1 -1
- package/toast/toast.esm.js +2 -37
- package/toast/toast.umd.js +397 -432
- package/tree/tree.d.ts +4 -4
- package/tree/tree.esm.js +8 -73
- package/tree/tree.umd.js +1310 -1375
- package/waitwindow/waitwindow.d.ts +5 -5
- package/waitwindow/waitwindow.esm.js +10 -85
- package/waitwindow/waitwindow.umd.js +1134 -1209
- package/window/alertwindow.d.ts +5 -5
- package/window/dialogwindow.d.ts +5 -5
- package/window/multilinewindow.d.ts +5 -5
- package/window/progresswindow.d.ts +5 -5
- package/window/promptwindow.d.ts +5 -5
- package/window/tabswindow.d.ts +5 -5
- package/window/waitwindow.d.ts +5 -5
- package/window/window.d.ts +5 -5
- package/window/window.esm.js +10 -85
- package/window/window.umd.js +1134 -1209
package/qrcode/qrcode.umd.js
CHANGED
|
@@ -2,398 +2,343 @@
|
|
|
2
2
|
require('../source/modules/smart.qrcode');
|
|
3
3
|
|
|
4
4
|
(function (global, factory) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
6
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
7
|
+
(factory((global.qrcode = {}),global.React));
|
|
8
8
|
}(this, (function (exports,React) { 'use strict';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
React = React && React.hasOwnProperty('default') ? React['default'] : React;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
12
|
+
const Smart = window.Smart;
|
|
13
|
+
/**
|
|
14
|
+
QR Codes encode text values in a two-dimensional pattern.
|
|
15
|
+
*/
|
|
16
|
+
class QRcode extends React.Component {
|
|
17
|
+
constructor(props) {
|
|
18
|
+
super(props);
|
|
19
|
+
this.componentRef = React.createRef();
|
|
20
|
+
}
|
|
21
|
+
// Gets the id of the React component.
|
|
22
|
+
get id() {
|
|
23
|
+
if (!this._id) {
|
|
24
|
+
this._id = 'QRcode' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
25
|
+
}
|
|
26
|
+
return this._id;
|
|
27
|
+
}
|
|
28
|
+
/** Sets the background color of the QR Code element.
|
|
29
|
+
* Property type: string
|
|
30
|
+
*/
|
|
31
|
+
get backgroundColor() {
|
|
32
|
+
return this.nativeElement ? this.nativeElement.backgroundColor : undefined;
|
|
33
|
+
}
|
|
34
|
+
set backgroundColor(value) {
|
|
35
|
+
if (this.nativeElement) {
|
|
36
|
+
this.nativeElement.backgroundColor = value;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** Sets whether the QR Code label is visible.
|
|
40
|
+
* Property type: boolean
|
|
41
|
+
*/
|
|
42
|
+
get displayLabel() {
|
|
43
|
+
return this.nativeElement ? this.nativeElement.displayLabel : undefined;
|
|
44
|
+
}
|
|
45
|
+
set displayLabel(value) {
|
|
46
|
+
if (this.nativeElement) {
|
|
47
|
+
this.nativeElement.displayLabel = value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** Sets an embedded image.
|
|
51
|
+
* Property type: string
|
|
52
|
+
*/
|
|
53
|
+
get embedImage() {
|
|
54
|
+
return this.nativeElement ? this.nativeElement.embedImage : undefined;
|
|
55
|
+
}
|
|
56
|
+
set embedImage(value) {
|
|
57
|
+
if (this.nativeElement) {
|
|
58
|
+
this.nativeElement.embedImage = value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** Sets the error correction level.
|
|
62
|
+
* Property type: string
|
|
63
|
+
*/
|
|
64
|
+
get errorLevel() {
|
|
65
|
+
return this.nativeElement ? this.nativeElement.errorLevel : undefined;
|
|
66
|
+
}
|
|
67
|
+
set errorLevel(value) {
|
|
68
|
+
if (this.nativeElement) {
|
|
69
|
+
this.nativeElement.errorLevel = value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Sets the height of the embedded image.
|
|
73
|
+
* Property type: number
|
|
74
|
+
*/
|
|
75
|
+
get imageHeight() {
|
|
76
|
+
return this.nativeElement ? this.nativeElement.imageHeight : undefined;
|
|
77
|
+
}
|
|
78
|
+
set imageHeight(value) {
|
|
79
|
+
if (this.nativeElement) {
|
|
80
|
+
this.nativeElement.imageHeight = value;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** Sets the width of the embedded image.
|
|
84
|
+
* Property type: number
|
|
85
|
+
*/
|
|
86
|
+
get imageWidth() {
|
|
87
|
+
return this.nativeElement ? this.nativeElement.imageWidth : undefined;
|
|
88
|
+
}
|
|
89
|
+
set imageWidth(value) {
|
|
90
|
+
if (this.nativeElement) {
|
|
91
|
+
this.nativeElement.imageWidth = value;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** Sets the color of the QR Code label.
|
|
95
|
+
* Property type: string
|
|
96
|
+
*/
|
|
97
|
+
get labelColor() {
|
|
98
|
+
return this.nativeElement ? this.nativeElement.labelColor : undefined;
|
|
99
|
+
}
|
|
100
|
+
set labelColor(value) {
|
|
101
|
+
if (this.nativeElement) {
|
|
102
|
+
this.nativeElement.labelColor = value;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Sets the font family of the QR Code label.
|
|
106
|
+
* Property type: string
|
|
107
|
+
*/
|
|
108
|
+
get labelFont() {
|
|
109
|
+
return this.nativeElement ? this.nativeElement.labelFont : undefined;
|
|
110
|
+
}
|
|
111
|
+
set labelFont(value) {
|
|
112
|
+
if (this.nativeElement) {
|
|
113
|
+
this.nativeElement.labelFont = value;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Sets the font size of the QR Code label.
|
|
117
|
+
* Property type: number
|
|
118
|
+
*/
|
|
119
|
+
get labelFontSize() {
|
|
120
|
+
return this.nativeElement ? this.nativeElement.labelFontSize : undefined;
|
|
121
|
+
}
|
|
122
|
+
set labelFontSize(value) {
|
|
123
|
+
if (this.nativeElement) {
|
|
124
|
+
this.nativeElement.labelFontSize = value;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** Sets the bottom margin of the QR Code label.
|
|
128
|
+
* Property type: number
|
|
129
|
+
*/
|
|
130
|
+
get labelMarginBottom() {
|
|
131
|
+
return this.nativeElement ? this.nativeElement.labelMarginBottom : undefined;
|
|
132
|
+
}
|
|
133
|
+
set labelMarginBottom(value) {
|
|
134
|
+
if (this.nativeElement) {
|
|
135
|
+
this.nativeElement.labelMarginBottom = value;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** Sets the top margin of the QR Code label.
|
|
139
|
+
* Property type: number
|
|
140
|
+
*/
|
|
141
|
+
get labelMarginTop() {
|
|
142
|
+
return this.nativeElement ? this.nativeElement.labelMarginTop : undefined;
|
|
143
|
+
}
|
|
144
|
+
set labelMarginTop(value) {
|
|
145
|
+
if (this.nativeElement) {
|
|
146
|
+
this.nativeElement.labelMarginTop = value;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/** Sets the position of the QR Code label.
|
|
150
|
+
* Property type: QRcodeLabelPosition | string
|
|
151
|
+
*/
|
|
152
|
+
get labelPosition() {
|
|
153
|
+
return this.nativeElement ? this.nativeElement.labelPosition : undefined;
|
|
154
|
+
}
|
|
155
|
+
set labelPosition(value) {
|
|
156
|
+
if (this.nativeElement) {
|
|
157
|
+
this.nativeElement.labelPosition = value;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/** Sets the color of the QR Code lines.
|
|
161
|
+
* Property type: string
|
|
162
|
+
*/
|
|
163
|
+
get lineColor() {
|
|
164
|
+
return this.nativeElement ? this.nativeElement.lineColor : undefined;
|
|
165
|
+
}
|
|
166
|
+
set lineColor(value) {
|
|
167
|
+
if (this.nativeElement) {
|
|
168
|
+
this.nativeElement.lineColor = value;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/** Sets the width of the QR Code square.
|
|
172
|
+
* Property type: number
|
|
173
|
+
*/
|
|
174
|
+
get squareWidth() {
|
|
175
|
+
return this.nativeElement ? this.nativeElement.squareWidth : undefined;
|
|
176
|
+
}
|
|
177
|
+
set squareWidth(value) {
|
|
178
|
+
if (this.nativeElement) {
|
|
179
|
+
this.nativeElement.squareWidth = value;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/** Sets the rendering mode of the QR Code.
|
|
183
|
+
* Property type: QRcodeRenderAs | string
|
|
184
|
+
*/
|
|
185
|
+
get renderAs() {
|
|
186
|
+
return this.nativeElement ? this.nativeElement.renderAs : undefined;
|
|
187
|
+
}
|
|
188
|
+
set renderAs(value) {
|
|
189
|
+
if (this.nativeElement) {
|
|
190
|
+
this.nativeElement.renderAs = value;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/** Sets or gets the value of the QR Code.
|
|
194
|
+
* Property type: string
|
|
195
|
+
*/
|
|
196
|
+
get value() {
|
|
197
|
+
return this.nativeElement ? this.nativeElement.value : undefined;
|
|
198
|
+
}
|
|
199
|
+
set value(value) {
|
|
200
|
+
if (this.nativeElement) {
|
|
201
|
+
this.nativeElement.value = value;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// Gets the properties of the React component.
|
|
205
|
+
get properties() {
|
|
206
|
+
return ["backgroundColor", "displayLabel", "embedImage", "errorLevel", "imageHeight", "imageWidth", "labelColor", "labelFont", "labelFontSize", "labelMarginBottom", "labelMarginTop", "labelPosition", "lineColor", "squareWidth", "renderAs", "value"];
|
|
207
|
+
}
|
|
208
|
+
// Gets the events of the React component.
|
|
209
|
+
get eventListeners() {
|
|
210
|
+
return ["onInvalid", "onCreate", "onReady"];
|
|
211
|
+
}
|
|
212
|
+
/** Exports the QR Code.
|
|
213
|
+
* @param {string} format. The format of the exported file - svg, png, jpg
|
|
214
|
+
* @param {string} fileName?. The name of the exported file
|
|
215
|
+
*/
|
|
216
|
+
export(format, fileName) {
|
|
217
|
+
if (this.nativeElement.isRendered) {
|
|
218
|
+
this.nativeElement.export(format, fileName);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
this.nativeElement.whenRendered(() => {
|
|
222
|
+
this.nativeElement.export(format, fileName);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/** Gets the base64 string of the QR Code
|
|
227
|
+
* @param {string} format. The dataURL format of the string - svg, png, jpg
|
|
228
|
+
* @returns {string}
|
|
229
|
+
*/
|
|
230
|
+
getDataURL(format) {
|
|
231
|
+
const result = this.nativeElement.getDataURL(format);
|
|
232
|
+
return result;
|
|
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 {any}
|
|
237
|
+
*/
|
|
238
|
+
getDataURLAsync(format) {
|
|
239
|
+
const result = this.nativeElement.getDataURLAsync(format);
|
|
240
|
+
return result;
|
|
241
|
+
}
|
|
242
|
+
/** Gets the validity of the QR Code
|
|
243
|
+
* @returns {boolean}
|
|
244
|
+
*/
|
|
245
|
+
isValid() {
|
|
246
|
+
const result = this.nativeElement.isValid();
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
componentDidRender(initialize) {
|
|
250
|
+
const that = this;
|
|
251
|
+
const props = {};
|
|
252
|
+
const events = {};
|
|
253
|
+
let styles = null;
|
|
254
|
+
for (let prop in that.props) {
|
|
255
|
+
if (prop === 'children') {
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
if (prop === 'style') {
|
|
259
|
+
styles = that.props[prop];
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
if (prop.startsWith('on') && that.properties.indexOf(prop) === -1) {
|
|
263
|
+
events[prop] = that.props[prop];
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
props[prop] = that.props[prop];
|
|
267
|
+
}
|
|
268
|
+
if (initialize) {
|
|
269
|
+
that.nativeElement = this.componentRef.current;
|
|
270
|
+
}
|
|
271
|
+
for (let prop in props) {
|
|
272
|
+
if (prop === 'class' || prop === 'className') {
|
|
273
|
+
const classNames = props[prop].trim().split(' ');
|
|
274
|
+
for (let className in classNames) {
|
|
275
|
+
if (!that.nativeElement.classList.contains(classNames[className]) && classNames[className] !== "") {
|
|
276
|
+
that.nativeElement.classList.add(classNames[className]);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
if (props[prop] !== that.nativeElement[prop]) {
|
|
282
|
+
const normalizeProp = (str) => {
|
|
283
|
+
return str.replace(/-([a-z])/g, function (g) {
|
|
284
|
+
return g[1].toUpperCase();
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
if (prop === 'hover' || prop === 'active' || prop === 'focus' || prop === 'selected') {
|
|
288
|
+
that.nativeElement.setAttribute(prop, '');
|
|
289
|
+
}
|
|
290
|
+
const normalizedProp = normalizeProp(prop);
|
|
291
|
+
that.nativeElement[normalizedProp] = props[prop];
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
for (let eventName in events) {
|
|
295
|
+
that[eventName] = events[eventName];
|
|
296
|
+
that.nativeElement[eventName.toLowerCase()] = events[eventName];
|
|
297
|
+
}
|
|
298
|
+
if (initialize) {
|
|
299
|
+
Smart.Render();
|
|
300
|
+
if (that.onCreate) {
|
|
301
|
+
that.onCreate();
|
|
302
|
+
}
|
|
303
|
+
that.nativeElement.whenRendered(() => {
|
|
304
|
+
if (that.onReady) {
|
|
305
|
+
that.onReady();
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
// setup styles.
|
|
310
|
+
if (styles) {
|
|
311
|
+
for (let styleName in styles) {
|
|
312
|
+
that.nativeElement.style[styleName] = styles[styleName];
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
componentDidMount() {
|
|
317
|
+
this.componentDidRender(true);
|
|
318
|
+
}
|
|
319
|
+
componentDidUpdate() {
|
|
320
|
+
this.componentDidRender(false);
|
|
321
|
+
}
|
|
322
|
+
componentWillUnmount() {
|
|
323
|
+
const that = this;
|
|
324
|
+
if (!that.nativeElement) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
that.nativeElement.whenRenderedCallbacks = [];
|
|
328
|
+
for (let i = 0; i < that.eventListeners.length; i++) {
|
|
329
|
+
const eventName = that.eventListeners[i];
|
|
330
|
+
that.nativeElement.removeEventListener(eventName.substring(2).toLowerCase(), that[eventName]);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
render() {
|
|
334
|
+
return (React.createElement("smart-qrcode", { ref: this.componentRef }, this.props.children));
|
|
335
|
+
}
|
|
336
|
+
}
|
|
36
337
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
class QRcode extends React.Component {
|
|
42
|
-
constructor(props) {
|
|
43
|
-
super(props);
|
|
44
|
-
this.componentRef = React.createRef();
|
|
45
|
-
}
|
|
46
|
-
// Gets the id of the React component.
|
|
47
|
-
get id() {
|
|
48
|
-
if (!this._id) {
|
|
49
|
-
this._id = 'QRcode' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
50
|
-
}
|
|
51
|
-
return this._id;
|
|
52
|
-
}
|
|
53
|
-
/** Sets the background color of the QR Code element.
|
|
54
|
-
* Property type: string
|
|
55
|
-
*/
|
|
56
|
-
get backgroundColor() {
|
|
57
|
-
return this.nativeElement ? this.nativeElement.backgroundColor : undefined;
|
|
58
|
-
}
|
|
59
|
-
set backgroundColor(value) {
|
|
60
|
-
if (this.nativeElement) {
|
|
61
|
-
this.nativeElement.backgroundColor = value;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/** Sets whether the QR Code label is visible.
|
|
65
|
-
* Property type: boolean
|
|
66
|
-
*/
|
|
67
|
-
get displayLabel() {
|
|
68
|
-
return this.nativeElement ? this.nativeElement.displayLabel : undefined;
|
|
69
|
-
}
|
|
70
|
-
set displayLabel(value) {
|
|
71
|
-
if (this.nativeElement) {
|
|
72
|
-
this.nativeElement.displayLabel = value;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/** Sets an embedded image.
|
|
76
|
-
* Property type: string
|
|
77
|
-
*/
|
|
78
|
-
get embedImage() {
|
|
79
|
-
return this.nativeElement ? this.nativeElement.embedImage : undefined;
|
|
80
|
-
}
|
|
81
|
-
set embedImage(value) {
|
|
82
|
-
if (this.nativeElement) {
|
|
83
|
-
this.nativeElement.embedImage = value;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/** Sets the error correction level.
|
|
87
|
-
* Property type: string
|
|
88
|
-
*/
|
|
89
|
-
get errorLevel() {
|
|
90
|
-
return this.nativeElement ? this.nativeElement.errorLevel : undefined;
|
|
91
|
-
}
|
|
92
|
-
set errorLevel(value) {
|
|
93
|
-
if (this.nativeElement) {
|
|
94
|
-
this.nativeElement.errorLevel = value;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
/** Sets the height of the embedded image.
|
|
98
|
-
* Property type: number
|
|
99
|
-
*/
|
|
100
|
-
get imageHeight() {
|
|
101
|
-
return this.nativeElement ? this.nativeElement.imageHeight : undefined;
|
|
102
|
-
}
|
|
103
|
-
set imageHeight(value) {
|
|
104
|
-
if (this.nativeElement) {
|
|
105
|
-
this.nativeElement.imageHeight = value;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/** Sets the width of the embedded image.
|
|
109
|
-
* Property type: number
|
|
110
|
-
*/
|
|
111
|
-
get imageWidth() {
|
|
112
|
-
return this.nativeElement ? this.nativeElement.imageWidth : undefined;
|
|
113
|
-
}
|
|
114
|
-
set imageWidth(value) {
|
|
115
|
-
if (this.nativeElement) {
|
|
116
|
-
this.nativeElement.imageWidth = value;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
/** Sets the color of the QR Code label.
|
|
120
|
-
* Property type: string
|
|
121
|
-
*/
|
|
122
|
-
get labelColor() {
|
|
123
|
-
return this.nativeElement ? this.nativeElement.labelColor : undefined;
|
|
124
|
-
}
|
|
125
|
-
set labelColor(value) {
|
|
126
|
-
if (this.nativeElement) {
|
|
127
|
-
this.nativeElement.labelColor = value;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
/** Sets the font family of the QR Code label.
|
|
131
|
-
* Property type: string
|
|
132
|
-
*/
|
|
133
|
-
get labelFont() {
|
|
134
|
-
return this.nativeElement ? this.nativeElement.labelFont : undefined;
|
|
135
|
-
}
|
|
136
|
-
set labelFont(value) {
|
|
137
|
-
if (this.nativeElement) {
|
|
138
|
-
this.nativeElement.labelFont = value;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
/** Sets the font size of the QR Code label.
|
|
142
|
-
* Property type: number
|
|
143
|
-
*/
|
|
144
|
-
get labelFontSize() {
|
|
145
|
-
return this.nativeElement ? this.nativeElement.labelFontSize : undefined;
|
|
146
|
-
}
|
|
147
|
-
set labelFontSize(value) {
|
|
148
|
-
if (this.nativeElement) {
|
|
149
|
-
this.nativeElement.labelFontSize = value;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/** Sets the bottom margin of the QR Code label.
|
|
153
|
-
* Property type: number
|
|
154
|
-
*/
|
|
155
|
-
get labelMarginBottom() {
|
|
156
|
-
return this.nativeElement ? this.nativeElement.labelMarginBottom : undefined;
|
|
157
|
-
}
|
|
158
|
-
set labelMarginBottom(value) {
|
|
159
|
-
if (this.nativeElement) {
|
|
160
|
-
this.nativeElement.labelMarginBottom = value;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
/** Sets the top margin of the QR Code label.
|
|
164
|
-
* Property type: number
|
|
165
|
-
*/
|
|
166
|
-
get labelMarginTop() {
|
|
167
|
-
return this.nativeElement ? this.nativeElement.labelMarginTop : undefined;
|
|
168
|
-
}
|
|
169
|
-
set labelMarginTop(value) {
|
|
170
|
-
if (this.nativeElement) {
|
|
171
|
-
this.nativeElement.labelMarginTop = value;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
/** Sets the position of the QR Code label.
|
|
175
|
-
* Property type: QRcodeLabelPosition | string
|
|
176
|
-
*/
|
|
177
|
-
get labelPosition() {
|
|
178
|
-
return this.nativeElement ? this.nativeElement.labelPosition : undefined;
|
|
179
|
-
}
|
|
180
|
-
set labelPosition(value) {
|
|
181
|
-
if (this.nativeElement) {
|
|
182
|
-
this.nativeElement.labelPosition = value;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
/** Sets the color of the QR Code lines.
|
|
186
|
-
* Property type: string
|
|
187
|
-
*/
|
|
188
|
-
get lineColor() {
|
|
189
|
-
return this.nativeElement ? this.nativeElement.lineColor : undefined;
|
|
190
|
-
}
|
|
191
|
-
set lineColor(value) {
|
|
192
|
-
if (this.nativeElement) {
|
|
193
|
-
this.nativeElement.lineColor = value;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
/** Sets the width of the QR Code square.
|
|
197
|
-
* Property type: number
|
|
198
|
-
*/
|
|
199
|
-
get squareWidth() {
|
|
200
|
-
return this.nativeElement ? this.nativeElement.squareWidth : undefined;
|
|
201
|
-
}
|
|
202
|
-
set squareWidth(value) {
|
|
203
|
-
if (this.nativeElement) {
|
|
204
|
-
this.nativeElement.squareWidth = value;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
/** Sets the rendering mode of the QR Code.
|
|
208
|
-
* Property type: QRcodeRenderAs | string
|
|
209
|
-
*/
|
|
210
|
-
get renderAs() {
|
|
211
|
-
return this.nativeElement ? this.nativeElement.renderAs : undefined;
|
|
212
|
-
}
|
|
213
|
-
set renderAs(value) {
|
|
214
|
-
if (this.nativeElement) {
|
|
215
|
-
this.nativeElement.renderAs = value;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
/** Sets or gets the value of the QR Code.
|
|
219
|
-
* Property type: string
|
|
220
|
-
*/
|
|
221
|
-
get value() {
|
|
222
|
-
return this.nativeElement ? this.nativeElement.value : undefined;
|
|
223
|
-
}
|
|
224
|
-
set value(value) {
|
|
225
|
-
if (this.nativeElement) {
|
|
226
|
-
this.nativeElement.value = value;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
// Gets the properties of the React component.
|
|
230
|
-
get properties() {
|
|
231
|
-
return ["backgroundColor", "displayLabel", "embedImage", "errorLevel", "imageHeight", "imageWidth", "labelColor", "labelFont", "labelFontSize", "labelMarginBottom", "labelMarginTop", "labelPosition", "lineColor", "squareWidth", "renderAs", "value"];
|
|
232
|
-
}
|
|
233
|
-
// Gets the events of the React component.
|
|
234
|
-
get eventListeners() {
|
|
235
|
-
return ["onInvalid", "onCreate", "onReady"];
|
|
236
|
-
}
|
|
237
|
-
/** Exports the QR Code.
|
|
238
|
-
* @param {string} format. The format of the exported file - svg, png, jpg
|
|
239
|
-
* @param {string} fileName?. The name of the exported file
|
|
240
|
-
*/
|
|
241
|
-
export(format, fileName) {
|
|
242
|
-
if (this.nativeElement.isRendered) {
|
|
243
|
-
this.nativeElement.export(format, fileName);
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
this.nativeElement.whenRendered(() => {
|
|
247
|
-
this.nativeElement.export(format, fileName);
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
/** Gets the base64 string of the QR Code
|
|
252
|
-
* @param {string} format. The dataURL format of the string - svg, png, jpg
|
|
253
|
-
* @returns {string}
|
|
254
|
-
*/
|
|
255
|
-
getDataURL(format) {
|
|
256
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
257
|
-
const getResultOnRender = () => {
|
|
258
|
-
return new Promise(resolve => {
|
|
259
|
-
this.nativeElement.whenRendered(() => {
|
|
260
|
-
const result = this.nativeElement.getDataURL(format);
|
|
261
|
-
resolve(result);
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
};
|
|
265
|
-
const result = yield getResultOnRender();
|
|
266
|
-
return result;
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
/** Gets the base64 string of the QR Code
|
|
270
|
-
* @param {string} format. The dataURL format of the string - svg, png, jpg
|
|
271
|
-
* @returns {any}
|
|
272
|
-
*/
|
|
273
|
-
getDataURLAsync(format) {
|
|
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.getDataURLAsync(format);
|
|
279
|
-
resolve(result);
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
};
|
|
283
|
-
const result = yield getResultOnRender();
|
|
284
|
-
return result;
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
/** Gets the validity of the QR Code
|
|
288
|
-
* @returns {boolean}
|
|
289
|
-
*/
|
|
290
|
-
isValid() {
|
|
291
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
292
|
-
const getResultOnRender = () => {
|
|
293
|
-
return new Promise(resolve => {
|
|
294
|
-
this.nativeElement.whenRendered(() => {
|
|
295
|
-
const result = this.nativeElement.isValid();
|
|
296
|
-
resolve(result);
|
|
297
|
-
});
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
const result = yield getResultOnRender();
|
|
301
|
-
return result;
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
componentDidRender(initialize) {
|
|
305
|
-
const that = this;
|
|
306
|
-
const props = {};
|
|
307
|
-
const events = {};
|
|
308
|
-
let styles = null;
|
|
309
|
-
for (let prop in that.props) {
|
|
310
|
-
if (prop === 'children') {
|
|
311
|
-
continue;
|
|
312
|
-
}
|
|
313
|
-
if (prop === 'style') {
|
|
314
|
-
styles = that.props[prop];
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
if (prop.startsWith('on') && that.properties.indexOf(prop) === -1) {
|
|
318
|
-
events[prop] = that.props[prop];
|
|
319
|
-
continue;
|
|
320
|
-
}
|
|
321
|
-
props[prop] = that.props[prop];
|
|
322
|
-
}
|
|
323
|
-
if (initialize) {
|
|
324
|
-
that.nativeElement = this.componentRef.current;
|
|
325
|
-
}
|
|
326
|
-
for (let prop in props) {
|
|
327
|
-
if (prop === 'class' || prop === 'className') {
|
|
328
|
-
const classNames = props[prop].trim().split(' ');
|
|
329
|
-
for (let className in classNames) {
|
|
330
|
-
if (!that.nativeElement.classList.contains(classNames[className]) && classNames[className] !== "") {
|
|
331
|
-
that.nativeElement.classList.add(classNames[className]);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
continue;
|
|
335
|
-
}
|
|
336
|
-
if (props[prop] !== that.nativeElement[prop]) {
|
|
337
|
-
const normalizeProp = (str) => {
|
|
338
|
-
return str.replace(/-([a-z])/g, function (g) {
|
|
339
|
-
return g[1].toUpperCase();
|
|
340
|
-
});
|
|
341
|
-
};
|
|
342
|
-
if (prop === 'hover' || prop === 'active' || prop === 'focus' || prop === 'selected') {
|
|
343
|
-
that.nativeElement.setAttribute(prop, '');
|
|
344
|
-
}
|
|
345
|
-
const normalizedProp = normalizeProp(prop);
|
|
346
|
-
that.nativeElement[normalizedProp] = props[prop];
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
for (let eventName in events) {
|
|
350
|
-
that[eventName] = events[eventName];
|
|
351
|
-
that.nativeElement[eventName.toLowerCase()] = events[eventName];
|
|
352
|
-
}
|
|
353
|
-
if (initialize) {
|
|
354
|
-
Smart.Render();
|
|
355
|
-
if (that.onCreate) {
|
|
356
|
-
that.onCreate();
|
|
357
|
-
}
|
|
358
|
-
that.nativeElement.whenRendered(() => {
|
|
359
|
-
if (that.onReady) {
|
|
360
|
-
that.onReady();
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
// setup styles.
|
|
365
|
-
if (styles) {
|
|
366
|
-
for (let styleName in styles) {
|
|
367
|
-
that.nativeElement.style[styleName] = styles[styleName];
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
componentDidMount() {
|
|
372
|
-
this.componentDidRender(true);
|
|
373
|
-
}
|
|
374
|
-
componentDidUpdate() {
|
|
375
|
-
this.componentDidRender(false);
|
|
376
|
-
}
|
|
377
|
-
componentWillUnmount() {
|
|
378
|
-
const that = this;
|
|
379
|
-
if (!that.nativeElement) {
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
that.nativeElement.whenRenderedCallbacks = [];
|
|
383
|
-
for (let i = 0; i < that.eventListeners.length; i++) {
|
|
384
|
-
const eventName = that.eventListeners[i];
|
|
385
|
-
that.nativeElement.removeEventListener(eventName.substring(2).toLowerCase(), that[eventName]);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
render() {
|
|
389
|
-
return (React.createElement("smart-qrcode", { ref: this.componentRef }, this.props.children));
|
|
390
|
-
}
|
|
391
|
-
}
|
|
338
|
+
exports.Smart = Smart;
|
|
339
|
+
exports.QRcode = QRcode;
|
|
340
|
+
exports.default = QRcode;
|
|
392
341
|
|
|
393
|
-
|
|
394
|
-
exports.QRcode = QRcode;
|
|
395
|
-
exports.default = QRcode;
|
|
396
|
-
|
|
397
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
342
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
398
343
|
|
|
399
344
|
})));
|