react_hsbc_teller 1.9.8 → 1.9.81

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.
Files changed (38) hide show
  1. package/.babelrc +39 -39
  2. package/README.en.md +36 -36
  3. package/README.md +52 -52
  4. package/config/webpack.config.js +119 -119
  5. package/config/webpack.dev.js +108 -108
  6. package/config/webpack.prod.js +104 -104
  7. package/lib/hsbc.js +1 -1
  8. package/package.json +108 -108
  9. package/packages/api/api.js +553 -553
  10. package/packages/api/server.js +50 -50
  11. package/packages/common/JKL.js +61 -61
  12. package/packages/common/XML.js +271 -271
  13. package/packages/common/index.esm.js +374 -374
  14. package/packages/common/websocket.js +267 -267
  15. package/packages/demo/demo.js +279 -279
  16. package/packages/demo/index.js +3 -3
  17. package/packages/demo/pdf.js +79 -79
  18. package/packages/envconfig/envconfig.js +12 -12
  19. package/packages/index.js +2 -2
  20. package/packages/pages/foot/foot.jsx +212 -212
  21. package/packages/pages/foot/foot.less +84 -84
  22. package/packages/pages/header/header.jsx +15 -15
  23. package/packages/pages/header/header.less +51 -51
  24. package/packages/pages/index.jsx +52 -52
  25. package/packages/pages/sign/signMy.jsx +221 -221
  26. package/packages/pages/sign/signMy.less +129 -129
  27. package/packages/pages/video/video.jsx +6768 -6756
  28. package/packages/pages/video/video.less +616 -616
  29. package/packages/style/index.less +1 -1
  30. package/packages/style/reset.less +345 -345
  31. package/packages/utils/asyncComponent.jsx +26 -26
  32. package/packages/utils/cell.js +64 -64
  33. package/packages/utils/mixin.js +27 -27
  34. package/packages/utils/setRem.js +10 -10
  35. package/public/index.html +77 -77
  36. package/src/index.js +11 -11
  37. package/src/index.less +5 -5
  38. package/tsconfig.json +11 -11
