@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,576 @@
1
+ import { g as getAugmentedNamespace } from './_commonjsHelpers-70de2c37.js';
2
+ import { f as formatMuiErrorMessage, _ as _extends, d as defaultTheme, a as _objectWithoutProperties } from './defaultTheme-5839b9b3.js';
3
+ import 'prop-types';
4
+ import 'react-is';
5
+ import * as React from 'react';
6
+ import React__default from 'react';
7
+ import { withStyles as withStyles$1 } from '@material-ui/styles';
8
+ import * as ReactDOM from 'react-dom';
9
+
10
+ var interopRequireDefault = {exports: {}};
11
+
12
+ (function (module) {
13
+ function _interopRequireDefault(obj) {
14
+ return obj && obj.__esModule ? obj : {
15
+ "default": obj
16
+ };
17
+ }
18
+ module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
19
+ } (interopRequireDefault));
20
+
21
+ var interopRequireWildcard = {exports: {}};
22
+
23
+ var _typeof = {exports: {}};
24
+
25
+ (function (module) {
26
+ function _typeof(obj) {
27
+ "@babel/helpers - typeof";
28
+
29
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
30
+ return typeof obj;
31
+ } : function (obj) {
32
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
33
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
34
+ }
35
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
36
+ } (_typeof));
37
+
38
+ (function (module) {
39
+ var _typeof$1 = _typeof.exports["default"];
40
+ function _getRequireWildcardCache(nodeInterop) {
41
+ if (typeof WeakMap !== "function") return null;
42
+ var cacheBabelInterop = new WeakMap();
43
+ var cacheNodeInterop = new WeakMap();
44
+ return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
45
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
46
+ })(nodeInterop);
47
+ }
48
+ function _interopRequireWildcard(obj, nodeInterop) {
49
+ if (!nodeInterop && obj && obj.__esModule) {
50
+ return obj;
51
+ }
52
+ if (obj === null || _typeof$1(obj) !== "object" && typeof obj !== "function") {
53
+ return {
54
+ "default": obj
55
+ };
56
+ }
57
+ var cache = _getRequireWildcardCache(nodeInterop);
58
+ if (cache && cache.has(obj)) {
59
+ return cache.get(obj);
60
+ }
61
+ var newObj = {};
62
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
63
+ for (var key in obj) {
64
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
65
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
66
+ if (desc && (desc.get || desc.set)) {
67
+ Object.defineProperty(newObj, key, desc);
68
+ } else {
69
+ newObj[key] = obj[key];
70
+ }
71
+ }
72
+ }
73
+ newObj["default"] = obj;
74
+ if (cache) {
75
+ cache.set(obj, newObj);
76
+ }
77
+ return newObj;
78
+ }
79
+ module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports["default"] = module.exports;
80
+ } (interopRequireWildcard));
81
+
82
+ var createSvgIcon$1 = {};
83
+
84
+ // It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
85
+ //
86
+ // A strict capitalization should uppercase the first letter of each word a the sentence.
87
+ // We only handle the first word.
88
+ function capitalize(string) {
89
+ if (typeof string !== 'string') {
90
+ throw new Error(formatMuiErrorMessage(7));
91
+ }
92
+
93
+ return string.charAt(0).toUpperCase() + string.slice(1);
94
+ }
95
+
96
+ /**
97
+ * Safe chained function
98
+ *
99
+ * Will only create a new function if needed,
100
+ * otherwise will pass back existing functions or null.
101
+ *
102
+ * @param {function} functions to chain
103
+ * @returns {function|null}
104
+ */
105
+ function createChainedFunction() {
106
+ for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
107
+ funcs[_key] = arguments[_key];
108
+ }
109
+
110
+ return funcs.reduce(function (acc, func) {
111
+ if (func == null) {
112
+ return acc;
113
+ }
114
+
115
+ return function chainedFunction() {
116
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
117
+ args[_key2] = arguments[_key2];
118
+ }
119
+
120
+ acc.apply(this, args);
121
+ func.apply(this, args);
122
+ };
123
+ }, function () {});
124
+ }
125
+
126
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
127
+
128
+ function withStyles(stylesOrCreator, options) {
129
+ return withStyles$1(stylesOrCreator, _extends({
130
+ defaultTheme: defaultTheme
131
+ }, options));
132
+ }
133
+
134
+ var styles = function styles(theme) {
135
+ return {
136
+ /* Styles applied to the root element. */
137
+ root: {
138
+ userSelect: 'none',
139
+ width: '1em',
140
+ height: '1em',
141
+ display: 'inline-block',
142
+ fill: 'currentColor',
143
+ flexShrink: 0,
144
+ fontSize: theme.typography.pxToRem(24),
145
+ transition: theme.transitions.create('fill', {
146
+ duration: theme.transitions.duration.shorter
147
+ })
148
+ },
149
+
150
+ /* Styles applied to the root element if `color="primary"`. */
151
+ colorPrimary: {
152
+ color: theme.palette.primary.main
153
+ },
154
+
155
+ /* Styles applied to the root element if `color="secondary"`. */
156
+ colorSecondary: {
157
+ color: theme.palette.secondary.main
158
+ },
159
+
160
+ /* Styles applied to the root element if `color="action"`. */
161
+ colorAction: {
162
+ color: theme.palette.action.active
163
+ },
164
+
165
+ /* Styles applied to the root element if `color="error"`. */
166
+ colorError: {
167
+ color: theme.palette.error.main
168
+ },
169
+
170
+ /* Styles applied to the root element if `color="disabled"`. */
171
+ colorDisabled: {
172
+ color: theme.palette.action.disabled
173
+ },
174
+
175
+ /* Styles applied to the root element if `fontSize="inherit"`. */
176
+ fontSizeInherit: {
177
+ fontSize: 'inherit'
178
+ },
179
+
180
+ /* Styles applied to the root element if `fontSize="small"`. */
181
+ fontSizeSmall: {
182
+ fontSize: theme.typography.pxToRem(20)
183
+ },
184
+
185
+ /* Styles applied to the root element if `fontSize="large"`. */
186
+ fontSizeLarge: {
187
+ fontSize: theme.typography.pxToRem(35)
188
+ }
189
+ };
190
+ };
191
+ var SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(props, ref) {
192
+ var children = props.children,
193
+ classes = props.classes,
194
+ className = props.className,
195
+ _props$color = props.color,
196
+ color = _props$color === void 0 ? 'inherit' : _props$color,
197
+ _props$component = props.component,
198
+ Component = _props$component === void 0 ? 'svg' : _props$component,
199
+ _props$fontSize = props.fontSize,
200
+ fontSize = _props$fontSize === void 0 ? 'medium' : _props$fontSize,
201
+ htmlColor = props.htmlColor,
202
+ titleAccess = props.titleAccess,
203
+ _props$viewBox = props.viewBox,
204
+ viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox,
205
+ other = _objectWithoutProperties(props, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]);
206
+
207
+ return /*#__PURE__*/React.createElement(Component, _extends({
208
+ className: clsx(classes.root, className, color !== 'inherit' && classes["color".concat(capitalize(color))], fontSize !== 'default' && fontSize !== 'medium' && classes["fontSize".concat(capitalize(fontSize))]),
209
+ focusable: "false",
210
+ viewBox: viewBox,
211
+ color: htmlColor,
212
+ "aria-hidden": titleAccess ? undefined : true,
213
+ role: titleAccess ? 'img' : undefined,
214
+ ref: ref
215
+ }, other), children, titleAccess ? /*#__PURE__*/React.createElement("title", null, titleAccess) : null);
216
+ });
217
+ SvgIcon.muiName = 'SvgIcon';
218
+ var SvgIcon$1 = withStyles(styles, {
219
+ name: 'MuiSvgIcon'
220
+ })(SvgIcon);
221
+
222
+ /**
223
+ * Private module reserved for @material-ui/x packages.
224
+ */
225
+
226
+ function createSvgIcon(path, displayName) {
227
+ var Component = function Component(props, ref) {
228
+ return /*#__PURE__*/React__default.createElement(SvgIcon$1, _extends({
229
+ ref: ref
230
+ }, props), path);
231
+ };
232
+
233
+ Component.muiName = SvgIcon$1.muiName;
234
+ return /*#__PURE__*/React__default.memo( /*#__PURE__*/React__default.forwardRef(Component));
235
+ }
236
+
237
+ // Corresponds to 10 frames at 60 Hz.
238
+ // A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
239
+ function debounce(func) {
240
+ var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;
241
+ var timeout;
242
+
243
+ function debounced() {
244
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
245
+ args[_key] = arguments[_key];
246
+ }
247
+
248
+ // eslint-disable-next-line consistent-this
249
+ var that = this;
250
+
251
+ var later = function later() {
252
+ func.apply(that, args);
253
+ };
254
+
255
+ clearTimeout(timeout);
256
+ timeout = setTimeout(later, wait);
257
+ }
258
+
259
+ debounced.clear = function () {
260
+ clearTimeout(timeout);
261
+ };
262
+
263
+ return debounced;
264
+ }
265
+
266
+ function deprecatedPropType(validator, reason) {
267
+ {
268
+ return function () {
269
+ return null;
270
+ };
271
+ }
272
+ }
273
+
274
+ function isMuiElement(element, muiNames) {
275
+ return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;
276
+ }
277
+
278
+ function ownerDocument(node) {
279
+ return node && node.ownerDocument || document;
280
+ }
281
+
282
+ function ownerWindow(node) {
283
+ var doc = ownerDocument(node);
284
+ return doc.defaultView || window;
285
+ }
286
+
287
+ function requirePropFactory(componentNameInError) {
288
+ {
289
+ return function () {
290
+ return null;
291
+ };
292
+ }
293
+ }
294
+
295
+ // TODO v5: consider to make it private
296
+ function setRef(ref, value) {
297
+ if (typeof ref === 'function') {
298
+ ref(value);
299
+ } else if (ref) {
300
+ ref.current = value;
301
+ }
302
+ }
303
+
304
+ function unsupportedProp(props, propName, componentName, location, propFullName) {
305
+ {
306
+ return null;
307
+ }
308
+ }
309
+
310
+ /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
311
+ function useControlled(_ref) {
312
+ var controlled = _ref.controlled,
313
+ defaultProp = _ref.default;
314
+ _ref.name;
315
+ _ref.state;
316
+
317
+ var _React$useRef = React.useRef(controlled !== undefined),
318
+ isControlled = _React$useRef.current;
319
+
320
+ var _React$useState = React.useState(defaultProp),
321
+ valueState = _React$useState[0],
322
+ setValue = _React$useState[1];
323
+
324
+ var value = isControlled ? controlled : valueState;
325
+
326
+ var setValueIfUncontrolled = React.useCallback(function (newValue) {
327
+ if (!isControlled) {
328
+ setValue(newValue);
329
+ }
330
+ }, []);
331
+ return [value, setValueIfUncontrolled];
332
+ }
333
+
334
+ var useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
335
+ /**
336
+ * https://github.com/facebook/react/issues/14099#issuecomment-440013892
337
+ *
338
+ * @param {function} fn
339
+ */
340
+
341
+ function useEventCallback(fn) {
342
+ var ref = React.useRef(fn);
343
+ useEnhancedEffect(function () {
344
+ ref.current = fn;
345
+ });
346
+ return React.useCallback(function () {
347
+ return (ref.current).apply(void 0, arguments);
348
+ }, []);
349
+ }
350
+
351
+ function useForkRef(refA, refB) {
352
+ /**
353
+ * This will create a new function if the ref props change and are defined.
354
+ * This means react will call the old forkRef with `null` and the new forkRef
355
+ * with the ref. Cleanup naturally emerges from this behavior
356
+ */
357
+ return React.useMemo(function () {
358
+ if (refA == null && refB == null) {
359
+ return null;
360
+ }
361
+
362
+ return function (refValue) {
363
+ setRef(refA, refValue);
364
+ setRef(refB, refValue);
365
+ };
366
+ }, [refA, refB]);
367
+ }
368
+
369
+ /**
370
+ * Private module reserved for @material-ui/x packages.
371
+ */
372
+
373
+ function useId(idOverride) {
374
+ var _React$useState = React.useState(idOverride),
375
+ defaultId = _React$useState[0],
376
+ setDefaultId = _React$useState[1];
377
+
378
+ var id = idOverride || defaultId;
379
+ React.useEffect(function () {
380
+ if (defaultId == null) {
381
+ // Fallback to this default id when possible.
382
+ // Use the random value for client-side rendering only.
383
+ // We can't use it server-side.
384
+ setDefaultId("mui-".concat(Math.round(Math.random() * 1e5)));
385
+ }
386
+ }, [defaultId]);
387
+ return id;
388
+ }
389
+
390
+ // based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
391
+ var hadKeyboardEvent = true;
392
+ var hadFocusVisibleRecently = false;
393
+ var hadFocusVisibleRecentlyTimeout = null;
394
+ var inputTypesWhitelist = {
395
+ text: true,
396
+ search: true,
397
+ url: true,
398
+ tel: true,
399
+ email: true,
400
+ password: true,
401
+ number: true,
402
+ date: true,
403
+ month: true,
404
+ week: true,
405
+ time: true,
406
+ datetime: true,
407
+ 'datetime-local': true
408
+ };
409
+ /**
410
+ * Computes whether the given element should automatically trigger the
411
+ * `focus-visible` class being added, i.e. whether it should always match
412
+ * `:focus-visible` when focused.
413
+ * @param {Element} node
414
+ * @return {boolean}
415
+ */
416
+
417
+ function focusTriggersKeyboardModality(node) {
418
+ var type = node.type,
419
+ tagName = node.tagName;
420
+
421
+ if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
422
+ return true;
423
+ }
424
+
425
+ if (tagName === 'TEXTAREA' && !node.readOnly) {
426
+ return true;
427
+ }
428
+
429
+ if (node.isContentEditable) {
430
+ return true;
431
+ }
432
+
433
+ return false;
434
+ }
435
+ /**
436
+ * Keep track of our keyboard modality state with `hadKeyboardEvent`.
437
+ * If the most recent user interaction was via the keyboard;
438
+ * and the key press did not include a meta, alt/option, or control key;
439
+ * then the modality is keyboard. Otherwise, the modality is not keyboard.
440
+ * @param {KeyboardEvent} event
441
+ */
442
+
443
+
444
+ function handleKeyDown(event) {
445
+ if (event.metaKey || event.altKey || event.ctrlKey) {
446
+ return;
447
+ }
448
+
449
+ hadKeyboardEvent = true;
450
+ }
451
+ /**
452
+ * If at any point a user clicks with a pointing device, ensure that we change
453
+ * the modality away from keyboard.
454
+ * This avoids the situation where a user presses a key on an already focused
455
+ * element, and then clicks on a different element, focusing it with a
456
+ * pointing device, while we still think we're in keyboard modality.
457
+ */
458
+
459
+
460
+ function handlePointerDown() {
461
+ hadKeyboardEvent = false;
462
+ }
463
+
464
+ function handleVisibilityChange() {
465
+ if (this.visibilityState === 'hidden') {
466
+ // If the tab becomes active again, the browser will handle calling focus
467
+ // on the element (Safari actually calls it twice).
468
+ // If this tab change caused a blur on an element with focus-visible,
469
+ // re-apply the class when the user switches back to the tab.
470
+ if (hadFocusVisibleRecently) {
471
+ hadKeyboardEvent = true;
472
+ }
473
+ }
474
+ }
475
+
476
+ function prepare(doc) {
477
+ doc.addEventListener('keydown', handleKeyDown, true);
478
+ doc.addEventListener('mousedown', handlePointerDown, true);
479
+ doc.addEventListener('pointerdown', handlePointerDown, true);
480
+ doc.addEventListener('touchstart', handlePointerDown, true);
481
+ doc.addEventListener('visibilitychange', handleVisibilityChange, true);
482
+ }
483
+
484
+ function isFocusVisible(event) {
485
+ var target = event.target;
486
+
487
+ try {
488
+ return target.matches(':focus-visible');
489
+ } catch (error) {} // browsers not implementing :focus-visible will throw a SyntaxError
490
+ // we use our own heuristic for those browsers
491
+ // rethrow might be better if it's not the expected error but do we really
492
+ // want to crash if focus-visible malfunctioned?
493
+ // no need for validFocusTarget check. the user does that by attaching it to
494
+ // focusable events only
495
+
496
+
497
+ return hadKeyboardEvent || focusTriggersKeyboardModality(target);
498
+ }
499
+ /**
500
+ * Should be called if a blur event is fired on a focus-visible element
501
+ */
502
+
503
+
504
+ function handleBlurVisible() {
505
+ // To detect a tab/window switch, we look for a blur event followed
506
+ // rapidly by a visibility change.
507
+ // If we don't see a visibility change within 100ms, it's probably a
508
+ // regular focus change.
509
+ hadFocusVisibleRecently = true;
510
+ window.clearTimeout(hadFocusVisibleRecentlyTimeout);
511
+ hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {
512
+ hadFocusVisibleRecently = false;
513
+ }, 100);
514
+ }
515
+
516
+ function useIsFocusVisible() {
517
+ var ref = React.useCallback(function (instance) {
518
+ var node = ReactDOM.findDOMNode(instance);
519
+
520
+ if (node != null) {
521
+ prepare(node.ownerDocument);
522
+ }
523
+ }, []);
524
+
525
+ return {
526
+ isFocusVisible: isFocusVisible,
527
+ onBlurVisible: handleBlurVisible,
528
+ ref: ref
529
+ };
530
+ }
531
+
532
+ var utils = /*#__PURE__*/Object.freeze({
533
+ __proto__: null,
534
+ capitalize: capitalize,
535
+ createChainedFunction: createChainedFunction,
536
+ createSvgIcon: createSvgIcon,
537
+ debounce: debounce,
538
+ deprecatedPropType: deprecatedPropType,
539
+ isMuiElement: isMuiElement,
540
+ ownerDocument: ownerDocument,
541
+ ownerWindow: ownerWindow,
542
+ requirePropFactory: requirePropFactory,
543
+ setRef: setRef,
544
+ unsupportedProp: unsupportedProp,
545
+ useControlled: useControlled,
546
+ useEventCallback: useEventCallback,
547
+ useForkRef: useForkRef,
548
+ unstable_useId: useId,
549
+ useIsFocusVisible: useIsFocusVisible
550
+ });
551
+
552
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(utils);
553
+
554
+ var hasRequiredCreateSvgIcon;
555
+
556
+ function requireCreateSvgIcon () {
557
+ if (hasRequiredCreateSvgIcon) return createSvgIcon$1;
558
+ hasRequiredCreateSvgIcon = 1;
559
+ (function (exports) {
560
+
561
+ Object.defineProperty(exports, "__esModule", {
562
+ value: true
563
+ });
564
+ Object.defineProperty(exports, "default", {
565
+ enumerable: true,
566
+ get: function get() {
567
+ return _utils.createSvgIcon;
568
+ }
569
+ });
570
+
571
+ var _utils = require$$0;
572
+ } (createSvgIcon$1));
573
+ return createSvgIcon$1;
574
+ }
575
+
576
+ export { interopRequireWildcard as a, useEventCallback as b, clsx as c, useIsFocusVisible as d, useForkRef as e, createSvgIcon as f, capitalize as g, debounce as h, interopRequireDefault as i, requireCreateSvgIcon as r, useControlled as u, withStyles as w };
@@ -0,0 +1,92 @@
1
+ var fileDownload = function(data, filename, mime, bom) {
2
+ var blobData = (typeof bom !== 'undefined') ? [bom, data] : [data];
3
+ var blob = new Blob(blobData, {type: mime || 'application/octet-stream'});
4
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
5
+ // IE workaround for "HTML7007: One or more blob URLs were
6
+ // revoked by closing the blob for which they were created.
7
+ // These URLs will no longer resolve as the data backing
8
+ // the URL has been freed."
9
+ window.navigator.msSaveBlob(blob, filename);
10
+ }
11
+ else {
12
+ var blobURL = (window.URL && window.URL.createObjectURL) ? window.URL.createObjectURL(blob) : window.webkitURL.createObjectURL(blob);
13
+ var tempLink = document.createElement('a');
14
+ tempLink.style.display = 'none';
15
+ tempLink.href = blobURL;
16
+ tempLink.setAttribute('download', filename);
17
+
18
+ // Safari thinks _blank anchor are pop ups. We only want to set _blank
19
+ // target if the browser does not support the HTML5 download attribute.
20
+ // This allows you to download files in desktop safari if pop up blocking
21
+ // is enabled.
22
+ if (typeof tempLink.download === 'undefined') {
23
+ tempLink.setAttribute('target', '_blank');
24
+ }
25
+
26
+ document.body.appendChild(tempLink);
27
+ tempLink.click();
28
+
29
+ // Fixes "webkit blob resource error 1"
30
+ setTimeout(function() {
31
+ document.body.removeChild(tempLink);
32
+ window.URL.revokeObjectURL(blobURL);
33
+ }, 200);
34
+ }
35
+ };
36
+
37
+ const jsonExcel = json => {
38
+ let output = '';
39
+ if (Array.isArray(json) && json.length > 0) {
40
+ const keys = Object.keys(json[0]);
41
+ output += `${keys.toString()}\n`;
42
+ json.forEach(item => {
43
+ keys.forEach(key => {
44
+ output += `${item[key]},`;
45
+ });
46
+ output += '\n';
47
+ });
48
+ } else {
49
+ const keys = Object.keys(json);
50
+ output += `${keys.toString()}\n`;
51
+ keys.forEach(key => {
52
+ output += `${json[key]},`;
53
+ });
54
+ output += '\n';
55
+ }
56
+ return output;
57
+ };
58
+ const jsonTxt = json => {
59
+ let output = '';
60
+ if (Array.isArray(json) && json.length > 0) {
61
+ const keys = Object.keys(json[0]);
62
+ json.forEach((item, index) => {
63
+ output += `(${index + 1})\n`;
64
+ keys.forEach(key => {
65
+ output += `${key}: ${item[key]}\n`;
66
+ });
67
+ output += '\n';
68
+ });
69
+ } else {
70
+ const keys = Object.keys(json);
71
+ keys.forEach(key => {
72
+ output += `${key}: ${json[key]}\n`;
73
+ });
74
+ }
75
+ return output;
76
+ };
77
+ const snaToExcel = data => {
78
+ const {
79
+ links,
80
+ nodes
81
+ } = data || {};
82
+ if (links && links.length > 0) {
83
+ const result = links.map(link => ({
84
+ From: nodes[link.source].name,
85
+ To: nodes[link.target].name
86
+ }));
87
+ return result;
88
+ }
89
+ return [];
90
+ };
91
+
92
+ export { jsonExcel as a, fileDownload as f, jsonTxt as j, snaToExcel as s };