@daoyi/nmtl-ui 2.0.1-beta.7 → 2.0.1-beta.71

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 (99) hide show
  1. package/lib/components/Autocomplete-e62927dc.js +334 -0
  2. package/lib/components/Autocomplete.js +13 -1
  3. package/lib/components/Avatar.js +53 -1
  4. package/lib/components/BackTop.js +109 -1
  5. package/lib/components/BarChart.js +762 -1
  6. package/lib/components/Breadcrumbs.js +122 -1
  7. package/lib/components/Button-4fddcd2f.js +92 -0
  8. package/lib/components/Button.js +6 -1
  9. package/lib/components/Carousel.js +4654 -1
  10. package/lib/components/Checkbox.js +37 -1
  11. package/lib/components/CollapseContent.js +179 -1
  12. package/lib/components/ContactModal-33f4e605.js +12020 -0
  13. package/lib/components/ContactModal.js +22 -3
  14. package/lib/components/Drawer-fb5bc1ec.js +157 -0
  15. package/lib/components/Drawer.js +11 -1
  16. package/lib/components/Dropdown.js +134 -1
  17. package/lib/components/Empty-e50b760e.js +45 -0
  18. package/lib/components/Empty.js +5 -1
  19. package/lib/components/ExportButton.js +112 -1
  20. package/lib/components/ExtraTools-a49a1d2f.js +3537 -0
  21. package/lib/components/ExtraTools.js +10 -22
  22. package/lib/components/Filter.js +782 -12
  23. package/lib/components/Footer.js +271 -1
  24. package/lib/components/ForwardLink-6a82c19d.js +106 -0
  25. package/lib/components/ForwardLink.js +8 -0
  26. package/lib/components/Header.js +187 -1
  27. package/lib/components/Image.js +61 -1
  28. package/lib/components/Input.js +82 -1
  29. package/lib/components/InputMethod.js +33949 -12
  30. package/lib/components/KeywordSearch-3af0c402.js +140 -0
  31. package/lib/components/KeywordSearch.js +15 -1
  32. package/lib/components/KeywordTicker.js +190 -1
  33. package/lib/components/Keywords.js +317 -1
  34. package/lib/components/Loading.js +28 -1
  35. package/lib/components/MUITheme.js +2624 -1
  36. package/lib/components/Modal-2c39d5b8.js +108 -0
  37. package/lib/components/Modal.js +9 -1
  38. package/lib/components/MoreButton-6b323fe4.js +110 -0
  39. package/lib/components/MoreButton.js +6 -1
  40. package/lib/components/Pagination.js +3706 -0
  41. package/lib/components/Radio.js +78 -1
  42. package/lib/components/SNA.js +1691 -22
  43. package/lib/components/Select-0f131640.js +115 -0
  44. package/lib/components/Select.js +8 -1
  45. package/lib/components/Spin-1741f625.js +75 -0
  46. package/lib/components/Spin.js +6 -1
  47. package/lib/components/Table.js +51 -1
  48. package/lib/components/Tooltip-65a21a86.js +70 -0
  49. package/lib/components/Tooltip.js +7 -1
  50. package/lib/components/_commonjsHelpers-70de2c37.js +28 -0
  51. package/lib/components/_rollupPluginBabelHelpers-a52356f6.js +142 -0
  52. package/lib/components/createSvgIcon-d9801fb7.js +576 -0
  53. package/lib/components/dataExport-d55d6fa3.js +92 -0
  54. package/lib/components/debounce-127da66c.js +355 -0
  55. package/lib/components/defaultTheme-5839b9b3.js +1505 -0
  56. package/lib/components/globalConfig.js +175 -0
  57. package/lib/components/hoist-non-react-statics.cjs-3f408ad2.js +105 -0
  58. package/lib/components/index-0be0afec.js +481 -0
  59. package/lib/components/index-ef96775f.js +61 -0
  60. package/lib/components/isObjectLike-e111475d.js +190 -0
  61. package/lib/components/style-inject.es-1f59c1d0.js +28 -1
  62. package/lib/components/transform-3a04288b.js +5475 -0
  63. package/lib/components/withTheme-4417822c.js +6 -0
  64. package/lib/index.d.ts +2 -0
  65. package/lib/index.js +2 -0
  66. package/lib/utils/_rollupPluginBabelHelpers-8dd26e1a.js +121 -0
  67. package/lib/utils/arrayMerge.js +4953 -1
  68. package/lib/utils/chunkArray.js +15 -1
  69. package/lib/utils/convert2HtmlEntities.js +42 -1
  70. package/lib/utils/domToImage.js +802 -1
  71. package/lib/utils/downloadGephi.js +106 -1
  72. package/lib/utils/exportXlsx.js +219 -1
  73. package/lib/utils/historyAppendSearch.js +502 -1
  74. package/lib/utils/isDevelopMode.js +5 -1
  75. package/lib/utils/parseYMD.js +36 -1
  76. package/lib/utils/removeDuplicateItem.js +11 -1
  77. package/lib/utils/sendEmail.js +39 -1
  78. package/lib/utils/snaDefine-6a2bcd94.js +5 -0
  79. package/lib/utils/snaDefine.js +1 -1
  80. package/lib/utils/snaPreProcess.js +84 -1
  81. package/package.json +17 -21
  82. package/lib/components/Empty-54b79907.js +0 -1
  83. package/lib/components/KeywordSearch-5a393f12.js +0 -1
  84. package/lib/components/Select-f2441b83.js +0 -1
  85. package/lib/components/_rollupPluginBabelHelpers-1b8c042f.js +0 -1
  86. package/lib/components/_rollupPluginBabelHelpers-ec4e2a53.js +0 -1
  87. package/lib/components/createSvgIcon-62b64929.js +0 -1
  88. package/lib/components/createSvgIcon-e24792d4.js +0 -1
  89. package/lib/components/createTheme-7fffa109.js +0 -1
  90. package/lib/components/dataExport-9fccd4f0.js +0 -1
  91. package/lib/components/debounce-c993109b.js +0 -1
  92. package/lib/components/hoist-non-react-statics.cjs-d6a9befd.js +0 -1
  93. package/lib/components/index-11391ca3.js +0 -7
  94. package/lib/components/index-b2745105.js +0 -7
  95. package/lib/components/isObjectLike-2f1983fe.js +0 -1
  96. package/lib/components/style-inject.es-c875d022.js +0 -1
  97. package/lib/components/transform-0eb2d36e.js +0 -1
  98. package/lib/utils/_commonjsHelpers-e2cda605.js +0 -1
  99. package/lib/utils/_rollupPluginBabelHelpers-928a52ce.js +0 -1
