@daoyi/nmtl-ui 2.0.1-beta.5 → 2.0.1-beta.50

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 (97) hide show
  1. package/lib/components/Autocomplete-3dae80ca.js +335 -0
  2. package/lib/components/Autocomplete.js +13 -1
  3. package/lib/components/Avatar.js +49 -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-433372aa.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-66bcb5d3.js +10779 -0
  13. package/lib/components/ContactModal.js +22 -3
  14. package/lib/components/Drawer-df3535c2.js +157 -0
  15. package/lib/components/Drawer.js +11 -1
  16. package/lib/components/Dropdown.js +134 -1
  17. package/lib/components/Empty-7318f658.js +45 -0
  18. package/lib/components/Empty.js +5 -1
  19. package/lib/components/ExportButton.js +112 -1
  20. package/lib/components/ExtraTools-1cb5786d.js +3533 -0
  21. package/lib/components/ExtraTools.js +10 -22
  22. package/lib/components/Filter.js +776 -12
  23. package/lib/components/Footer.js +271 -1
  24. package/lib/components/ForwardLink-0571e627.js +105 -0
  25. package/lib/components/ForwardLink.js +9 -0
  26. package/lib/components/Header.js +187 -1
  27. package/lib/components/Image.js +61 -1
  28. package/lib/components/Input.js +77 -1
  29. package/lib/components/InputMethod.js +33949 -12
  30. package/lib/components/KeywordSearch-568a8a44.js +139 -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 +2627 -1
  36. package/lib/components/Modal-64c4ab0d.js +108 -0
  37. package/lib/components/Modal.js +9 -1
  38. package/lib/components/MoreButton-6654cc5b.js +110 -0
  39. package/lib/components/MoreButton.js +6 -1
  40. package/lib/components/Radio.js +78 -1
  41. package/lib/components/SNA.js +1692 -22
  42. package/lib/components/Select-113372b2.js +115 -0
  43. package/lib/components/Select.js +8 -1
  44. package/lib/components/Spin-8a5a600d.js +75 -0
  45. package/lib/components/Spin.js +6 -1
  46. package/lib/components/Table.js +51 -1
  47. package/lib/components/Tooltip-abe1205f.js +70 -0
  48. package/lib/components/Tooltip.js +7 -1
  49. package/lib/components/_commonjsHelpers-70de2c37.js +28 -0
  50. package/lib/components/_rollupPluginBabelHelpers-3d9c8289.js +478 -0
  51. package/lib/components/createSvgIcon-a79ae4b1.js +576 -0
  52. package/lib/components/dataExport-d55d6fa3.js +92 -0
  53. package/lib/components/debounce-127da66c.js +355 -0
  54. package/lib/components/defaultTheme-19a14721.js +1485 -0
  55. package/lib/components/globalConfig.js +172 -0
  56. package/lib/components/hoist-non-react-statics.cjs-3f408ad2.js +105 -0
  57. package/lib/components/index-66babe67.js +61 -0
  58. package/lib/components/index-fdcc884e.js +481 -0
  59. package/lib/components/isObjectLike-e111475d.js +190 -0
  60. package/lib/components/style-inject.es-1f59c1d0.js +28 -1
  61. package/lib/components/transform-3a04288b.js +5475 -0
  62. package/lib/index.d.ts +1 -0
  63. package/lib/index.js +1 -0
  64. package/lib/utils/_rollupPluginBabelHelpers-8dd26e1a.js +121 -0
  65. package/lib/utils/arrayMerge.js +100 -1
  66. package/lib/utils/chunkArray.js +15 -1
  67. package/lib/utils/convert2HtmlEntities.js +42 -1
  68. package/lib/utils/domToImage.js +802 -1
  69. package/lib/utils/downloadGephi.js +106 -1
  70. package/lib/utils/exportXlsx.js +219 -1
  71. package/lib/utils/historyAppendSearch.js +502 -1
  72. package/lib/utils/isDevelopMode.js +5 -1
  73. package/lib/utils/parseYMD.js +36 -1
  74. package/lib/utils/removeDuplicateItem.js +11 -1
  75. package/lib/utils/sendEmail.js +39 -1
  76. package/lib/utils/snaDefine-6a2bcd94.js +5 -0
  77. package/lib/utils/snaDefine.js +1 -1
  78. package/lib/utils/snaPreProcess.js +84 -1
  79. package/package.json +19 -21
  80. package/lib/components/Empty-54b79907.js +0 -1
  81. package/lib/components/KeywordSearch-5a393f12.js +0 -1
  82. package/lib/components/Select-f2441b83.js +0 -1
  83. package/lib/components/_rollupPluginBabelHelpers-1b8c042f.js +0 -1
  84. package/lib/components/_rollupPluginBabelHelpers-ec4e2a53.js +0 -1
  85. package/lib/components/createSvgIcon-62b64929.js +0 -1
  86. package/lib/components/createSvgIcon-e24792d4.js +0 -1
  87. package/lib/components/createTheme-7fffa109.js +0 -1
  88. package/lib/components/dataExport-9fccd4f0.js +0 -1
  89. package/lib/components/debounce-c993109b.js +0 -1
  90. package/lib/components/hoist-non-react-statics.cjs-d6a9befd.js +0 -1
  91. package/lib/components/index-11391ca3.js +0 -7
  92. package/lib/components/index-b2745105.js +0 -7
  93. package/lib/components/isObjectLike-2f1983fe.js +0 -1
  94. package/lib/components/style-inject.es-c875d022.js +0 -1
  95. package/lib/components/transform-95ae0119.js +0 -1
  96. package/lib/utils/_commonjsHelpers-e2cda605.js +0 -1
  97. package/lib/utils/_rollupPluginBabelHelpers-928a52ce.js +0 -1