@@ -1,271 +1,271 @@
1
- /* eslint-disable no-undef */
2
- // ========================================================================
3
- // XML.ObjTree -- XML source code from/to JavaScript object like E4X
4
- // ========================================================================
5
-
6
- import JKL from './JKL';
7
-
8
- const XML = {};
9
-
10
- XML.ObjTree = function () {
11
- return this;
12
- };
13
-
14
- // class variables
15
-
16
- XML.ObjTree.VERSION = '0.23';
17
-
18
- // object prototype
19
-
20
- XML.ObjTree.prototype.xmlDecl = '<?xml version="1.0" encoding="UTF-8" ?>\n';
21
- XML.ObjTree.prototype.attr_prefix = '-';
22
-
23
- // method: parseXML( xmlsource )
24
-
25
- XML.ObjTree.prototype.parseXML = function (xml) {
26
- let xmldom;
27
- let root;
28
- if (window.DOMParser) {
29
- xmldom = new DOMParser();
30
- // xmldom.async = false; // DOMParser is always sync-mode
31
- const dom = xmldom.parseFromString(xml, 'application/xml');
32
- if (!dom) return;
33
- root = dom.documentElement;
34
- } else if (window.ActiveXObject) {
35
- xmldom = new ActiveXObject('Microsoft.XMLDOM');
36
- xmldom.async = false;
37
- xmldom.loadXML(xml);
38
- root = xmldom.documentElement;
39
- }
40
- if (!root) return;
41
- return this.parseDOM(root);
42
- };
43
-
44
- // method: parseHTTP( url, options, callback )
45
-
46
- XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
47
- const myopt = {};
48
- for (const key in options) {
49
- myopt[key] = options[key]; // copy object
50
- }
51
- if (!myopt.method) {
52
- if (typeof (myopt.postBody) === 'undefined'
53
- && typeof (myopt.postbody) === 'undefined'
54
- && typeof (myopt.parameters) === 'undefined') {
55
- myopt.method = 'get';
56
- } else {
57
- myopt.method = 'post';
58
- }
59
- }
60
- if (callback) {
61
- myopt.asynchronous = true; // async-mode
62
- const __this = this;
63
- const __func = callback;
64
- const __save = myopt.onComplete;
65
- myopt.onComplete = function (trans) {
66
- let tree;
67
- if (trans && trans.responseXML && trans.responseXML.documentElement) {
68
- tree = __this.parseDOM(trans.responseXML.documentElement);
69
- }
70
- __func(tree, trans);
71
- if (__save) __save(trans);
72
- };
73
- } else {
74
- myopt.asynchronous = false; // sync-mode
75
- }
76
- let trans;
77
- if (typeof (HTTP) !== 'undefined' && HTTP.Request) {
78
- myopt.uri = url;
79
- var req = new HTTP.Request(myopt); // JSAN
80
- if (req) trans = req.transport;
81
- } else if (typeof (Ajax) !== 'undefined' && Ajax.Request) {
82
- var req = new Ajax.Request(url, myopt); // ptorotype.js
83
- if (req) trans = req.transport;
84
- }
85
- if (callback) return trans;
86
- if (trans && trans.responseXML && trans.responseXML.documentElement) {
87
- return this.parseDOM(trans.responseXML.documentElement);
88
- }
89
- };
90
-
91
- // method: parseDOM( documentroot )
92
-
93
- XML.ObjTree.prototype.parseDOM = function (root) {
94
- if (!root) return;
95
-
96
- this.__force_array = {};
97
- if (this.force_array) {
98
- for (let i = 0; i < this.force_array.length; i++) {
99
- this.__force_array[this.force_array[i]] = 1;
100
- }
101
- }
102
-
103
- let json = this.parseElement(root); // parse root node
104
- if (this.__force_array[root.nodeName]) {
105
- json = [json];
106
- }
107
- if (root.nodeType != 11) { // DOCUMENT_FRAGMENT_NODE
108
- const tmp = {};
109
- tmp[root.nodeName] = json; // root nodeName
110
- json = tmp;
111
- }
112
- return json;
113
- };
114
-
115
- // method: parseElement( element )
116
-
117
- XML.ObjTree.prototype.parseElement = function (elem) {
118
- // COMMENT_NODE
119
- if (elem.nodeType == 7) {
120
- return;
121
- }
122
-
123
- // TEXT_NODE CDATA_SECTION_NODE
124
- if (elem.nodeType == 3 || elem.nodeType == 4) {
125
- const bool = elem.nodeValue.match(/[^\x00-\x20]/);
126
- if (bool == null) return; // ignore white spaces
127
- return elem.nodeValue;
128
- }
129
-
130
- let retval;
131
- const cnt = {};
132
-
133
- // parse attributes
134
- if (elem.attributes && elem.attributes.length) {
135
- retval = {};
136
- for (var i = 0; i < elem.attributes.length; i++) {
137
- var key = elem.attributes[i].nodeName;
138
- if (typeof (key) !== 'string') continue;
139
- var val = elem.attributes[i].nodeValue;
140
- if (!val) continue;
141
- key = this.attr_prefix + key;
142
- if (typeof (cnt[key]) === 'undefined') cnt[key] = 0;
143
- cnt[key]++;
144
- this.addNode(retval, key, cnt[key], val);
145
- }
146
- }
147
-
148
- // parse child nodes (recursive)
149
- if (elem.childNodes && elem.childNodes.length) {
150
- let textonly = true;
151
- if (retval) textonly = false; // some attributes exists
152
- for (var i = 0; i < elem.childNodes.length && textonly; i++) {
153
- const ntype = elem.childNodes[i].nodeType;
154
- if (ntype == 3 || ntype == 4) continue;
155
- textonly = false;
156
- }
157
- if (textonly) {
158
- if (!retval) retval = '';
159
- for (var i = 0; i < elem.childNodes.length; i++) {
160
- retval += elem.childNodes[i].nodeValue;
161
- }
162
- } else {
163
- if (!retval) retval = {};
164
- for (var i = 0; i < elem.childNodes.length; i++) {
165
- var key = elem.childNodes[i].nodeName;
166
- if (typeof (key) !== 'string') continue;
167
- var val = this.parseElement(elem.childNodes[i]);
168
- if (!val) continue;
169
- if (typeof (cnt[key]) === 'undefined') cnt[key] = 0;
170
- cnt[key]++;
171
- this.addNode(retval, key, cnt[key], val);
172
- }
173
- }
174
- }
175
- return retval;
176
- };
177
-
178
- // method: addNode( hash, key, count, value )
179
-
180
- XML.ObjTree.prototype.addNode = function (hash, key, cnts, val) {
181
- if (this.__force_array[key]) {
182
- if (cnts == 1) hash[key] = [];
183
- hash[key][hash[key].length] = val; // push
184
- } else if (cnts == 1) { // 1st sibling
185
- hash[key] = val;
186
- } else if (cnts == 2) { // 2nd sibling
187
- hash[key] = [hash[key], val];
188
- } else { // 3rd sibling and more
189
- hash[key][hash[key].length] = val;
190
- }
191
- };
192
-
193
- // method: writeXML( tree )
194
-
195
- XML.ObjTree.prototype.writeXML = function (tree) {
196
- const xml = this.hash_to_xml(null, tree);
197
- return this.xmlDecl + xml;
198
- };
199
-
200
- // method: hash_to_xml( tagName, tree )
201
-
202
- XML.ObjTree.prototype.hash_to_xml = function (name, tree) {
203
- const elem = [];
204
- const attr = [];
205
- for (const key in tree) {
206
- if (!tree.hasOwnProperty(key)) continue;
207
- const val = tree[key];
208
- if (key.charAt(0) != this.attr_prefix) {
209
- if (typeof (val) === 'undefined' || val == null) {
210
- elem[elem.length] = `<${key} />`;
211
- } else if (typeof (val) === 'object' && val.constructor == Array) {
212
- elem[elem.length] = this.array_to_xml(key, val);
213
- } else if (typeof (val) === 'object') {
214
- elem[elem.length] = this.hash_to_xml(key, val);
215
- } else {
216
- elem[elem.length] = this.scalar_to_xml(key, val);
217
- }
218
- } else {
219
- attr[attr.length] = ` ${key.substring(1)}="${this.xml_escape(val)}"`;
220
- }
221
- }
222
- const jattr = attr.join('');
223
- let jelem = elem.join('');
224
- if (typeof (name) === 'undefined' || name == null) {
225
- // no tag
226
- } else if (elem.length > 0) {
227
- if (jelem.match(/\n/)) {
228
- jelem = `<${name}${jattr}>\n${jelem}</${name}>\n`;
229
- } else {
230
- jelem = `<${name}${jattr}>${jelem}</${name}>\n`;
231
- }
232
- } else {
233
- jelem = `<${name}${jattr} />\n`;
234
- }
235
- return jelem;
236
- };
237
-
238
- // method: array_to_xml( tagName, array )
239
-
240
- XML.ObjTree.prototype.array_to_xml = function (name, array) {
241
- const out = [];
242
- for (let i = 0; i < array.length; i++) {
243
- const val = array[i];
244
- if (typeof (val) === 'undefined' || val == null) {
245
- out[out.length] = `<${name} />`;
246
- } else if (typeof (val) === 'object' && val.constructor == Array) {
247
- out[out.length] = this.array_to_xml(name, val);
248
- } else if (typeof (val) === 'object') {
249
- out[out.length] = this.hash_to_xml(name, val);
250
- } else {
251
- out[out.length] = this.scalar_to_xml(name, val);
252
- }
253
- }
254
- return out.join('');
255
- };
256
-
257
- // method: scalar_to_xml( tagName, text )
258
-
259
- XML.ObjTree.prototype.scalar_to_xml = function (name, text) {
260
- if (name == '#text') {
261
- return this.xml_escape(text);
262
- }
263
- return `<${name}>${this.xml_escape(text)}</${name}>\n`;
264
- };
265
-
266
- // method: xml_escape( text )
267
-
268
- XML.ObjTree.prototype.xml_escape = function (text) {
269
- return text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
270
- };
271
- export default XML;
1
+ /* eslint-disable no-undef */
2
+ // ========================================================================
3
+ // XML.ObjTree -- XML source code from/to JavaScript object like E4X
4
+ // ========================================================================
5
+
6
+ import JKL from './JKL';
7
+
8
+ const XML = {};
9
+
10
+ XML.ObjTree = function () {
11
+ return this;
12
+ };
13
+
14
+ // class variables
15
+
16
+ XML.ObjTree.VERSION = '0.23';
17
+
18
+ // object prototype
19
+
20
+ XML.ObjTree.prototype.xmlDecl = '<?xml version="1.0" encoding="UTF-8" ?>\n';
21
+ XML.ObjTree.prototype.attr_prefix = '-';
22
+
23
+ // method: parseXML( xmlsource )
24
+
25
+ XML.ObjTree.prototype.parseXML = function (xml) {
26
+ let xmldom;
27
+ let root;
28
+ if (window.DOMParser) {
29
+ xmldom = new DOMParser();
30
+ // xmldom.async = false; // DOMParser is always sync-mode
31
+ const dom = xmldom.parseFromString(xml, 'application/xml');
32
+ if (!dom) return;
33
+ root = dom.documentElement;
34
+ } else if (window.ActiveXObject) {
35
+ xmldom = new ActiveXObject('Microsoft.XMLDOM');
36
+ xmldom.async = false;
37
+ xmldom.loadXML(xml);
38
+ root = xmldom.documentElement;
39
+ }
40
+ if (!root) return;
41
+ return this.parseDOM(root);
42
+ };
43
+
44
+ // method: parseHTTP( url, options, callback )
45
+
46
+ XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
47
+ const myopt = {};
48
+ for (const key in options) {
49
+ myopt[key] = options[key]; // copy object
50
+ }
51
+ if (!myopt.method) {
52
+ if (typeof (myopt.postBody) === 'undefined'
53
+ && typeof (myopt.postbody) === 'undefined'
54
+ && typeof (myopt.parameters) === 'undefined') {
55
+ myopt.method = 'get';
56
+ } else {
57
+ myopt.method = 'post';
58
+ }
59
+ }
60
+ if (callback) {
61
+ myopt.asynchronous = true; // async-mode
62
+ const __this = this;
63
+ const __func = callback;
64
+ const __save = myopt.onComplete;
65
+ myopt.onComplete = function (trans) {
66
+ let tree;
67
+ if (trans && trans.responseXML && trans.responseXML.documentElement) {
68
+ tree = __this.parseDOM(trans.responseXML.documentElement);
69
+ }
70
+ __func(tree, trans);
71
+ if (__save) __save(trans);
72
+ };
73
+ } else {
74
+ myopt.asynchronous = false; // sync-mode
75
+ }
76
+ let trans;
77
+ if (typeof (HTTP) !== 'undefined' && HTTP.Request) {
78
+ myopt.uri = url;
79
+ var req = new HTTP.Request(myopt); // JSAN
80
+ if (req) trans = req.transport;
81
+ } else if (typeof (Ajax) !== 'undefined' && Ajax.Request) {
82
+ var req = new Ajax.Request(url, myopt); // ptorotype.js
83
+ if (req) trans = req.transport;
84
+ }
85
+ if (callback) return trans;
86
+ if (trans && trans.responseXML && trans.responseXML.documentElement) {
87
+ return this.parseDOM(trans.responseXML.documentElement);
88
+ }
89
+ };
90
+
91
+ // method: parseDOM( documentroot )
92
+
93
+ XML.ObjTree.prototype.parseDOM = function (root) {
94
+ if (!root) return;
95
+
96
+ this.__force_array = {};
97
+ if (this.force_array) {
98
+ for (let i = 0; i < this.force_array.length; i++) {
99
+ this.__force_array[this.force_array[i]] = 1;
100
+ }
101
+ }
102
+
103
+ let json = this.parseElement(root); // parse root node
104
+ if (this.__force_array[root.nodeName]) {
105
+ json = [json];
106
+ }
107
+ if (root.nodeType != 11) { // DOCUMENT_FRAGMENT_NODE
108
+ const tmp = {};
109
+ tmp[root.nodeName] = json; // root nodeName
110
+ json = tmp;
111
+ }
112
+ return json;
113
+ };
114
+
115
+ // method: parseElement( element )
116
+
117
+ XML.ObjTree.prototype.parseElement = function (elem) {
118
+ // COMMENT_NODE
119
+ if (elem.nodeType == 7) {
120
+ return;
121
+ }
122
+
123
+ // TEXT_NODE CDATA_SECTION_NODE
124
+ if (elem.nodeType == 3 || elem.nodeType == 4) {
125
+ const bool = elem.nodeValue.match(/[^\x00-\x20]/);
126
+ if (bool == null) return; // ignore white spaces
127
+ return elem.nodeValue;
128
+ }
129
+
130
+ let retval;
131
+ const cnt = {};
132
+
133
+ // parse attributes
134
+ if (elem.attributes && elem.attributes.length) {
135
+ retval = {};
136
+ for (var i = 0; i < elem.attributes.length; i++) {
137
+ var key = elem.attributes[i].nodeName;
138
+ if (typeof (key) !== 'string') continue;
139
+ var val = elem.attributes[i].nodeValue;
140
+ if (!val) continue;
141
+ key = this.attr_prefix + key;
142
+ if (typeof (cnt[key]) === 'undefined') cnt[key] = 0;
143
+ cnt[key]++;
144
+ this.addNode(retval, key, cnt[key], val);
145
+ }
146
+ }
147
+
148
+ // parse child nodes (recursive)
149
+ if (elem.childNodes && elem.childNodes.length) {
150
+ let textonly = true;
151
+ if (retval) textonly = false; // some attributes exists
152
+ for (var i = 0; i < elem.childNodes.length && textonly; i++) {
153
+ const ntype = elem.childNodes[i].nodeType;
154
+ if (ntype == 3 || ntype == 4) continue;
155
+ textonly = false;
156
+ }
157
+ if (textonly) {
158
+ if (!retval) retval = '';
159
+ for (var i = 0; i < elem.childNodes.length; i++) {
160
+ retval += elem.childNodes[i].nodeValue;
161
+ }
162
+ } else {
163
+ if (!retval) retval = {};
164
+ for (var i = 0; i < elem.childNodes.length; i++) {
165
+ var key = elem.childNodes[i].nodeName;
166
+ if (typeof (key) !== 'string') continue;
167
+ var val = this.parseElement(elem.childNodes[i]);
168
+ if (!val) continue;
169
+ if (typeof (cnt[key]) === 'undefined') cnt[key] = 0;
170
+ cnt[key]++;
171
+ this.addNode(retval, key, cnt[key], val);
172
+ }
173
+ }
174
+ }
175
+ return retval;
176
+ };
177
+
178
+ // method: addNode( hash, key, count, value )
179
+
180
+ XML.ObjTree.prototype.addNode = function (hash, key, cnts, val) {
181
+ if (this.__force_array[key]) {
182
+ if (cnts == 1) hash[key] = [];
183
+ hash[key][hash[key].length] = val; // push
184
+ } else if (cnts == 1) { // 1st sibling
185
+ hash[key] = val;
186
+ } else if (cnts == 2) { // 2nd sibling
187
+ hash[key] = [hash[key], val];
188
+ } else { // 3rd sibling and more
189
+ hash[key][hash[key].length] = val;
190
+ }
191
+ };
192
+
193
+ // method: writeXML( tree )
194
+
195
+ XML.ObjTree.prototype.writeXML = function (tree) {
196
+ const xml = this.hash_to_xml(null, tree);
197
+ return this.xmlDecl + xml;
198
+ };
199
+
200
+ // method: hash_to_xml( tagName, tree )
201
+
202
+ XML.ObjTree.prototype.hash_to_xml = function (name, tree) {
203
+ const elem = [];
204
+ const attr = [];
205
+ for (const key in tree) {
206
+ if (!tree.hasOwnProperty(key)) continue;
207
+ const val = tree[key];
208
+ if (key.charAt(0) != this.attr_prefix) {
209
+ if (typeof (val) === 'undefined' || val == null) {
210
+ elem[elem.length] = `<${key} />`;
211
+ } else if (typeof (val) === 'object' && val.constructor == Array) {
212
+ elem[elem.length] = this.array_to_xml(key, val);
213
+ } else if (typeof (val) === 'object') {
214
+ elem[elem.length] = this.hash_to_xml(key, val);
215
+ } else {
216
+ elem[elem.length] = this.scalar_to_xml(key, val);
217
+ }
218
+ } else {
219
+ attr[attr.length] = ` ${key.substring(1)}="${this.xml_escape(val)}"`;
220
+ }
221
+ }
222
+ const jattr = attr.join('');
223
+ let jelem = elem.join('');
224
+ if (typeof (name) === 'undefined' || name == null) {
225
+ // no tag
226
+ } else if (elem.length > 0) {
227
+ if (jelem.match(/\n/)) {
228
+ jelem = `<${name}${jattr}>\n${jelem}</${name}>\n`;
229
+ } else {
230
+ jelem = `<${name}${jattr}>${jelem}</${name}>\n`;
231
+ }
232
+ } else {
233
+ jelem = `<${name}${jattr} />\n`;
234
+ }
235
+ return jelem;
236
+ };
237
+
238
+ // method: array_to_xml( tagName, array )
239
+
240
+ XML.ObjTree.prototype.array_to_xml = function (name, array) {
241
+ const out = [];
242
+ for (let i = 0; i < array.length; i++) {
243
+ const val = array[i];
244
+ if (typeof (val) === 'undefined' || val == null) {
245
+ out[out.length] = `<${name} />`;
246
+ } else if (typeof (val) === 'object' && val.constructor == Array) {
247
+ out[out.length] = this.array_to_xml(name, val);
248
+ } else if (typeof (val) === 'object') {
249
+ out[out.length] = this.hash_to_xml(name, val);
250
+ } else {
251
+ out[out.length] = this.scalar_to_xml(name, val);
252
+ }
253
+ }
254
+ return out.join('');
255
+ };
256
+
257
+ // method: scalar_to_xml( tagName, text )
258
+
259
+ XML.ObjTree.prototype.scalar_to_xml = function (name, text) {
260
+ if (name == '#text') {
261
+ return this.xml_escape(text);
262
+ }
263
+ return `<${name}>${this.xml_escape(text)}</${name}>\n`;
264
+ };
265
+
266
+ // method: xml_escape( text )
267
+
268
+ XML.ObjTree.prototype.xml_escape = function (text) {
269
+ return text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
270
+ };
271
+ export default XML;