@daoyi/nmtl-ui 2.0.1-beta.45 → 2.0.1-beta.47

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 (72) hide show
  1. package/lib/components/Autocomplete-5439ff22.js +333 -1
  2. package/lib/components/Autocomplete.js +12 -1
  3. package/lib/components/Avatar.js +51 -1
  4. package/lib/components/BackTop.js +82 -1
  5. package/lib/components/BarChart.js +132 -1
  6. package/lib/components/Breadcrumbs.js +124 -1
  7. package/lib/components/Button-63c7e9f3.js +91 -1
  8. package/lib/components/Button.js +8 -1
  9. package/lib/components/Carousel.js +61 -1
  10. package/lib/components/Checkbox.js +37 -1
  11. package/lib/components/CollapseContent.js +181 -1
  12. package/lib/components/ContactModal-a59bc808.js +924 -0
  13. package/lib/components/ContactModal.js +17 -1
  14. package/lib/components/Drawer-af3ed21a.js +157 -1
  15. package/lib/components/Drawer.js +13 -1
  16. package/lib/components/Dropdown.js +135 -1
  17. package/lib/components/Empty-70f040a9.js +44 -1
  18. package/lib/components/Empty.js +7 -1
  19. package/lib/components/ExportButton.js +114 -1
  20. package/lib/components/ExtraTools-f10a66a8.js +818 -1
  21. package/lib/components/ExtraTools.js +11 -1
  22. package/lib/components/Filter.js +90 -1
  23. package/lib/components/Footer.js +266 -1
  24. package/lib/components/ForwardLink.js +106 -1
  25. package/lib/components/Header.js +186 -1
  26. package/lib/components/Image.js +58 -1
  27. package/lib/components/Input.js +79 -1
  28. package/lib/components/InputMethod.js +23106 -1
  29. package/lib/components/KeywordSearch-224f84c1.js +138 -1
  30. package/lib/components/KeywordSearch.js +14 -1
  31. package/lib/components/KeywordTicker.js +182 -1
  32. package/lib/components/Keywords.js +292 -1
  33. package/lib/components/Loading.js +30 -1
  34. package/lib/components/MUITheme.js +255 -1
  35. package/lib/components/Modal-a7591b98.js +107 -1
  36. package/lib/components/Modal.js +11 -1
  37. package/lib/components/MoreButton-f15ca38e.js +109 -1
  38. package/lib/components/MoreButton.js +8 -1
  39. package/lib/components/Radio.js +81 -1
  40. package/lib/components/SNA.js +324 -1
  41. package/lib/components/Select-98a8e973.js +114 -1
  42. package/lib/components/Select.js +10 -1
  43. package/lib/components/Spin-690a3597.js +74 -1
  44. package/lib/components/Spin.js +8 -1
  45. package/lib/components/Table.js +51 -1
  46. package/lib/components/Tooltip-b7eb966d.js +69 -1
  47. package/lib/components/Tooltip.js +9 -1
  48. package/lib/components/_rollupPluginBabelHelpers-fde6d1c6.js +491 -1
  49. package/lib/components/dataExport-f418e6fe.js +56 -1
  50. package/lib/components/globalConfig.js +186 -1
  51. package/lib/components/vendor-851c6356.js +41893 -16
  52. package/lib/index.d.ts +1 -3
  53. package/lib/index.js +1 -3
  54. package/lib/utils/_rollupPluginBabelHelpers-a6e0e6e3.js +139 -1
  55. package/lib/utils/arrayMerge.js +100 -1
  56. package/lib/utils/chunkArray.js +15 -1
  57. package/lib/utils/convert2HtmlEntities.js +42 -1
  58. package/lib/utils/domToImage.js +32 -1
  59. package/lib/utils/downloadGephi.js +106 -1
  60. package/lib/utils/exportXlsx.js +184 -1
  61. package/lib/utils/historyAppendSearch.js +23 -1
  62. package/lib/utils/isDevelopMode.js +5 -1
  63. package/lib/utils/parseYMD.js +36 -1
  64. package/lib/utils/removeDuplicateItem.js +11 -1
  65. package/lib/utils/sendEmail.js +39 -1
  66. package/lib/utils/snaDefine-6a2bcd94.js +5 -1
  67. package/lib/utils/snaDefine.js +1 -1
  68. package/lib/utils/snaPreProcess.js +84 -1
  69. package/lib/utils/vendor-3ec75cc9.js +1289 -1
  70. package/package.json +1 -1
  71. package/lib/components/ContactModal-d7e2f8bb.js +0 -1
  72. package/lib/components/globalConfig-40069b54.js +0 -1
