@daoyi/nmtl-ui 2.0.1-beta.52 → 2.0.1-beta.53
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/lib/components/Autocomplete-3dae80ca.js +335 -0
- package/lib/components/Autocomplete.js +13 -0
- package/lib/components/Avatar.js +49 -0
- package/lib/components/BackTop.js +109 -0
- package/lib/components/BarChart.js +762 -0
- package/lib/components/Breadcrumbs.js +122 -0
- package/lib/components/Button-433372aa.js +92 -0
- package/lib/components/Button.js +6 -0
- package/lib/components/Carousel.js +4654 -0
- package/lib/components/Checkbox.js +37 -0
- package/lib/components/CollapseContent.js +179 -0
- package/lib/components/ContactModal-66bcb5d3.js +10779 -0
- package/lib/components/ContactModal.js +22 -0
- package/lib/components/Drawer-df3535c2.js +157 -0
- package/lib/components/Drawer.js +11 -0
- package/lib/components/Dropdown.js +134 -0
- package/lib/components/Empty-7318f658.js +45 -0
- package/lib/components/Empty.js +5 -0
- package/lib/components/ExportButton.js +112 -0
- package/lib/components/ExtraTools-b0bb9399.js +3537 -0
- package/lib/components/ExtraTools.js +10 -0
- package/lib/components/Filter.js +776 -0
- package/lib/components/Footer.js +271 -0
- package/lib/components/ForwardLink-0571e627.js +105 -0
- package/lib/components/ForwardLink.js +9 -0
- package/lib/components/Header.js +187 -0
- package/lib/components/Image.js +61 -0
- package/lib/components/Input.js +77 -0
- package/lib/components/InputMethod.js +33963 -0
- package/lib/components/KeywordSearch-568a8a44.js +139 -0
- package/lib/components/KeywordSearch.js +15 -0
- package/lib/components/KeywordTicker.js +190 -0
- package/lib/components/Keywords.js +317 -0
- package/lib/components/Loading.js +28 -0
- package/lib/components/MUITheme.js +2627 -0
- package/lib/components/Modal-64c4ab0d.js +108 -0
- package/lib/components/Modal.js +9 -0
- package/lib/components/MoreButton-6654cc5b.js +110 -0
- package/lib/components/MoreButton.js +6 -0
- package/lib/components/Radio.js +78 -0
- package/lib/components/SNA.js +1691 -0
- package/lib/components/Select-113372b2.js +115 -0
- package/lib/components/Select.js +8 -0
- package/lib/components/Spin-8a5a600d.js +75 -0
- package/lib/components/Spin.js +6 -0
- package/lib/components/Table.js +51 -0
- package/lib/components/Tooltip-abe1205f.js +70 -0
- package/lib/components/Tooltip.js +7 -0
- package/lib/components/_commonjsHelpers-70de2c37.js +28 -0
- package/lib/components/_rollupPluginBabelHelpers-3d9c8289.js +478 -0
- package/lib/components/createSvgIcon-a79ae4b1.js +576 -0
- package/lib/components/dataExport-d55d6fa3.js +92 -0
- package/lib/components/debounce-127da66c.js +355 -0
- package/lib/components/defaultTheme-19a14721.js +1485 -0
- package/lib/components/globalConfig.js +172 -0
- package/lib/components/hoist-non-react-statics.cjs-3f408ad2.js +105 -0
- package/lib/components/index-66babe67.js +61 -0
- package/lib/components/index-fdcc884e.js +481 -0
- package/lib/components/isObjectLike-e111475d.js +190 -0
- package/lib/components/style-inject.es-1f59c1d0.js +28 -0
- package/lib/components/transform-3a04288b.js +5475 -0
- package/lib/index.d.ts +36 -0
- package/lib/index.js +36 -0
- package/lib/utils/_rollupPluginBabelHelpers-8dd26e1a.js +121 -0
- package/lib/utils/arrayMerge.js +100 -0
- package/lib/utils/chunkArray.js +15 -0
- package/lib/utils/convert2HtmlEntities.js +42 -0
- package/lib/utils/domToImage.js +802 -0
- package/lib/utils/downloadGephi.js +106 -0
- package/lib/utils/exportXlsx.js +219 -0
- package/lib/utils/historyAppendSearch.js +502 -0
- package/lib/utils/index.d.ts +13 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/isDevelopMode.js +5 -0
- package/lib/utils/parseYMD.js +36 -0
- package/lib/utils/removeDuplicateItem.js +11 -0
- package/lib/utils/sendEmail.js +39 -0
- package/lib/utils/snaDefine-6a2bcd94.js +5 -0
- package/lib/utils/snaDefine.js +1 -0
- package/lib/utils/snaPreProcess.js +84 -0
- package/package.json +1 -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,190 @@
|
|
|
1
|
+
import { c as commonjsGlobal } from './_commonjsHelpers-70de2c37.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if `value` is the
|
|
5
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
6
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
7
|
+
*
|
|
8
|
+
* @static
|
|
9
|
+
* @memberOf _
|
|
10
|
+
* @since 0.1.0
|
|
11
|
+
* @category Lang
|
|
12
|
+
* @param {*} value The value to check.
|
|
13
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* _.isObject({});
|
|
17
|
+
* // => true
|
|
18
|
+
*
|
|
19
|
+
* _.isObject([1, 2, 3]);
|
|
20
|
+
* // => true
|
|
21
|
+
*
|
|
22
|
+
* _.isObject(_.noop);
|
|
23
|
+
* // => true
|
|
24
|
+
*
|
|
25
|
+
* _.isObject(null);
|
|
26
|
+
* // => false
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
function isObject(value) {
|
|
30
|
+
var type = typeof value;
|
|
31
|
+
return value != null && (type == 'object' || type == 'function');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var isObject_1 = isObject;
|
|
35
|
+
|
|
36
|
+
/** Detect free variable `global` from Node.js. */
|
|
37
|
+
|
|
38
|
+
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
39
|
+
|
|
40
|
+
var _freeGlobal = freeGlobal$1;
|
|
41
|
+
|
|
42
|
+
var freeGlobal = _freeGlobal;
|
|
43
|
+
|
|
44
|
+
/** Detect free variable `self`. */
|
|
45
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
46
|
+
|
|
47
|
+
/** Used as a reference to the global object. */
|
|
48
|
+
var root$1 = freeGlobal || freeSelf || Function('return this')();
|
|
49
|
+
|
|
50
|
+
var _root = root$1;
|
|
51
|
+
|
|
52
|
+
var root = _root;
|
|
53
|
+
|
|
54
|
+
/** Built-in value references. */
|
|
55
|
+
var Symbol$2 = root.Symbol;
|
|
56
|
+
|
|
57
|
+
var _Symbol = Symbol$2;
|
|
58
|
+
|
|
59
|
+
var Symbol$1 = _Symbol;
|
|
60
|
+
|
|
61
|
+
/** Used for built-in method references. */
|
|
62
|
+
var objectProto$1 = Object.prototype;
|
|
63
|
+
|
|
64
|
+
/** Used to check objects for own properties. */
|
|
65
|
+
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Used to resolve the
|
|
69
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
70
|
+
* of values.
|
|
71
|
+
*/
|
|
72
|
+
var nativeObjectToString$1 = objectProto$1.toString;
|
|
73
|
+
|
|
74
|
+
/** Built-in value references. */
|
|
75
|
+
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
79
|
+
*
|
|
80
|
+
* @private
|
|
81
|
+
* @param {*} value The value to query.
|
|
82
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
83
|
+
*/
|
|
84
|
+
function getRawTag$1(value) {
|
|
85
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag$1),
|
|
86
|
+
tag = value[symToStringTag$1];
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
value[symToStringTag$1] = undefined;
|
|
90
|
+
var unmasked = true;
|
|
91
|
+
} catch (e) {}
|
|
92
|
+
|
|
93
|
+
var result = nativeObjectToString$1.call(value);
|
|
94
|
+
if (unmasked) {
|
|
95
|
+
if (isOwn) {
|
|
96
|
+
value[symToStringTag$1] = tag;
|
|
97
|
+
} else {
|
|
98
|
+
delete value[symToStringTag$1];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
var _getRawTag = getRawTag$1;
|
|
105
|
+
|
|
106
|
+
/** Used for built-in method references. */
|
|
107
|
+
|
|
108
|
+
var objectProto = Object.prototype;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Used to resolve the
|
|
112
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
113
|
+
* of values.
|
|
114
|
+
*/
|
|
115
|
+
var nativeObjectToString = objectProto.toString;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
119
|
+
*
|
|
120
|
+
* @private
|
|
121
|
+
* @param {*} value The value to convert.
|
|
122
|
+
* @returns {string} Returns the converted string.
|
|
123
|
+
*/
|
|
124
|
+
function objectToString$1(value) {
|
|
125
|
+
return nativeObjectToString.call(value);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
var _objectToString = objectToString$1;
|
|
129
|
+
|
|
130
|
+
var Symbol = _Symbol,
|
|
131
|
+
getRawTag = _getRawTag,
|
|
132
|
+
objectToString = _objectToString;
|
|
133
|
+
|
|
134
|
+
/** `Object#toString` result references. */
|
|
135
|
+
var nullTag = '[object Null]',
|
|
136
|
+
undefinedTag = '[object Undefined]';
|
|
137
|
+
|
|
138
|
+
/** Built-in value references. */
|
|
139
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
143
|
+
*
|
|
144
|
+
* @private
|
|
145
|
+
* @param {*} value The value to query.
|
|
146
|
+
* @returns {string} Returns the `toStringTag`.
|
|
147
|
+
*/
|
|
148
|
+
function baseGetTag(value) {
|
|
149
|
+
if (value == null) {
|
|
150
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
151
|
+
}
|
|
152
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
153
|
+
? getRawTag(value)
|
|
154
|
+
: objectToString(value);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
var _baseGetTag = baseGetTag;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
161
|
+
* and has a `typeof` result of "object".
|
|
162
|
+
*
|
|
163
|
+
* @static
|
|
164
|
+
* @memberOf _
|
|
165
|
+
* @since 4.0.0
|
|
166
|
+
* @category Lang
|
|
167
|
+
* @param {*} value The value to check.
|
|
168
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
169
|
+
* @example
|
|
170
|
+
*
|
|
171
|
+
* _.isObjectLike({});
|
|
172
|
+
* // => true
|
|
173
|
+
*
|
|
174
|
+
* _.isObjectLike([1, 2, 3]);
|
|
175
|
+
* // => true
|
|
176
|
+
*
|
|
177
|
+
* _.isObjectLike(_.noop);
|
|
178
|
+
* // => false
|
|
179
|
+
*
|
|
180
|
+
* _.isObjectLike(null);
|
|
181
|
+
* // => false
|
|
182
|
+
*/
|
|
183
|
+
|
|
184
|
+
function isObjectLike(value) {
|
|
185
|
+
return value != null && typeof value == 'object';
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
var isObjectLike_1 = isObjectLike;
|
|
189
|
+
|
|
190
|
+
export { _root as _, _baseGetTag as a, isObject_1 as b, _freeGlobal as c, isObjectLike_1 as i };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function styleInject(css, ref) {
|
|
2
|
+
if ( ref === void 0 ) ref = {};
|
|
3
|
+
var insertAt = ref.insertAt;
|
|
4
|
+
|
|
5
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
6
|
+
|
|
7
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
8
|
+
var style = document.createElement('style');
|
|
9
|
+
style.type = 'text/css';
|
|
10
|
+
|
|
11
|
+
if (insertAt === 'top') {
|
|
12
|
+
if (head.firstChild) {
|
|
13
|
+
head.insertBefore(style, head.firstChild);
|
|
14
|
+
} else {
|
|
15
|
+
head.appendChild(style);
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
head.appendChild(style);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (style.styleSheet) {
|
|
22
|
+
style.styleSheet.cssText = css;
|
|
23
|
+
} else {
|
|
24
|
+
style.appendChild(document.createTextNode(css));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { styleInject as s };
|