@@ -0,0 +1,481 @@
1
+ var queryString = {};
2
+
3
+ var strictUriEncode = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
4
+
5
+ var token = '%[a-f0-9]{2}';
6
+ var singleMatcher = new RegExp(token, 'gi');
7
+ var multiMatcher = new RegExp('(' + token + ')+', 'gi');
8
+
9
+ function decodeComponents(components, split) {
10
+ try {
11
+ // Try to decode the entire string first
12
+ return decodeURIComponent(components.join(''));
13
+ } catch (err) {
14
+ // Do nothing
15
+ }
16
+
17
+ if (components.length === 1) {
18
+ return components;
19
+ }
20
+
21
+ split = split || 1;
22
+
23
+ // Split the array in 2 parts
24
+ var left = components.slice(0, split);
25
+ var right = components.slice(split);
26
+
27
+ return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
28
+ }
29
+
30
+ function decode(input) {
31
+ try {
32
+ return decodeURIComponent(input);
33
+ } catch (err) {
34
+ var tokens = input.match(singleMatcher);
35
+
36
+ for (var i = 1; i < tokens.length; i++) {
37
+ input = decodeComponents(tokens, i).join('');
38
+
39
+ tokens = input.match(singleMatcher);
40
+ }
41
+
42
+ return input;
43
+ }
44
+ }
45
+
46
+ function customDecodeURIComponent(input) {
47
+ // Keep track of all the replacements and prefill the map with the `BOM`
48
+ var replaceMap = {
49
+ '%FE%FF': '\uFFFD\uFFFD',
50
+ '%FF%FE': '\uFFFD\uFFFD'
51
+ };
52
+
53
+ var match = multiMatcher.exec(input);
54
+ while (match) {
55
+ try {
56
+ // Decode as big chunks as possible
57
+ replaceMap[match[0]] = decodeURIComponent(match[0]);
58
+ } catch (err) {
59
+ var result = decode(match[0]);
60
+
61
+ if (result !== match[0]) {
62
+ replaceMap[match[0]] = result;
63
+ }
64
+ }
65
+
66
+ match = multiMatcher.exec(input);
67
+ }
68
+
69
+ // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
70
+ replaceMap['%C2'] = '\uFFFD';
71
+
72
+ var entries = Object.keys(replaceMap);
73
+
74
+ for (var i = 0; i < entries.length; i++) {
75
+ // Replace all decoded components
76
+ var key = entries[i];
77
+ input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
78
+ }
79
+
80
+ return input;
81
+ }
82
+
83
+ var decodeUriComponent = function (encodedURI) {
84
+ if (typeof encodedURI !== 'string') {
85
+ throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
86
+ }
87
+
88
+ try {
89
+ encodedURI = encodedURI.replace(/\+/g, ' ');
90
+
91
+ // Try the built in decoder first
92
+ return decodeURIComponent(encodedURI);
93
+ } catch (err) {
94
+ // Fallback to a more advanced decoder
95
+ return customDecodeURIComponent(encodedURI);
96
+ }
97
+ };
98
+
99
+ var splitOnFirst = (string, separator) => {
100
+ if (!(typeof string === 'string' && typeof separator === 'string')) {
101
+ throw new TypeError('Expected the arguments to be of type `string`');
102
+ }
103
+
104
+ if (separator === '') {
105
+ return [string];
106
+ }
107
+
108
+ const separatorIndex = string.indexOf(separator);
109
+
110
+ if (separatorIndex === -1) {
111
+ return [string];
112
+ }
113
+
114
+ return [
115
+ string.slice(0, separatorIndex),
116
+ string.slice(separatorIndex + separator.length)
117
+ ];
118
+ };
119
+
120
+ (function (exports) {
121
+ const strictUriEncode$1 = strictUriEncode;
122
+ const decodeComponent = decodeUriComponent;
123
+ const splitOnFirst$1 = splitOnFirst;
124
+
125
+ const isNullOrUndefined = value => value === null || value === undefined;
126
+
127
+ function encoderForArrayFormat(options) {
128
+ switch (options.arrayFormat) {
129
+ case 'index':
130
+ return key => (result, value) => {
131
+ const index = result.length;
132
+
133
+ if (
134
+ value === undefined ||
135
+ (options.skipNull && value === null) ||
136
+ (options.skipEmptyString && value === '')
137
+ ) {
138
+ return result;
139
+ }
140
+
141
+ if (value === null) {
142
+ return [...result, [encode(key, options), '[', index, ']'].join('')];
143
+ }
144
+
145
+ return [
146
+ ...result,
147
+ [encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')
148
+ ];
149
+ };
150
+
151
+ case 'bracket':
152
+ return key => (result, value) => {
153
+ if (
154
+ value === undefined ||
155
+ (options.skipNull && value === null) ||
156
+ (options.skipEmptyString && value === '')
157
+ ) {
158
+ return result;
159
+ }
160
+
161
+ if (value === null) {
162
+ return [...result, [encode(key, options), '[]'].join('')];
163
+ }
164
+
165
+ return [...result, [encode(key, options), '[]=', encode(value, options)].join('')];
166
+ };
167
+
168
+ case 'comma':
169
+ case 'separator':
170
+ return key => (result, value) => {
171
+ if (value === null || value === undefined || value.length === 0) {
172
+ return result;
173
+ }
174
+
175
+ if (result.length === 0) {
176
+ return [[encode(key, options), '=', encode(value, options)].join('')];
177
+ }
178
+
179
+ return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
180
+ };
181
+
182
+ default:
183
+ return key => (result, value) => {
184
+ if (
185
+ value === undefined ||
186
+ (options.skipNull && value === null) ||
187
+ (options.skipEmptyString && value === '')
188
+ ) {
189
+ return result;
190
+ }
191
+
192
+ if (value === null) {
193
+ return [...result, encode(key, options)];
194
+ }
195
+
196
+ return [...result, [encode(key, options), '=', encode(value, options)].join('')];
197
+ };
198
+ }
199
+ }
200
+
201
+ function parserForArrayFormat(options) {
202
+ let result;
203
+
204
+ switch (options.arrayFormat) {
205
+ case 'index':
206
+ return (key, value, accumulator) => {
207
+ result = /\[(\d*)\]$/.exec(key);
208
+
209
+ key = key.replace(/\[\d*\]$/, '');
210
+
211
+ if (!result) {
212
+ accumulator[key] = value;
213
+ return;
214
+ }
215
+
216
+ if (accumulator[key] === undefined) {
217
+ accumulator[key] = {};
218
+ }
219
+
220
+ accumulator[key][result[1]] = value;
221
+ };
222
+
223
+ case 'bracket':
224
+ return (key, value, accumulator) => {
225
+ result = /(\[\])$/.exec(key);
226
+ key = key.replace(/\[\]$/, '');
227
+
228
+ if (!result) {
229
+ accumulator[key] = value;
230
+ return;
231
+ }
232
+
233
+ if (accumulator[key] === undefined) {
234
+ accumulator[key] = [value];
235
+ return;
236
+ }
237
+
238
+ accumulator[key] = [].concat(accumulator[key], value);
239
+ };
240
+
241
+ case 'comma':
242
+ case 'separator':
243
+ return (key, value, accumulator) => {
244
+ const isArray = typeof value === 'string' && value.split('').indexOf(options.arrayFormatSeparator) > -1;
245
+ const newValue = isArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);
246
+ accumulator[key] = newValue;
247
+ };
248
+
249
+ default:
250
+ return (key, value, accumulator) => {
251
+ if (accumulator[key] === undefined) {
252
+ accumulator[key] = value;
253
+ return;
254
+ }
255
+
256
+ accumulator[key] = [].concat(accumulator[key], value);
257
+ };
258
+ }
259
+ }
260
+
261
+ function validateArrayFormatSeparator(value) {
262
+ if (typeof value !== 'string' || value.length !== 1) {
263
+ throw new TypeError('arrayFormatSeparator must be single character string');
264
+ }
265
+ }
266
+
267
+ function encode(value, options) {
268
+ if (options.encode) {
269
+ return options.strict ? strictUriEncode$1(value) : encodeURIComponent(value);
270
+ }
271
+
272
+ return value;
273
+ }
274
+
275
+ function decode(value, options) {
276
+ if (options.decode) {
277
+ return decodeComponent(value);
278
+ }
279
+
280
+ return value;
281
+ }
282
+
283
+ function keysSorter(input) {
284
+ if (Array.isArray(input)) {
285
+ return input.sort();
286
+ }
287
+
288
+ if (typeof input === 'object') {
289
+ return keysSorter(Object.keys(input))
290
+ .sort((a, b) => Number(a) - Number(b))
291
+ .map(key => input[key]);
292
+ }
293
+
294
+ return input;
295
+ }
296
+
297
+ function removeHash(input) {
298
+ const hashStart = input.indexOf('#');
299
+ if (hashStart !== -1) {
300
+ input = input.slice(0, hashStart);
301
+ }
302
+
303
+ return input;
304
+ }
305
+
306
+ function getHash(url) {
307
+ let hash = '';
308
+ const hashStart = url.indexOf('#');
309
+ if (hashStart !== -1) {
310
+ hash = url.slice(hashStart);
311
+ }
312
+
313
+ return hash;
314
+ }
315
+
316
+ function extract(input) {
317
+ input = removeHash(input);
318
+ const queryStart = input.indexOf('?');
319
+ if (queryStart === -1) {
320
+ return '';
321
+ }
322
+
323
+ return input.slice(queryStart + 1);
324
+ }
325
+
326
+ function parseValue(value, options) {
327
+ if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {
328
+ value = Number(value);
329
+ } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
330
+ value = value.toLowerCase() === 'true';
331
+ }
332
+
333
+ return value;
334
+ }
335
+
336
+ function parse(input, options) {
337
+ options = Object.assign({
338
+ decode: true,
339
+ sort: true,
340
+ arrayFormat: 'none',
341
+ arrayFormatSeparator: ',',
342
+ parseNumbers: false,
343
+ parseBooleans: false
344
+ }, options);
345
+
346
+ validateArrayFormatSeparator(options.arrayFormatSeparator);
347
+
348
+ const formatter = parserForArrayFormat(options);
349
+
350
+ // Create an object with no prototype
351
+ const ret = Object.create(null);
352
+
353
+ if (typeof input !== 'string') {
354
+ return ret;
355
+ }
356
+
357
+ input = input.trim().replace(/^[?#&]/, '');
358
+
359
+ if (!input) {
360
+ return ret;
361
+ }
362
+
363
+ for (const param of input.split('&')) {
364
+ let [key, value] = splitOnFirst$1(options.decode ? param.replace(/\+/g, ' ') : param, '=');
365
+
366
+ // Missing `=` should be `null`:
367
+ // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
368
+ value = value === undefined ? null : ['comma', 'separator'].includes(options.arrayFormat) ? value : decode(value, options);
369
+ formatter(decode(key, options), value, ret);
370
+ }
371
+
372
+ for (const key of Object.keys(ret)) {
373
+ const value = ret[key];
374
+ if (typeof value === 'object' && value !== null) {
375
+ for (const k of Object.keys(value)) {
376
+ value[k] = parseValue(value[k], options);
377
+ }
378
+ } else {
379
+ ret[key] = parseValue(value, options);
380
+ }
381
+ }
382
+
383
+ if (options.sort === false) {
384
+ return ret;
385
+ }
386
+
387
+ return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
388
+ const value = ret[key];
389
+ if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {
390
+ // Sort object keys, not values
391
+ result[key] = keysSorter(value);
392
+ } else {
393
+ result[key] = value;
394
+ }
395
+
396
+ return result;
397
+ }, Object.create(null));
398
+ }
399
+
400
+ exports.extract = extract;
401
+ exports.parse = parse;
402
+
403
+ exports.stringify = (object, options) => {
404
+ if (!object) {
405
+ return '';
406
+ }
407
+
408
+ options = Object.assign({
409
+ encode: true,
410
+ strict: true,
411
+ arrayFormat: 'none',
412
+ arrayFormatSeparator: ','
413
+ }, options);
414
+
415
+ validateArrayFormatSeparator(options.arrayFormatSeparator);
416
+
417
+ const shouldFilter = key => (
418
+ (options.skipNull && isNullOrUndefined(object[key])) ||
419
+ (options.skipEmptyString && object[key] === '')
420
+ );
421
+
422
+ const formatter = encoderForArrayFormat(options);
423
+
424
+ const objectCopy = {};
425
+
426
+ for (const key of Object.keys(object)) {
427
+ if (!shouldFilter(key)) {
428
+ objectCopy[key] = object[key];
429
+ }
430
+ }
431
+
432
+ const keys = Object.keys(objectCopy);
433
+
434
+ if (options.sort !== false) {
435
+ keys.sort(options.sort);
436
+ }
437
+
438
+ return keys.map(key => {
439
+ const value = object[key];
440
+
441
+ if (value === undefined) {
442
+ return '';
443
+ }
444
+
445
+ if (value === null) {
446
+ return encode(key, options);
447
+ }
448
+
449
+ if (Array.isArray(value)) {
450
+ return value
451
+ .reduce(formatter(key), [])
452
+ .join('&');
453
+ }
454
+
455
+ return encode(key, options) + '=' + encode(value, options);
456
+ }).filter(x => x.length > 0).join('&');
457
+ };
458
+
459
+ exports.parseUrl = (input, options) => {
460
+ return {
461
+ url: removeHash(input).split('?')[0] || '',
462
+ query: parse(extract(input), options)
463
+ };
464
+ };
465
+
466
+ exports.stringifyUrl = (input, options) => {
467
+ const url = removeHash(input.url).split('?')[0] || '';
468
+ const queryFromUrl = exports.extract(input.url);
469
+ const parsedQueryFromUrl = exports.parse(queryFromUrl);
470
+ const hash = getHash(input.url);
471
+ const query = Object.assign(parsedQueryFromUrl, input.query);
472
+ let queryString = exports.stringify(query, options);
473
+ if (queryString) {
474
+ queryString = `?${queryString}`;
475
+ }
476
+
477
+ return `${url}${queryString}${hash}`;
478
+ };
479
+ } (queryString));
480
+
481
+ export { queryString as q };
@@ -0,0 +1,61 @@
1
+ var classnames = {exports: {}};
2
+
3
+ /*!
4
+ Copyright (c) 2018 Jed Watson.
5
+ Licensed under the MIT License (MIT), see
6
+ http://jedwatson.github.io/classnames
7
+ */
8
+
9
+ (function (module) {
10
+ /* global define */
11
+
12
+ (function () {
13
+
14
+ var hasOwn = {}.hasOwnProperty;
15
+
16
+ function classNames() {
17
+ var classes = [];
18
+
19
+ for (var i = 0; i < arguments.length; i++) {
20
+ var arg = arguments[i];
21
+ if (!arg) continue;
22
+
23
+ var argType = typeof arg;
24
+
25
+ if (argType === 'string' || argType === 'number') {
26
+ classes.push(arg);
27
+ } else if (Array.isArray(arg)) {
28
+ if (arg.length) {
29
+ var inner = classNames.apply(null, arg);
30
+ if (inner) {
31
+ classes.push(inner);
32
+ }
33
+ }
34
+ } else if (argType === 'object') {
35
+ if (arg.toString === Object.prototype.toString) {
36
+ for (var key in arg) {
37
+ if (hasOwn.call(arg, key) && arg[key]) {
38
+ classes.push(key);
39
+ }
40
+ }
41
+ } else {
42
+ classes.push(arg.toString());
43
+ }
44
+ }
45
+ }
46
+
47
+ return classes.join(' ');
48
+ }
49
+
50
+ if (module.exports) {
51
+ classNames.default = classNames;
52
+ module.exports = classNames;
53
+ } else {
54
+ window.classNames = classNames;
55
+ }
56
+ }());
57
+ } (classnames));
58
+
59
+ var classNames = classnames.exports;
60
+
61
+ export { classnames as a, classNames as c };