@@ -1 +1,23 @@
1
- import{b as r,c as e}from"./_rollupPluginBabelHelpers-a6e0e6e3.js";import o from"prop-types";import{q as s}from"./vendor-3ec75cc9.js";var a=["history"],i=function(o){var i=o.history,p=r(o,a);if(i){var t=i.location.search;i.replace({search:s.stringify(e(e({},s.parse(t)),p))})}else console.error("error","historyAppendSearch needs history")};i.propTypes={history:o.objectOf(o.any).isRequired};export{i as default};
1
+ import { b as _objectWithoutProperties, c as _objectSpread2 } from './_rollupPluginBabelHelpers-a6e0e6e3.js';
2
+ import PropTypes from 'prop-types';
3
+ import { q as queryString } from './vendor-3ec75cc9.js';
4
+
5
+ var _excluded = ["history"];
6
+ var historyAppendSearch = function historyAppendSearch(_ref) {
7
+ var history = _ref.history,
8
+ rest = _objectWithoutProperties(_ref, _excluded);
9
+ if (history) {
10
+ var search = history.location.search;
11
+ history.replace({
12
+ search: queryString.stringify(_objectSpread2(_objectSpread2({}, queryString.parse(search)), rest))
13
+ });
14
+ } else {
15
+ console.error('error', 'historyAppendSearch needs history');
16
+ }
17
+ };
18
+ historyAppendSearch.propTypes = {
19
+ /** react-router-dom 的 history */
20
+ history: PropTypes.objectOf(PropTypes.any).isRequired
21
+ };
22
+
23
+ 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] : 5000;
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 };
@@ -1 +1,5 @@
1
- var a={mainNode:"mainNode"};export{a as s};
1
+ var snaDefine = {
2
+ mainNode: 'mainNode'
3
+ };
4
+
5
+ export { snaDefine as s };
@@ -1 +1 @@
1
- export{s as default}from"./snaDefine-6a2bcd94.js";
1
+ export { s as default } from './snaDefine-6a2bcd94.js';
@@ -1 +1,84 @@
1
- import{_ as e}from"./_rollupPluginBabelHelpers-a6e0e6e3.js";import{s as r}from"./snaDefine-6a2bcd94.js";var n=function(n){var i=n.mainNodes,a=n.snaData;if(!(i&&Array.isArray(i)&&a&&Array.isArray(a)))return console.log("ERROR: wrong input data.",i,a),{nodes:[],links:[]};var t=[];a.forEach((function(e){var n=e.sourceId,a=e.sourceType,d=e.source,o=e.sourceHide,s=e.targetId,u=e.targetType,f=e.target,c=e.targetHide;t.find((function(r){return r.id===e.sourceId}))||t.push({name:d,id:n,type:-1!==i.indexOf(n)?r.mainNode:a,hasClick:-1===i.indexOf(n),hide:o||"0"}),t.find((function(r){return r.id===e.targetId}))||t.push({name:f,id:s,type:-1!==i.indexOf(s)?r.mainNode:u,hasClick:-1===i.indexOf(s),hide:c||"0"})}));var d=e(new Set(t.map((function(e){return JSON.stringify(e)})))).map((function(e){return JSON.parse(e)})),o=[];return a.forEach((function(e){var r=e.sourceId,n=e.targetId;o.push({target:d.findIndex((function(e){return n===e.id})),source:d.findIndex((function(e){return r===e.id}))})})),{nodes:d,links:o}};export{n as default};
1
+ import { _ as _toConsumableArray } from './_rollupPluginBabelHelpers-a6e0e6e3.js';
2
+ import { s as snaDefine } from './snaDefine-6a2bcd94.js';
3
+
4
+ var snaPreProcess = function snaPreProcess(_ref) {
5
+ var mainNodes = _ref.mainNodes,
6
+ snaData = _ref.snaData;
7
+ if (!mainNodes || !Array.isArray(mainNodes) || !snaData || !Array.isArray(snaData)) {
8
+ // eslint-disable-next-line no-console
9
+ console.log('ERROR: wrong input data.', mainNodes, snaData);
10
+ return {
11
+ nodes: [],
12
+ links: []
13
+ };
14
+ }
15
+
16
+ // 將所有source、target都建成node 並給予node的type好區分在圖上的圓圈大小與顏色
17
+ var nodes = [];
18
+ snaData.forEach(function (item) {
19
+ var sourceId = item.sourceId,
20
+ sourceType = item.sourceType,
21
+ source = item.source,
22
+ sourceHide = item.sourceHide,
23
+ targetId = item.targetId,
24
+ targetType = item.targetType,
25
+ target = item.target,
26
+ targetHide = item.targetHide;
27
+
28
+ // 避免出現無關聯的 node
29
+ var foundSrc = nodes.find(function (n) {
30
+ return n.id === item.sourceId;
31
+ });
32
+ if (!foundSrc) {
33
+ nodes.push({
34
+ name: source,
35
+ id: sourceId,
36
+ type: mainNodes.indexOf(sourceId) !== -1 ? snaDefine.mainNode : sourceType,
37
+ hasClick: mainNodes.indexOf(sourceId) === -1,
38
+ hide: sourceHide || '0'
39
+ });
40
+ }
41
+
42
+ // 避免出現無關聯的 node
43
+ var foundTar = nodes.find(function (n) {
44
+ return n.id === item.targetId;
45
+ });
46
+ if (!foundTar) {
47
+ nodes.push({
48
+ name: target,
49
+ id: targetId,
50
+ type: mainNodes.indexOf(targetId) !== -1 ? snaDefine.mainNode : targetType,
51
+ hasClick: mainNodes.indexOf(targetId) === -1,
52
+ hide: targetHide || '0'
53
+ });
54
+ }
55
+ });
56
+
57
+ // 刪除重複的node
58
+ var uniqueNodes = _toConsumableArray(new Set(nodes.map(function (item) {
59
+ return JSON.stringify(item);
60
+ }))).map(function (item) {
61
+ return JSON.parse(item);
62
+ });
63
+
64
+ // 把有關係的node建立link
65
+ var links = [];
66
+ snaData.forEach(function (item) {
67
+ var sourceId = item.sourceId,
68
+ targetId = item.targetId;
69
+ links.push({
70
+ target: uniqueNodes.findIndex(function (uniqueNode) {
71
+ return targetId === uniqueNode.id;
72
+ }),
73
+ source: uniqueNodes.findIndex(function (uniqueNode) {
74
+ return sourceId === uniqueNode.id;
75
+ })
76
+ });
77
+ });
78
+ return {
79
+ nodes: uniqueNodes,
80
+ links: links
81
+ };
82
+ };
83
+
84
+ export { snaPreProcess as default };