@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.
- package/lib/components/Autocomplete-5439ff22.js +333 -1
- package/lib/components/Autocomplete.js +12 -1
- package/lib/components/Avatar.js +51 -1
- package/lib/components/BackTop.js +82 -1
- package/lib/components/BarChart.js +132 -1
- package/lib/components/Breadcrumbs.js +124 -1
- package/lib/components/Button-63c7e9f3.js +91 -1
- package/lib/components/Button.js +8 -1
- package/lib/components/Carousel.js +61 -1
- package/lib/components/Checkbox.js +37 -1
- package/lib/components/CollapseContent.js +181 -1
- package/lib/components/ContactModal-a59bc808.js +924 -0
- package/lib/components/ContactModal.js +17 -1
- package/lib/components/Drawer-af3ed21a.js +157 -1
- package/lib/components/Drawer.js +13 -1
- package/lib/components/Dropdown.js +135 -1
- package/lib/components/Empty-70f040a9.js +44 -1
- package/lib/components/Empty.js +7 -1
- package/lib/components/ExportButton.js +114 -1
- package/lib/components/ExtraTools-f10a66a8.js +818 -1
- package/lib/components/ExtraTools.js +11 -1
- package/lib/components/Filter.js +90 -1
- package/lib/components/Footer.js +266 -1
- package/lib/components/ForwardLink.js +106 -1
- package/lib/components/Header.js +186 -1
- package/lib/components/Image.js +58 -1
- package/lib/components/Input.js +79 -1
- package/lib/components/InputMethod.js +23106 -1
- package/lib/components/KeywordSearch-224f84c1.js +138 -1
- package/lib/components/KeywordSearch.js +14 -1
- package/lib/components/KeywordTicker.js +182 -1
- package/lib/components/Keywords.js +292 -1
- package/lib/components/Loading.js +30 -1
- package/lib/components/MUITheme.js +255 -1
- package/lib/components/Modal-a7591b98.js +107 -1
- package/lib/components/Modal.js +11 -1
- package/lib/components/MoreButton-f15ca38e.js +109 -1
- package/lib/components/MoreButton.js +8 -1
- package/lib/components/Radio.js +81 -1
- package/lib/components/SNA.js +324 -1
- package/lib/components/Select-98a8e973.js +114 -1
- package/lib/components/Select.js +10 -1
- package/lib/components/Spin-690a3597.js +74 -1
- package/lib/components/Spin.js +8 -1
- package/lib/components/Table.js +51 -1
- package/lib/components/Tooltip-b7eb966d.js +69 -1
- package/lib/components/Tooltip.js +9 -1
- package/lib/components/_rollupPluginBabelHelpers-fde6d1c6.js +491 -1
- package/lib/components/dataExport-f418e6fe.js +56 -1
- package/lib/components/globalConfig.js +186 -1
- package/lib/components/vendor-851c6356.js +41893 -16
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -3
- package/lib/utils/_rollupPluginBabelHelpers-a6e0e6e3.js +139 -1
- package/lib/utils/arrayMerge.js +100 -1
- package/lib/utils/chunkArray.js +15 -1
- package/lib/utils/convert2HtmlEntities.js +42 -1
- package/lib/utils/domToImage.js +32 -1
- package/lib/utils/downloadGephi.js +106 -1
- package/lib/utils/exportXlsx.js +184 -1
- package/lib/utils/historyAppendSearch.js +23 -1
- package/lib/utils/isDevelopMode.js +5 -1
- package/lib/utils/parseYMD.js +36 -1
- package/lib/utils/removeDuplicateItem.js +11 -1
- package/lib/utils/sendEmail.js +39 -1
- package/lib/utils/snaDefine-6a2bcd94.js +5 -1
- package/lib/utils/snaDefine.js +1 -1
- package/lib/utils/snaPreProcess.js +84 -1
- package/lib/utils/vendor-3ec75cc9.js +1289 -1
- package/package.json +1 -1
- package/lib/components/ContactModal-d7e2f8bb.js +0 -1
- package/lib/components/globalConfig-40069b54.js +0 -1
|
@@ -1 +1,23 @@
|
|
|
1
|
-
import{b as
|
|
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 };
|
package/lib/utils/parseYMD.js
CHANGED
|
@@ -1 +1,36 @@
|
|
|
1
|
-
var
|
|
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
|
|
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 };
|
package/lib/utils/sendEmail.js
CHANGED
|
@@ -1 +1,39 @@
|
|
|
1
|
-
import
|
|
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 };
|
package/lib/utils/snaDefine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{s as default}from
|
|
1
|
+
export { s as default } from './snaDefine-6a2bcd94.js';
|
|
@@ -1 +1,84 @@
|
|
|
1
|
-
import{_ as
|
|
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 };
|