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

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-429c839b.js +335 -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-ae74e8e2.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
@@ -1 +1,502 @@
1
- import{b as r,c as e}from"./_rollupPluginBabelHelpers-928a52ce.js";import t from"prop-types";import{c as o}from"./_commonjsHelpers-e2cda605.js";var n=new RegExp("%[a-f0-9]{2}","gi"),a=new RegExp("(%[a-f0-9]{2})+","gi");function s(r,e){try{return decodeURIComponent(r.join(""))}catch(r){}if(1===r.length)return r;e=e||1;var t=r.slice(0,e),o=r.slice(e);return Array.prototype.concat.call([],s(t),s(o))}function c(r){try{return decodeURIComponent(r)}catch(o){for(var e=r.match(n),t=1;t<e.length;t++)e=(r=s(e,t).join("")).match(n);return r}}var i=function(r){if("string"!=typeof r)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch(e){return function(r){for(var e={"%FE%FF":"��","%FF%FE":"��"},t=a.exec(r);t;){try{e[t[0]]=decodeURIComponent(t[0])}catch(r){var o=c(t[0]);o!==t[0]&&(e[t[0]]=o)}t=a.exec(r)}e["%C2"]="�";for(var n=Object.keys(e),s=0;s<n.length;s++){var i=n[s];r=r.replace(new RegExp(i,"g"),e[i])}return r}(r)}},l=(r,e)=>{if("string"!=typeof r||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[r];const t=r.indexOf(e);return-1===t?[r]:[r.slice(0,t),r.slice(t+e.length)]},u=o((function(r,e){function t(r){if("string"!=typeof r||1!==r.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(r,e){return e.encode?e.strict?encodeURIComponent(r).replace(/[!'()*]/g,(r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`)):encodeURIComponent(r):r}function n(r,e){return e.decode?i(r):r}function a(r){return Array.isArray(r)?r.sort():"object"==typeof r?a(Object.keys(r)).sort(((r,e)=>Number(r)-Number(e))).map((e=>r[e])):r}function s(r){const e=r.indexOf("#");return-1!==e&&(r=r.slice(0,e)),r}function c(r){const e=(r=s(r)).indexOf("?");return-1===e?"":r.slice(e+1)}function u(r,e){return e.parseNumbers&&!Number.isNaN(Number(r))&&"string"==typeof r&&""!==r.trim()?r=Number(r):!e.parseBooleans||null===r||"true"!==r.toLowerCase()&&"false"!==r.toLowerCase()||(r="true"===r.toLowerCase()),r}function p(r,e){t((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const o=function(r){let e;switch(r.arrayFormat){case"index":return(r,t,o)=>{e=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),e?(void 0===o[r]&&(o[r]={}),o[r][e[1]]=t):o[r]=t};case"bracket":return(r,t,o)=>{e=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),e?void 0!==o[r]?o[r]=[].concat(o[r],t):o[r]=[t]:o[r]=t};case"comma":case"separator":return(e,t,o)=>{const a="string"==typeof t&&t.split("").indexOf(r.arrayFormatSeparator)>-1?t.split(r.arrayFormatSeparator).map((e=>n(e,r))):null===t?t:n(t,r);o[e]=a};default:return(r,e,t)=>{void 0!==t[r]?t[r]=[].concat(t[r],e):t[r]=e}}}(e),s=Object.create(null);if("string"!=typeof r)return s;if(!(r=r.trim().replace(/^[?#&]/,"")))return s;for(const t of r.split("&")){let[r,a]=l(e.decode?t.replace(/\+/g," "):t,"=");a=void 0===a?null:["comma","separator"].includes(e.arrayFormat)?a:n(a,e),o(n(r,e),a,s)}for(const r of Object.keys(s)){const t=s[r];if("object"==typeof t&&null!==t)for(const r of Object.keys(t))t[r]=u(t[r],e);else s[r]=u(t,e)}return!1===e.sort?s:(!0===e.sort?Object.keys(s).sort():Object.keys(s).sort(e.sort)).reduce(((r,e)=>{const t=s[e];return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)?r[e]=a(t):r[e]=t,r}),Object.create(null))}e.extract=c,e.parse=p,e.stringify=(r,e)=>{if(!r)return"";t((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const n=t=>e.skipNull&&null==r[t]||e.skipEmptyString&&""===r[t],a=function(r){switch(r.arrayFormat){case"index":return e=>(t,n)=>{const a=t.length;return void 0===n||r.skipNull&&null===n||r.skipEmptyString&&""===n?t:null===n?[...t,[o(e,r),"[",a,"]"].join("")]:[...t,[o(e,r),"[",o(a,r),"]=",o(n,r)].join("")]};case"bracket":return e=>(t,n)=>void 0===n||r.skipNull&&null===n||r.skipEmptyString&&""===n?t:null===n?[...t,[o(e,r),"[]"].join("")]:[...t,[o(e,r),"[]=",o(n,r)].join("")];case"comma":case"separator":return e=>(t,n)=>null==n||0===n.length?t:0===t.length?[[o(e,r),"=",o(n,r)].join("")]:[[t,o(n,r)].join(r.arrayFormatSeparator)];default:return e=>(t,n)=>void 0===n||r.skipNull&&null===n||r.skipEmptyString&&""===n?t:null===n?[...t,o(e,r)]:[...t,[o(e,r),"=",o(n,r)].join("")]}}(e),s={};for(const e of Object.keys(r))n(e)||(s[e]=r[e]);const c=Object.keys(s);return!1!==e.sort&&c.sort(e.sort),c.map((t=>{const n=r[t];return void 0===n?"":null===n?o(t,e):Array.isArray(n)?n.reduce(a(t),[]).join("&"):o(t,e)+"="+o(n,e)})).filter((r=>r.length>0)).join("&")},e.parseUrl=(r,e)=>({url:s(r).split("?")[0]||"",query:p(c(r),e)}),e.stringifyUrl=(r,t)=>{const o=s(r.url).split("?")[0]||"",n=e.extract(r.url),a=e.parse(n),c=function(r){let e="";const t=r.indexOf("#");return-1!==t&&(e=r.slice(t)),e}(r.url),i=Object.assign(a,r.query);let l=e.stringify(i,t);return l&&(l=`?${l}`),`${o}${l}${c}`}}));u.extract,u.parse,u.stringify,u.parseUrl,u.stringifyUrl;var p=["history"],f=function(t){var o=t.history,n=r(t,p);if(o){var a=o.location.search;o.replace({search:u.stringify(e(e({},u.parse(a)),n))})}else console.error("error","historyAppendSearch needs history")};f.propTypes={history:t.objectOf(t.any).isRequired};export{f as default};
1
+ import { b as _objectWithoutProperties, c as _objectSpread2 } from './_rollupPluginBabelHelpers-8dd26e1a.js';
2
+ import PropTypes from 'prop-types';
3
+
4
+ var queryString = {};
5
+
6
+ var strictUriEncode = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
7
+
8
+ var token = '%[a-f0-9]{2}';
9
+ var singleMatcher = new RegExp(token, 'gi');
10
+ var multiMatcher = new RegExp('(' + token + ')+', 'gi');
11
+
12
+ function decodeComponents(components, split) {
13
+ try {
14
+ // Try to decode the entire string first
15
+ return decodeURIComponent(components.join(''));
16
+ } catch (err) {
17
+ // Do nothing
18
+ }
19
+
20
+ if (components.length === 1) {
21
+ return components;
22
+ }
23
+
24
+ split = split || 1;
25
+
26
+ // Split the array in 2 parts
27
+ var left = components.slice(0, split);
28
+ var right = components.slice(split);
29
+
30
+ return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
31
+ }
32
+
33
+ function decode(input) {
34
+ try {
35
+ return decodeURIComponent(input);
36
+ } catch (err) {
37
+ var tokens = input.match(singleMatcher);
38
+
39
+ for (var i = 1; i < tokens.length; i++) {
40
+ input = decodeComponents(tokens, i).join('');
41
+
42
+ tokens = input.match(singleMatcher);
43
+ }
44
+
45
+ return input;
46
+ }
47
+ }
48
+
49
+ function customDecodeURIComponent(input) {
50
+ // Keep track of all the replacements and prefill the map with the `BOM`
51
+ var replaceMap = {
52
+ '%FE%FF': '\uFFFD\uFFFD',
53
+ '%FF%FE': '\uFFFD\uFFFD'
54
+ };
55
+
56
+ var match = multiMatcher.exec(input);
57
+ while (match) {
58
+ try {
59
+ // Decode as big chunks as possible
60
+ replaceMap[match[0]] = decodeURIComponent(match[0]);
61
+ } catch (err) {
62
+ var result = decode(match[0]);
63
+
64
+ if (result !== match[0]) {
65
+ replaceMap[match[0]] = result;
66
+ }
67
+ }
68
+
69
+ match = multiMatcher.exec(input);
70
+ }
71
+
72
+ // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
73
+ replaceMap['%C2'] = '\uFFFD';
74
+
75
+ var entries = Object.keys(replaceMap);
76
+
77
+ for (var i = 0; i < entries.length; i++) {
78
+ // Replace all decoded components
79
+ var key = entries[i];
80
+ input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
81
+ }
82
+
83
+ return input;
84
+ }
85
+
86
+ var decodeUriComponent = function (encodedURI) {
87
+ if (typeof encodedURI !== 'string') {
88
+ throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
89
+ }
90
+
91
+ try {
92
+ encodedURI = encodedURI.replace(/\+/g, ' ');
93
+
94
+ // Try the built in decoder first
95
+ return decodeURIComponent(encodedURI);
96
+ } catch (err) {
97
+ // Fallback to a more advanced decoder
98
+ return customDecodeURIComponent(encodedURI);
99
+ }
100
+ };
101
+
102
+ var splitOnFirst = (string, separator) => {
103
+ if (!(typeof string === 'string' && typeof separator === 'string')) {
104
+ throw new TypeError('Expected the arguments to be of type `string`');
105
+ }
106
+
107
+ if (separator === '') {
108
+ return [string];
109
+ }
110
+
111
+ const separatorIndex = string.indexOf(separator);
112
+
113
+ if (separatorIndex === -1) {
114
+ return [string];
115
+ }
116
+
117
+ return [
118
+ string.slice(0, separatorIndex),
119
+ string.slice(separatorIndex + separator.length)
120
+ ];
121
+ };
122
+
123
+ (function (exports) {
124
+ const strictUriEncode$1 = strictUriEncode;
125
+ const decodeComponent = decodeUriComponent;
126
+ const splitOnFirst$1 = splitOnFirst;
127
+
128
+ const isNullOrUndefined = value => value === null || value === undefined;
129
+
130
+ function encoderForArrayFormat(options) {
131
+ switch (options.arrayFormat) {
132
+ case 'index':
133
+ return key => (result, value) => {
134
+ const index = result.length;
135
+
136
+ if (
137
+ value === undefined ||
138
+ (options.skipNull && value === null) ||
139
+ (options.skipEmptyString && value === '')
140
+ ) {
141
+ return result;
142
+ }
143
+
144
+ if (value === null) {
145
+ return [...result, [encode(key, options), '[', index, ']'].join('')];
146
+ }
147
+
148
+ return [
149
+ ...result,
150
+ [encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')
151
+ ];
152
+ };
153
+
154
+ case 'bracket':
155
+ return key => (result, value) => {
156
+ if (
157
+ value === undefined ||
158
+ (options.skipNull && value === null) ||
159
+ (options.skipEmptyString && value === '')
160
+ ) {
161
+ return result;
162
+ }
163
+
164
+ if (value === null) {
165
+ return [...result, [encode(key, options), '[]'].join('')];
166
+ }
167
+
168
+ return [...result, [encode(key, options), '[]=', encode(value, options)].join('')];
169
+ };
170
+
171
+ case 'comma':
172
+ case 'separator':
173
+ return key => (result, value) => {
174
+ if (value === null || value === undefined || value.length === 0) {
175
+ return result;
176
+ }
177
+
178
+ if (result.length === 0) {
179
+ return [[encode(key, options), '=', encode(value, options)].join('')];
180
+ }
181
+
182
+ return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
183
+ };
184
+
185
+ default:
186
+ return key => (result, value) => {
187
+ if (
188
+ value === undefined ||
189
+ (options.skipNull && value === null) ||
190
+ (options.skipEmptyString && value === '')
191
+ ) {
192
+ return result;
193
+ }
194
+
195
+ if (value === null) {
196
+ return [...result, encode(key, options)];
197
+ }
198
+
199
+ return [...result, [encode(key, options), '=', encode(value, options)].join('')];
200
+ };
201
+ }
202
+ }
203
+
204
+ function parserForArrayFormat(options) {
205
+ let result;
206
+
207
+ switch (options.arrayFormat) {
208
+ case 'index':
209
+ return (key, value, accumulator) => {
210
+ result = /\[(\d*)\]$/.exec(key);
211
+
212
+ key = key.replace(/\[\d*\]$/, '');
213
+
214
+ if (!result) {
215
+ accumulator[key] = value;
216
+ return;
217
+ }
218
+
219
+ if (accumulator[key] === undefined) {
220
+ accumulator[key] = {};
221
+ }
222
+
223
+ accumulator[key][result[1]] = value;
224
+ };
225
+
226
+ case 'bracket':
227
+ return (key, value, accumulator) => {
228
+ result = /(\[\])$/.exec(key);
229
+ key = key.replace(/\[\]$/, '');
230
+
231
+ if (!result) {
232
+ accumulator[key] = value;
233
+ return;
234
+ }
235
+
236
+ if (accumulator[key] === undefined) {
237
+ accumulator[key] = [value];
238
+ return;
239
+ }
240
+
241
+ accumulator[key] = [].concat(accumulator[key], value);
242
+ };
243
+
244
+ case 'comma':
245
+ case 'separator':
246
+ return (key, value, accumulator) => {
247
+ const isArray = typeof value === 'string' && value.split('').indexOf(options.arrayFormatSeparator) > -1;
248
+ const newValue = isArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);
249
+ accumulator[key] = newValue;
250
+ };
251
+
252
+ default:
253
+ return (key, value, accumulator) => {
254
+ if (accumulator[key] === undefined) {
255
+ accumulator[key] = value;
256
+ return;
257
+ }
258
+
259
+ accumulator[key] = [].concat(accumulator[key], value);
260
+ };
261
+ }
262
+ }
263
+
264
+ function validateArrayFormatSeparator(value) {
265
+ if (typeof value !== 'string' || value.length !== 1) {
266
+ throw new TypeError('arrayFormatSeparator must be single character string');
267
+ }
268
+ }
269
+
270
+ function encode(value, options) {
271
+ if (options.encode) {
272
+ return options.strict ? strictUriEncode$1(value) : encodeURIComponent(value);
273
+ }
274
+
275
+ return value;
276
+ }
277
+
278
+ function decode(value, options) {
279
+ if (options.decode) {
280
+ return decodeComponent(value);
281
+ }
282
+
283
+ return value;
284
+ }
285
+
286
+ function keysSorter(input) {
287
+ if (Array.isArray(input)) {
288
+ return input.sort();
289
+ }
290
+
291
+ if (typeof input === 'object') {
292
+ return keysSorter(Object.keys(input))
293
+ .sort((a, b) => Number(a) - Number(b))
294
+ .map(key => input[key]);
295
+ }
296
+
297
+ return input;
298
+ }
299
+
300
+ function removeHash(input) {
301
+ const hashStart = input.indexOf('#');
302
+ if (hashStart !== -1) {
303
+ input = input.slice(0, hashStart);
304
+ }
305
+
306
+ return input;
307
+ }
308
+
309
+ function getHash(url) {
310
+ let hash = '';
311
+ const hashStart = url.indexOf('#');
312
+ if (hashStart !== -1) {
313
+ hash = url.slice(hashStart);
314
+ }
315
+
316
+ return hash;
317
+ }
318
+
319
+ function extract(input) {
320
+ input = removeHash(input);
321
+ const queryStart = input.indexOf('?');
322
+ if (queryStart === -1) {
323
+ return '';
324
+ }
325
+
326
+ return input.slice(queryStart + 1);
327
+ }
328
+
329
+ function parseValue(value, options) {
330
+ if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {
331
+ value = Number(value);
332
+ } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
333
+ value = value.toLowerCase() === 'true';
334
+ }
335
+
336
+ return value;
337
+ }
338
+
339
+ function parse(input, options) {
340
+ options = Object.assign({
341
+ decode: true,
342
+ sort: true,
343
+ arrayFormat: 'none',
344
+ arrayFormatSeparator: ',',
345
+ parseNumbers: false,
346
+ parseBooleans: false
347
+ }, options);
348
+
349
+ validateArrayFormatSeparator(options.arrayFormatSeparator);
350
+
351
+ const formatter = parserForArrayFormat(options);
352
+
353
+ // Create an object with no prototype
354
+ const ret = Object.create(null);
355
+
356
+ if (typeof input !== 'string') {
357
+ return ret;
358
+ }
359
+
360
+ input = input.trim().replace(/^[?#&]/, '');
361
+
362
+ if (!input) {
363
+ return ret;
364
+ }
365
+
366
+ for (const param of input.split('&')) {
367
+ let [key, value] = splitOnFirst$1(options.decode ? param.replace(/\+/g, ' ') : param, '=');
368
+
369
+ // Missing `=` should be `null`:
370
+ // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
371
+ value = value === undefined ? null : ['comma', 'separator'].includes(options.arrayFormat) ? value : decode(value, options);
372
+ formatter(decode(key, options), value, ret);
373
+ }
374
+
375
+ for (const key of Object.keys(ret)) {
376
+ const value = ret[key];
377
+ if (typeof value === 'object' && value !== null) {
378
+ for (const k of Object.keys(value)) {
379
+ value[k] = parseValue(value[k], options);
380
+ }
381
+ } else {
382
+ ret[key] = parseValue(value, options);
383
+ }
384
+ }
385
+
386
+ if (options.sort === false) {
387
+ return ret;
388
+ }
389
+
390
+ return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
391
+ const value = ret[key];
392
+ if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {
393
+ // Sort object keys, not values
394
+ result[key] = keysSorter(value);
395
+ } else {
396
+ result[key] = value;
397
+ }
398
+
399
+ return result;
400
+ }, Object.create(null));
401
+ }
402
+
403
+ exports.extract = extract;
404
+ exports.parse = parse;
405
+
406
+ exports.stringify = (object, options) => {
407
+ if (!object) {
408
+ return '';
409
+ }
410
+
411
+ options = Object.assign({
412
+ encode: true,
413
+ strict: true,
414
+ arrayFormat: 'none',
415
+ arrayFormatSeparator: ','
416
+ }, options);
417
+
418
+ validateArrayFormatSeparator(options.arrayFormatSeparator);
419
+
420
+ const shouldFilter = key => (
421
+ (options.skipNull && isNullOrUndefined(object[key])) ||
422
+ (options.skipEmptyString && object[key] === '')
423
+ );
424
+
425
+ const formatter = encoderForArrayFormat(options);
426
+
427
+ const objectCopy = {};
428
+
429
+ for (const key of Object.keys(object)) {
430
+ if (!shouldFilter(key)) {
431
+ objectCopy[key] = object[key];
432
+ }
433
+ }
434
+
435
+ const keys = Object.keys(objectCopy);
436
+
437
+ if (options.sort !== false) {
438
+ keys.sort(options.sort);
439
+ }
440
+
441
+ return keys.map(key => {
442
+ const value = object[key];
443
+
444
+ if (value === undefined) {
445
+ return '';
446
+ }
447
+
448
+ if (value === null) {
449
+ return encode(key, options);
450
+ }
451
+
452
+ if (Array.isArray(value)) {
453
+ return value
454
+ .reduce(formatter(key), [])
455
+ .join('&');
456
+ }
457
+
458
+ return encode(key, options) + '=' + encode(value, options);
459
+ }).filter(x => x.length > 0).join('&');
460
+ };
461
+
462
+ exports.parseUrl = (input, options) => {
463
+ return {
464
+ url: removeHash(input).split('?')[0] || '',
465
+ query: parse(extract(input), options)
466
+ };
467
+ };
468
+
469
+ exports.stringifyUrl = (input, options) => {
470
+ const url = removeHash(input.url).split('?')[0] || '';
471
+ const queryFromUrl = exports.extract(input.url);
472
+ const parsedQueryFromUrl = exports.parse(queryFromUrl);
473
+ const hash = getHash(input.url);
474
+ const query = Object.assign(parsedQueryFromUrl, input.query);
475
+ let queryString = exports.stringify(query, options);
476
+ if (queryString) {
477
+ queryString = `?${queryString}`;
478
+ }
479
+
480
+ return `${url}${queryString}${hash}`;
481
+ };
482
+ } (queryString));
483
+
484
+ var _excluded = ["history"];
485
+ var historyAppendSearch = function historyAppendSearch(_ref) {
486
+ var history = _ref.history,
487
+ rest = _objectWithoutProperties(_ref, _excluded);
488
+ if (history) {
489
+ var search = history.location.search;
490
+ history.replace({
491
+ search: queryString.stringify(_objectSpread2(_objectSpread2({}, queryString.parse(search)), rest))
492
+ });
493
+ } else {
494
+ console.error('error', 'historyAppendSearch needs history');
495
+ }
496
+ };
497
+ historyAppendSearch.propTypes = {
498
+ /** react-router-dom 的 history */
499
+ history: PropTypes.objectOf(PropTypes.any).isRequired
500
+ };
501
+
502
+ export { historyAppendSearch as default };
@@ -1 +1,5 @@
1
- var o=function(){return"localhost"===window.location||!1};export{o as default};
1
+ var isDevelopMode = function isDevelopMode() {
2
+ return window.location === 'localhost' || "production" === 'development';
3
+ };
4
+
5
+ export { isDevelopMode as default };
@@ -1 +1,36 @@
1
- var t=function(t){var a="",n=t.split("-"),r=parseInt(n[0],10);r<=0?r=1911:a=r.toString();var o=parseInt(n[1],10);o<=0||o>12?o=1:a="".concat(a,"-").concat(o.toString());var c=parseInt(n[2],10);return c<=0||c>31?c=1:a="".concat(a,"-").concat(c.toString()),{year:r,month:o,day:c,displayDate:a}};export{t as default};
1
+ var parseYMD = function parseYMD(date) {
2
+ var displayDate = '';
3
+ var ymd = date.split('-');
4
+
5
+ // year
6
+ var year = parseInt(ymd[0], 10);
7
+ if (year <= 0) {
8
+ year = 1911;
9
+ } else {
10
+ displayDate = year.toString();
11
+ }
12
+
13
+ // month
14
+ var month = parseInt(ymd[1], 10);
15
+ if (month <= 0 || month > 12) {
16
+ month = 1;
17
+ } else {
18
+ displayDate = "".concat(displayDate, "-").concat(month.toString());
19
+ }
20
+
21
+ // day
22
+ var day = parseInt(ymd[2], 10);
23
+ if (day <= 0 || day > 31) {
24
+ day = 1;
25
+ } else {
26
+ displayDate = "".concat(displayDate, "-").concat(day.toString());
27
+ }
28
+ return {
29
+ year: year,
30
+ month: month,
31
+ day: day,
32
+ displayDate: displayDate
33
+ };
34
+ };
35
+
36
+ export { parseYMD as default };
@@ -1 +1,11 @@
1
- var r=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value";return Array.isArray(r)?r.filter((function(r,t,e){return e.findIndex((function(t){return t[n]===r[n]}))===t})):[]};export{r as default};
1
+ var removeDuplicateItem = function removeDuplicateItem(array) {
2
+ var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';
3
+ if (Array.isArray(array)) return array.filter(function (v, i, a) {
4
+ return a.findIndex(function (t) {
5
+ return t[key] === v[key];
6
+ }) === i;
7
+ });
8
+ return [];
9
+ };
10
+
11
+ export { removeDuplicateItem as default };
@@ -1 +1,39 @@
1
- import r from"axios";var e=function(e,t,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;r.defaults.timeout=o;try{return r.post(t,{sendMail:e}).then((function(r){return a({state:r&&200===r.status})})).catch((function(r){return console.error("api:axios:catch:error: ",r.message),{state:!1,error:r.message}}))}catch(r){return console.error("api:axios:try:catch:error: ",r.message),{state:!1,error:r.message}}};export{e as default};
1
+ import axios from 'axios';
2
+
3
+ // const sendMail = {
4
+ // from: "orient.cc.noreply@gmail.com",
5
+ // to: email,
6
+ // subject: `ATC_${card_id}`+" card status has been changed (Orient-CC)",
7
+ // text: context,
8
+ // };
9
+ //
10
+ // apiUrl: "https://api.daoyidh.com/mail"
11
+ var sendEmail = function sendEmail(sendMail, apiUrl, onSuccess) {
12
+ var timeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10000;
13
+ // timeout
14
+ axios.defaults.timeout = timeout;
15
+ try {
16
+ // axios api
17
+ return axios.post(apiUrl, {
18
+ sendMail: sendMail
19
+ }).then(function (res) {
20
+ return onSuccess({
21
+ state: res && res.status === 200
22
+ });
23
+ }).catch(function (err) {
24
+ console.error('api:axios:catch:error: ', err.message);
25
+ return {
26
+ state: false,
27
+ error: err.message
28
+ };
29
+ });
30
+ } catch (err) {
31
+ console.error('api:axios:try:catch:error: ', err.message);
32
+ return {
33
+ state: false,
34
+ error: err.message
35
+ };
36
+ }
37
+ };
38
+
39
+ export { sendEmail as default };
@@ -0,0 +1,5 @@
1
+ var snaDefine = {
2
+ mainNode: 'mainNode'
3
+ };
4
+
5
+ export { snaDefine as s };
@@ -1 +1 @@
1
- var a={mainNode:"mainNode"};export{a as default};
1
+ export { s as default } from './snaDefine-6a2bcd94.js';