package/lib/index.d.ts CHANGED
@@ -21,6 +21,7 @@ export { default as Breadcrumbs } from './components/Breadcrumbs';
21
21
  export { default as ExportButton } from './components/ExportButton';
22
22
  export { default as SNA } from './components/SNA';
23
23
  export { default as BarChart } from './components/BarChart';
24
+ export { default as ForwardLink } from './components/ForwardLink';
24
25
 
25
26
  export { default as ContactModal } from './components/ContactModal';
26
27
  export { default as KeywordSearch } from './components/KeywordSearch';
package/lib/index.js CHANGED
@@ -21,6 +21,7 @@ export { default as Breadcrumbs } from './components/Breadcrumbs';
21
21
  export { default as ExportButton } from './components/ExportButton';
22
22
  export { default as SNA } from './components/SNA';
23
23
  export { default as BarChart } from './components/BarChart';
24
+ export { default as ForwardLink } from './components/ForwardLink';
24
25
 
25
26
  export { default as ContactModal } from './components/ContactModal';
26
27
  export { default as KeywordSearch } from './components/KeywordSearch';
@@ -0,0 +1,121 @@
1
+ function ownKeys(object, enumerableOnly) {
2
+ var keys = Object.keys(object);
3
+ if (Object.getOwnPropertySymbols) {
4
+ var symbols = Object.getOwnPropertySymbols(object);
5
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
6
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
7
+ })), keys.push.apply(keys, symbols);
8
+ }
9
+ return keys;
10
+ }
11
+ function _objectSpread2(target) {
12
+ for (var i = 1; i < arguments.length; i++) {
13
+ var source = null != arguments[i] ? arguments[i] : {};
14
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
15
+ _defineProperty(target, key, source[key]);
16
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
17
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
18
+ });
19
+ }
20
+ return target;
21
+ }
22
+ function _defineProperty(obj, key, value) {
23
+ if (key in obj) {
24
+ Object.defineProperty(obj, key, {
25
+ value: value,
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true
29
+ });
30
+ } else {
31
+ obj[key] = value;
32
+ }
33
+ return obj;
34
+ }
35
+ function _objectWithoutPropertiesLoose(source, excluded) {
36
+ if (source == null) return {};
37
+ var target = {};
38
+ var sourceKeys = Object.keys(source);
39
+ var key, i;
40
+ for (i = 0; i < sourceKeys.length; i++) {
41
+ key = sourceKeys[i];
42
+ if (excluded.indexOf(key) >= 0) continue;
43
+ target[key] = source[key];
44
+ }
45
+ return target;
46
+ }
47
+ function _objectWithoutProperties(source, excluded) {
48
+ if (source == null) return {};
49
+ var target = _objectWithoutPropertiesLoose(source, excluded);
50
+ var key, i;
51
+ if (Object.getOwnPropertySymbols) {
52
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
53
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
54
+ key = sourceSymbolKeys[i];
55
+ if (excluded.indexOf(key) >= 0) continue;
56
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
57
+ target[key] = source[key];
58
+ }
59
+ }
60
+ return target;
61
+ }
62
+ function _slicedToArray(arr, i) {
63
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
64
+ }
65
+ function _toConsumableArray(arr) {
66
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
67
+ }
68
+ function _arrayWithoutHoles(arr) {
69
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
70
+ }
71
+ function _arrayWithHoles(arr) {
72
+ if (Array.isArray(arr)) return arr;
73
+ }
74
+ function _iterableToArray(iter) {
75
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
76
+ }
77
+ function _iterableToArrayLimit(arr, i) {
78
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
79
+ if (_i == null) return;
80
+ var _arr = [];
81
+ var _n = true;
82
+ var _d = false;
83
+ var _s, _e;
84
+ try {
85
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
86
+ _arr.push(_s.value);
87
+ if (i && _arr.length === i) break;
88
+ }
89
+ } catch (err) {
90
+ _d = true;
91
+ _e = err;
92
+ } finally {
93
+ try {
94
+ if (!_n && _i["return"] != null) _i["return"]();
95
+ } finally {
96
+ if (_d) throw _e;
97
+ }
98
+ }
99
+ return _arr;
100
+ }
101
+ function _unsupportedIterableToArray(o, minLen) {
102
+ if (!o) return;
103
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
104
+ var n = Object.prototype.toString.call(o).slice(8, -1);
105
+ if (n === "Object" && o.constructor) n = o.constructor.name;
106
+ if (n === "Map" || n === "Set") return Array.from(o);
107
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
108
+ }
109
+ function _arrayLikeToArray(arr, len) {
110
+ if (len == null || len > arr.length) len = arr.length;
111
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
112
+ return arr2;
113
+ }
114
+ function _nonIterableSpread() {
115
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
116
+ }
117
+ function _nonIterableRest() {
118
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
119
+ }
120
+
121
+ export { _toConsumableArray as _, _slicedToArray as a, _objectWithoutProperties as b, _objectSpread2 as c };
@@ -1 +1,100 @@
1
- var t={};t.author=function(t,r){return t.reduce((function(t,u){if(Object.keys(u).indexOf(r)<0)return t.push(u),t;var o=t.find((function(t){return t[r]===u[r]}));return o?(o.authors=u.authorId?o.authors.concat({author:u.author,authorId:u.authorId}):o.authors,o.authorId=u.authorId?o.authorId.concat(u.authorId):o.authorId,o.author=u.author?o.author.concat(u.author):o.author):(u.authors=[{author:u.author,authorId:u.authorId}],u.authorId=u.authorId?[u.authorId]:[],u.author=u.author?[u.author]:[],t.push(u)),t}),[])},t.timeline=function(t,r,u){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"mergedList";return t.reduce((function(t,a){var n=t.find((function(t){var u=!0;return r.forEach((function(r){Object.keys(a).indexOf(r)<0&&(u=!1),Object.keys(t).indexOf(r)<0&&(u=!1),t[r]!==a[r]&&(u=!1)})),u?t:null})),h=function(t,r){var u={};return r.forEach((function(r){u[r]=t[r]})),u};return n?n[o]=n[o].concat(h(a,u)):(a[o]=[h(a,u)],t.push(a)),t}),[])};export{t as default};
1
+ var arrayMerge = {};
2
+
3
+ // 根據 id 合併其它所有鍵值為 array
4
+ // input:
5
+ // [{author: "AAA", authorId: "PER1", id: "PUB001"}, {author: "BBB", authorId: "PER2", id: "PUB001"}]
6
+ // return:
7
+ // [{author: ["AAA", "BBB"], authorId: ["PER1", "PER2"],
8
+ // authors:[{author:"AAA", authorId:"PER1"}, {author:"BBB", authorId:"PER2"}], id: "PUB001"}]
9
+ var arrayMergeAuthors = function arrayMergeAuthors(input, key) {
10
+ return input.reduce(function (re, obj) {
11
+ // 如果 key 不存在,就不處理
12
+ if (Object.keys(obj).indexOf(key) < 0) {
13
+ re.push(obj);
14
+ return re;
15
+ }
16
+ var item = re.find(function (o) {
17
+ return o[key] === obj[key];
18
+ });
19
+ if (item) {
20
+ // 過濾重覆的作者名
21
+ item.authors = obj.authorId && !item.authors.find(function (a) {
22
+ return a.authorId === obj.authorId;
23
+ }) ? item.authors.concat({
24
+ author: obj.author,
25
+ authorId: obj.authorId
26
+ }) : item.authors;
27
+ item.authorId = obj.authorId && !item.authorId.find(function (arId) {
28
+ return arId === obj.authorId;
29
+ }) ? item.authorId.concat(obj.authorId) : item.authorId;
30
+ item.author = obj.author && !item.author.find(function (arId) {
31
+ return arId === obj.author;
32
+ }) ? item.author.concat(obj.author) : item.author;
33
+ } else {
34
+ // eslint-disable-next-line no-param-reassign
35
+ obj.authors = [{
36
+ author: obj.author,
37
+ authorId: obj.authorId
38
+ }];
39
+
40
+ // eslint-disable-next-line no-param-reassign
41
+ obj.authorId = obj.authorId ? [obj.authorId] : [];
42
+ // eslint-disable-next-line no-param-reassign
43
+ obj.author = obj.author ? [obj.author] : [];
44
+ re.push(obj);
45
+ }
46
+ return re;
47
+ }, []);
48
+ };
49
+
50
+ // 根據 id 合併其它所有鍵值為 array
51
+ // input: 'graph', 'startDate', 'authorName', 'type'
52
+ // [{graph: "全臺詩", startDate: "PER1", authorName: "作者名", type: '詩文作品', source: '作品名1', typeId: 'ART111'},
53
+ // {graph: "全臺詩", startDate: "PER1", authorName: "作者名", type: '詩文作品', source: '作品名2', typeId: 'ART222'},]
54
+ // return:
55
+ // [{graph: "全臺詩", startDate: "PER1", authorName: "作者名", type: '詩文作品', source: '作品名1', typeId: 'ART111',
56
+ // mergedList: {source: ['作品名1', '作品名2'], typeId: ['ART111', 'ART222']}}]
57
+ var arrayMergeTimeline = function arrayMergeTimeline(input, keys, mergeKeys) {
58
+ var mergedName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'mergedList';
59
+ return input.reduce(function (re, obj) {
60
+ var item = re.find(function (o) {
61
+ var match = true;
62
+
63
+ // 不存在此 property
64
+ keys.forEach(function (key) {
65
+ // not found
66
+ if (Object.keys(obj).indexOf(key) < 0) {
67
+ match = false;
68
+ }
69
+ if (Object.keys(o).indexOf(key) < 0) {
70
+ match = false;
71
+ }
72
+
73
+ // not the same
74
+ if (o[key] !== obj[key]) {
75
+ match = false;
76
+ }
77
+ });
78
+ return match ? o : null;
79
+ });
80
+ var mergedObj = function mergedObj(inObj, inKeys) {
81
+ var mObj = {};
82
+ inKeys.forEach(function (k) {
83
+ mObj[k] = inObj[k];
84
+ });
85
+ return mObj;
86
+ };
87
+ if (item) {
88
+ item[mergedName] = item[mergedName].concat(mergedObj(obj, mergeKeys));
89
+ } else {
90
+ // eslint-disable-next-line no-param-reassign
91
+ obj[mergedName] = [mergedObj(obj, mergeKeys)];
92
+ re.push(obj);
93
+ }
94
+ return re;
95
+ }, []);
96
+ };
97
+ arrayMerge.author = arrayMergeAuthors;
98
+ arrayMerge.timeline = arrayMergeTimeline;
99
+
100
+ export { arrayMerge as default };
@@ -1 +1,15 @@
1
- var u=function(u,e){return u.reduce((function(u,n,r){return r%e?u[u.length-1].push(n):u.push([n]),u}),[])};export{u as default};
1
+ // Examples
2
+ // chunkArray([1, 2, 3, 4, 5, 6, 7, 8], 3); // [[1, 2, 3], [4, 5, 6], [7, 8]]
3
+ // chunkArray([1, 2, 3, 4, 5, 6, 7, 8], 4); // [[1, 2, 3, 4], [5, 6, 7, 8]]
4
+ var chunkArray = function chunkArray(arr, size) {
5
+ return arr.reduce(function (acc, e, i) {
6
+ if (i % size) {
7
+ acc[acc.length - 1].push(e);
8
+ } else {
9
+ acc.push([e]);
10
+ }
11
+ return acc;
12
+ }, []);
13
+ };
14
+
15
+ export { chunkArray as default };
@@ -1 +1,42 @@
1
- var r=new(0,require("html-to-react").Parser),e=require("markdown-it")({html:!1,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:function(){return""}}),t=function(t){return void 0===t?"":r.parse(e.render(t))};export{t as default};
1
+ var HtmlToReactParser = require('html-to-react').Parser;
2
+ var htmlToReactParser = new HtmlToReactParser();
3
+
4
+ // full options list (defaults)
5
+ var md = require('markdown-it')({
6
+ html: true,
7
+ // Enable HTML tags in source
8
+ xhtmlOut: true,
9
+ // Use '/' to close single tags (<br />).
10
+ // This is only for full CommonMark compatibility.
11
+ breaks: true,
12
+ // Convert '\n' in paragraphs into <br>
13
+ langPrefix: 'language-',
14
+ // CSS language prefix for fenced blocks. Can be
15
+ // useful for external highlighters.
16
+ linkify: false,
17
+ // Autoconvert URL-like text to links
18
+
19
+ // Enable some language-neutral replacement + quotes beautification
20
+ // For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js
21
+ typographer: false,
22
+ // Double + single quotes replacement pairs, when typographer enabled,
23
+ // and smartquotes on. Could be either a String or an Array.
24
+ //
25
+ // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
26
+ // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
27
+ quotes: '“”‘’',
28
+ // Highlighter function. Should return escaped HTML,
29
+ // or '' if the source string is not changed and should be escaped externally.
30
+ // If result starts with <pre... internal wrapper is skipped.
31
+ highlight: function highlight() {
32
+ return '';
33
+ } /* str, lang */
34
+ });
35
+
36
+ // eslint-disable-next-line import/prefer-default-export
37
+ var convert2HtmlEntities = function convert2HtmlEntities(text) {
38
+ if (text === undefined) return '';
39
+ return htmlToReactParser.parse(md.render(text));
40
+ };
41
+
42
+ export { convert2HtmlEntities as default };