@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,324 @@
1
- import t,{useMemo as e,useEffect as n}from"react";import r from"prop-types";import{e as a,s as o,c as i,o as c,g as l,h as s,l as d,m as f,i as p,j as u,x as h,y as g,r as m,k as y,z as x,n as w,p as N}from"./vendor-851c6356.js";import{E as v}from"./ExtraTools-f10a66a8.js";import{Tooltip as k,IconButton as b}from"@material-ui/core";import"react-is";import"@material-ui/styles";import"react-dom";import"./_rollupPluginBabelHelpers-fde6d1c6.js";import"./Tooltip-b7eb966d.js";import"./dataExport-f418e6fe.js";const A=e=>{let{renderSNA:n}=e;return t.createElement("div",{id:"resetBtn"},t.createElement(k,{title:"回到原來位置與大小"},t.createElement(b,{onClick:()=>n()},t.createElement(a,null))))};A.propTypes={renderSNA:r.func.isRequired};o(".SNA {\n overflow: hidden;\n object-fit: contain;\n position: relative;\n font-size: 0.75rem;\n width: 100%; }\n .SNA--smallSize .node {\n padding-top: 8px;\n font-size: 0.75rem;\n width: 3rem;\n height: 3rem;\n overflow: hidden;\n white-space: pre-wrap;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical; }\n .SNA .node {\n background-color: #4a4e69;\n border-radius: 50%;\n color: #fff;\n font-size: 20px;\n font-weight: 500;\n height: 54px;\n width: 54px;\n padding-top: 15px;\n position: absolute;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: grab; }\n .SNA .links line {\n stroke: #c7bfb4;\n stroke-width: 2; }\n .SNA .mainNode {\n fill: #4e3a16; }\n .SNA .person {\n fill: #867b3a; }\n .SNA .publication {\n fill: #825c0d; }\n .SNA .article {\n fill: #afafaf; }\n .SNA .keyword {\n fill: #fcfae8; }\n .SNA .org {\n fill: #000000; }\n .SNA #resetBtn {\n float: right; }\n .SNA #network-graph svg {\n width: 100%;\n height: 100%; }\n\n@media only screen and (max-width: 484px) {\n .SNA {\n margin-left: 0px; }\n .SNA .node {\n background-color: #4a4e69;\n border-radius: 50%;\n color: #fff;\n font-size: 1px;\n font-weight: 500;\n height: 44px;\n width: 44px;\n padding-top: 12px;\n position: absolute;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: grab; } }\n\n@media only screen and (max-width: 484px) {\n .SNA {\n margin-left: 0px; } }\n");var S=function(r){var a,o=r.className,k=r.intl,b=r.exclude,S=r.distance,E=r.SNAData,C=r.handleClickNodeGoto,M=r.DownloadExcel,j=r.width,z=r.height,D=r.fontColor,T=r.backgroundColor,F=r.iconColor;if(!E||0===E.nodes.length)return t.createElement("div",{className:"noData"},k?k.formatMessage({id:"common.noData"}):"暫無資料");var O=e((function(){return screen.width>1050?j:screen.width-80}),[screen.width]),B=e((function(){return screen.width>1050?z:screen.height-300}),[screen.width]),q=function(t,e,n){var r=function(t,e,n){var r=.5*(e.x+t.x),a=.5*(e.y+t.y),o=e.x-t.x,i=e.y-t.y,c=Math.pow(Math.pow(o,2)+Math.pow(i,2),.5);return{qx:r-i*n/c,qy:a+o*n/c}}(t,e,n),a=r.qx,o=r.qy;return isNaN(a)?"M".concat(t.x,", ").concat(t.y," Q0 0 ").concat(e.x," ").concat(e.y):"M".concat(t.x,", ").concat(t.y," Q").concat(a," ").concat(o," ").concat(e.x," ").concat(e.y)},I=function(t){var e=8.5,n="-0 -".concat(e," ").concat(17," ").concat(17),r="M 0,-".concat(6.800000000000001," L ").concat(13.600000000000001," ,0 L 0,").concat(6.800000000000001),o=c(l),i=t.links.map((function(t){return Object.create(t)})),v=t.nodes.map((function(t){return Object.create(t)})),b=s(v).force("link",d(i).id((function(t){return t.index})).distance(50)).force("charge",f().strength(-200).distanceMax(1e3)).force("center",p(O/2,B/2)).force("collide",u().radius((function(){return 13.5})).strength(1).iterations(10)).force("x",h(O/2)).force("y",g(B/2)).force("radial",m(100,O/1.5,B/1.5)),A=y("#sna-graph").append("svg").attr("viewBox",[0,0,O,B]).style("background-color",T);A.append("defs").append("marker").attr("id","arrowhead").attr("viewBox",n).attr("refX",23.8).attr("refY",0).attr("orient","auto").attr("markerWidth",15.3).attr("markerHeight",15.3).attr("xoverflow","visible").append("svg:path").attr("d",r).attr("fill","#999").style("stroke","none"),a=A.append("g");x().scaleExtent([.5,20]).extent([[0,0],[O,B]]).on("zoom",(function(){a.attr("transform",N.transform)}))(A);var S=a.append("g").attr("stroke","#999").attr("stroke-opacity",.6).selectAll("line").data(i).join("path").attr("fill","none").attr("stroke-dasharray",(function(t){return"protege"===t.ontology?"2,5,3":""})).attr("key",(function(t){return t.type})),E=a.append("g").attr("stroke","#fff").attr("stroke-width",1.5).selectAll("circle").data(v).join("circle").attr("r",(function(t){return"mainNode"===t.type?13.5:e})).attr("fill",(function(t){return o(t.type)})).attr("key",(function(t){return t.type})).attr("class",(function(t){return"node node-".concat(t.id," ").concat(t.type&&"organization"===t.type?"org":"person"===t.type?"person":"publication"===t.type?"publication":"mainNode"===t.type?"mainNode":"article"===t.type?"article":"keyword"===t.type?"keyword":"event"===t.type?"event":"")})).on("click",(function(t){return t.hasClick?C({name:t.name,id:t.id,type:t.type}):null})).call(function(t){return w().on("start",(function(e){N.active||t.alphaTarget(.3).restart(),e.fx=e.x,e.fy=e.y})).on("drag",(function(t){t.fx=N.x>O-10||N.x<20?t.x:N.x,t.fy=N.y>B-10||N.y<20?t.y:N.y}))}(b));E.append("title").text((function(t){return"".concat(t.name,"-").concat(function(t){switch(t){case"mainNode":return k?k.formatMessage({id:"SNA.search.center"}):"主要搜尋中心";case"organization":return k?k.formatMessage({id:"SNA.organization"}):"組織";case"person":return k?k.formatMessage({id:"SNA.author"}):"作家";case"publication":return k?k.formatMessage({id:"SNA.publication"}):"作家";case"article":return k?k.formatMessage({id:"SNA.article"}):"單篇作品";case"keyword":return k?k.formatMessage({id:"SNA.keyword"}):"關鍵字";case"event":return k?k.formatMessage({id:"SNA.event"}):"事件";default:return""}}(t.type))}));var M=a.append("g").selectAll("text").data(v).join("text").attr("fill",D).attr("text-anchor","middle").attr("key",(function(t){return t.type})).style("color","#fff").style("font-size","14px").text((function(t){return t.name})),j=a.selectAll(".edgepath").data(i).enter().append("path").attr("class","edgepath").attr("fill-opacity",0).attr("stroke-opacity",0).attr("id",(function(t,e){return"edgepath".concat(e)})).style("pointer-events","none");a.selectAll(".edgelabel").data(i).enter().append("text").style("pointer-events","none").attr("class","edgelabel").attr("font-size","10px").attr("fill","#aaa").attr("visibility","visible").attr("key",(function(t){return t.type})).attr("id",(function(t,e){return"edgelabel".concat(e)})).append("textPath").attr("xlink:href",(function(t,e){return"#edgepath".concat(e)})).style("text-anchor","middle").style("pointer-events","none").attr("startOffset","50%").text((function(t){return t.property})),b.on("tick",(function(){v.forEach((function(t){t.x>=O-20&&(t.x=O-20),t.y>=B-20&&(t.y=B-20),t.x<=20&&(t.x=20),t.y<=20&&(t.y=20)})),S.attr("d",(function(t){return q(t.source,t.target,30)})),E.attr("cx",(function(t){return t.x})).attr("cy",(function(t){return t.y})),M.attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y-e})),j.attr("d",(function(t){return q(t.source,t.target,30)}))}))},G=function(){if(E&&E.nodes&&E.nodes.length>0){var t=document.getElementById("sna-graph");t&&t.childNodes[0]&&t.removeChild(t.childNodes[0]),I(E)}};return n((function(){G()}),[E]),t.createElement("div",{className:i("SNA",{"SNA--smallSize":S<200},o),style:{contentWidth:O,contentHeight:B,backgroundColor:T}},t.createElement(v,{intl:k,data:E,iconColor:F,domToImageId:"sna-graph",FontSizeTargets:["#sna-graph svg g text"],exclude:b,DownloadExcel:M,fullscreenDomId:"sna-graph"}),t.createElement(A,{renderSNA:G}),t.createElement("div",{id:"sna-graph"}))};S.defaultProps={className:void 0,intl:void 0,width:1050,height:600,distance:400,SNAData:null,fontColor:"#000000",backgroundColor:"#FFFFFF",iconColor:"#825c0d",exclude:["downloadXls","downloadTsv"],handleClickNodeGoto:null,DownloadExcel:void 0},S.propTypes={className:r.string,intl:r.objectOf(r.any),width:r.number,height:r.number,distance:r.number,SNAData:r.objectOf(r.any),fontColor:r.string,backgroundColor:r.string,iconColor:r.string,exclude:r.arrayOf(r.string),handleClickNodeGoto:r.func,DownloadExcel:r.oneOfType([r.node,r.func])};export{S as default};
1
+ import React__default, { useMemo, useEffect } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { e as default_1, s as styleInject, c as classNames, o as ordinal, g as category10, h as simulation, l as link, m as manyBody, i as center, j as collide, x, y, r as radial, k as d3Select, z as zoom, n as drag, p as event } from './vendor-851c6356.js';
4
+ import { E as ExtraTools } from './ExtraTools-f10a66a8.js';
5
+ import { Tooltip, IconButton } from '@material-ui/core';
6
+ import 'react-is';
7
+ import '@material-ui/styles';
8
+ import 'react-dom';
9
+ import './_rollupPluginBabelHelpers-fde6d1c6.js';
10
+ import './Tooltip-b7eb966d.js';
11
+ import './dataExport-f418e6fe.js';
12
+
13
+ const ResetBtn = _ref => {
14
+ let {
15
+ renderSNA
16
+ } = _ref;
17
+ return /*#__PURE__*/React__default.createElement("div", {
18
+ id: "resetBtn"
19
+ }, /*#__PURE__*/React__default.createElement(Tooltip, {
20
+ title: "\u56DE\u5230\u539F\u4F86\u4F4D\u7F6E\u8207\u5927\u5C0F"
21
+ }, /*#__PURE__*/React__default.createElement(IconButton, {
22
+ onClick: () => renderSNA()
23
+ }, /*#__PURE__*/React__default.createElement(default_1, null))));
24
+ };
25
+ ResetBtn.propTypes = {
26
+ renderSNA: PropTypes.func.isRequired
27
+ };
28
+
29
+ var css_248z = ".SNA {\n overflow: hidden;\n object-fit: contain;\n position: relative;\n font-size: 0.75rem;\n width: 100%; }\n .SNA--smallSize .node {\n padding-top: 8px;\n font-size: 0.75rem;\n width: 3rem;\n height: 3rem;\n overflow: hidden;\n white-space: pre-wrap;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical; }\n .SNA .node {\n background-color: #4a4e69;\n border-radius: 50%;\n color: #fff;\n font-size: 20px;\n font-weight: 500;\n height: 54px;\n width: 54px;\n padding-top: 15px;\n position: absolute;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: grab; }\n .SNA .links line {\n stroke: #c7bfb4;\n stroke-width: 2; }\n .SNA .mainNode {\n fill: #4e3a16; }\n .SNA .person {\n fill: #867b3a; }\n .SNA .publication {\n fill: #825c0d; }\n .SNA .article {\n fill: #afafaf; }\n .SNA .keyword {\n fill: #fcfae8; }\n .SNA .org {\n fill: #000000; }\n .SNA #resetBtn {\n float: right; }\n .SNA #network-graph svg {\n width: 100%;\n height: 100%; }\n\n@media only screen and (max-width: 484px) {\n .SNA {\n margin-left: 0px; }\n .SNA .node {\n background-color: #4a4e69;\n border-radius: 50%;\n color: #fff;\n font-size: 1px;\n font-weight: 500;\n height: 44px;\n width: 44px;\n padding-top: 12px;\n position: absolute;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: grab; } }\n\n@media only screen and (max-width: 484px) {\n .SNA {\n margin-left: 0px; } }\n";
30
+ styleInject(css_248z);
31
+
32
+ /* eslint-disable indent */
33
+ var SNA = function SNA(props) {
34
+ // common
35
+ var className = props.className,
36
+ intl = props.intl,
37
+ exclude = props.exclude,
38
+ distance = props.distance,
39
+ SNAData = props.SNAData,
40
+ handleClickNodeGoto = props.handleClickNodeGoto,
41
+ DownloadExcel = props.DownloadExcel;
42
+ // styles
43
+ var width = props.width,
44
+ height = props.height,
45
+ fontColor = props.fontColor,
46
+ backgroundColor = props.backgroundColor,
47
+ iconColor = props.iconColor;
48
+ var g;
49
+ if (!SNAData || SNAData.nodes.length === 0) {
50
+ return /*#__PURE__*/React__default.createElement("div", {
51
+ className: "noData"
52
+ }, intl ? intl.formatMessage({
53
+ id: 'common.noData'
54
+ }) : '暫無資料');
55
+ }
56
+ var contentWidth = useMemo(function () {
57
+ return screen.width > 1050 ? width : screen.width - 80;
58
+ }, [screen.width]);
59
+ var contentHeight = useMemo(function () {
60
+ return screen.width > 1050 ? height : screen.height - 300;
61
+ }, [screen.width]);
62
+ var translateType = function translateType(type) {
63
+ switch (type) {
64
+ case 'mainNode':
65
+ // 主要搜尋中心
66
+ return intl ? intl.formatMessage({
67
+ id: 'SNA.search.center'
68
+ }) : '主要搜尋中心';
69
+ case 'organization':
70
+ // 組織
71
+ return intl ? intl.formatMessage({
72
+ id: 'SNA.organization'
73
+ }) : '組織';
74
+ case 'person':
75
+ // 作家
76
+ return intl ? intl.formatMessage({
77
+ id: 'SNA.author'
78
+ }) : '作家';
79
+ case 'publication':
80
+ // 著作
81
+ return intl ? intl.formatMessage({
82
+ id: 'SNA.publication'
83
+ }) : '作家';
84
+ case 'article':
85
+ // 單篇作品
86
+ return intl ? intl.formatMessage({
87
+ id: 'SNA.article'
88
+ }) : '單篇作品';
89
+ case 'keyword':
90
+ // 關鍵字
91
+ return intl ? intl.formatMessage({
92
+ id: 'SNA.keyword'
93
+ }) : '關鍵字';
94
+ case 'event':
95
+ // 事件
96
+ return intl ? intl.formatMessage({
97
+ id: 'SNA.event'
98
+ }) : '事件';
99
+ default:
100
+ return '';
101
+ }
102
+ };
103
+ var drag$1 = function drag$1(simulation) {
104
+ function dragstarted(d) {
105
+ if (!event.active) simulation.alphaTarget(0.3).restart();
106
+ d.fx = d.x;
107
+ d.fy = d.y;
108
+ }
109
+ function dragged(d) {
110
+ d.fx = event.x > contentWidth - 10 || event.x < 20 ? d.x : event.x;
111
+ d.fy = event.y > contentHeight - 10 || event.y < 20 ? d.y : event.y;
112
+ }
113
+ return drag().on('start', dragstarted).on('drag', dragged);
114
+ };
115
+ var calculateCurve = function calculateCurve(source, target, curveLen) {
116
+ var mx = (target.x + source.x) * 0.5;
117
+ var my = (target.y + source.y) * 0.5;
118
+ var tsx = target.x - source.x;
119
+ var tsy = target.y - source.y;
120
+ var L = Math.pow(Math.pow(tsx, 2) + Math.pow(tsy, 2), 0.5);
121
+ var qx = mx - tsy * curveLen / L;
122
+ var qy = my + tsx * curveLen / L;
123
+ return {
124
+ qx: qx,
125
+ qy: qy
126
+ };
127
+ };
128
+ var getLineCurve = function getLineCurve(source, target, curveLen) {
129
+ var _calculateCurve = calculateCurve(source, target, curveLen),
130
+ qx = _calculateCurve.qx,
131
+ qy = _calculateCurve.qy;
132
+ if (isNaN(qx)) {
133
+ return "M".concat(source.x, ", ").concat(source.y, " Q0 0 ").concat(target.x, " ").concat(target.y);
134
+ }
135
+ return "M".concat(source.x, ", ").concat(source.y, " Q").concat(qx, " ").concat(qy, " ").concat(target.x, " ").concat(target.y);
136
+ };
137
+ var init = function init(networkData) {
138
+ var edgeLabelSize = '10px';
139
+ var lineRaduis = 30;
140
+ var nodeStroke = 1.5;
141
+ var nodeRadius = 10 - nodeStroke;
142
+ var mainNodeRadius = 15 - nodeStroke;
143
+ var arrowPercent = 0.8;
144
+ var arrowViewBox = "-0 -".concat(nodeRadius, " ").concat(nodeRadius * 2, " ").concat(nodeRadius * 2);
145
+ var arrowPath = "M 0,-".concat(nodeRadius * arrowPercent, " L ").concat(nodeRadius * arrowPercent * 2, " ,0 L 0,").concat(nodeRadius * arrowPercent);
146
+ var color = ordinal(category10);
147
+ var links = networkData.links.map(function (d) {
148
+ return Object.create(d);
149
+ });
150
+ var nodes = networkData.nodes.map(function (d) {
151
+ return Object.create(d);
152
+ });
153
+ var simulation$1 = simulation(nodes).force('link', link(links).id(function (d) {
154
+ return d.index;
155
+ }).distance(50)).force('charge', manyBody().strength(-200).distanceMax(1000)).force('center', center(contentWidth / 2, contentHeight / 2)).force('collide', collide().radius(function () {
156
+ return nodeRadius + 5;
157
+ }).strength(1).iterations(10)).force('x', x(contentWidth / 2)).force('y', y(contentHeight / 2)).force('radial', radial(100, contentWidth / 1.5, contentHeight / 1.5));
158
+ var svg = d3Select('#sna-graph').append('svg').attr('viewBox', [0, 0, contentWidth, contentHeight]).style('background-color', backgroundColor);
159
+ svg.append('defs').append('marker').attr('id', 'arrowhead').attr('viewBox', arrowViewBox).attr('refX', nodeRadius * 2 + nodeRadius * arrowPercent).attr('refY', 0).attr('orient', 'auto').attr('markerWidth', nodeRadius * (1 + arrowPercent)).attr('markerHeight', nodeRadius * (1 + arrowPercent)).attr('xoverflow', 'visible').append('svg:path').attr('d', arrowPath).attr('fill', '#999').style('stroke', 'none');
160
+ // 增加一層g用來包住所有的物件,並對此g加入縮放功能
161
+ g = svg.append('g');
162
+ var zoomActions = function zoomActions() {
163
+ g.attr('transform', event.transform);
164
+ };
165
+ var zoomHandler = zoom().scaleExtent([0.5, 20]).extent([[0, 0], [contentWidth, contentHeight]]).on('zoom', zoomActions);
166
+ zoomHandler(svg);
167
+ var link$1 = g.append('g').attr('stroke', '#999').attr('stroke-opacity', 0.6).selectAll('line').data(links).join('path').attr('fill', 'none').attr('stroke-dasharray', function (d) {
168
+ return d.ontology === 'protege' ? '2,5,3' : '';
169
+ }).attr('key', function (d) {
170
+ return d.type;
171
+ });
172
+ var node = g.append('g').attr('stroke', '#fff').attr('stroke-width', nodeStroke).selectAll('circle').data(nodes).join('circle').attr('r', function (d) {
173
+ return d.type === 'mainNode' ? mainNodeRadius : nodeRadius;
174
+ }).attr('fill', function (d) {
175
+ return color(d.type);
176
+ }).attr('key', function (d) {
177
+ return d.type;
178
+ }).attr('class', function (d) {
179
+ return "node node-".concat(d.id, " ").concat(d.type && d.type === 'organization' ? 'org' : d.type === 'person' ? 'person' : d.type === 'publication' ? 'publication' : d.type === 'mainNode' ? 'mainNode' : d.type === 'article' ? 'article' : d.type === 'keyword' ? 'keyword' : d.type === 'event' ? 'event' : '');
180
+ }).on('click', function (d) {
181
+ return d.hasClick ? handleClickNodeGoto({
182
+ name: d.name,
183
+ id: d.id,
184
+ type: d.type
185
+ }) : null;
186
+ }).call(drag$1(simulation$1));
187
+ node.append('title').text(function (d) {
188
+ return "".concat(d.name, "-").concat(translateType(d.type));
189
+ });
190
+ var nodeLabel = g.append('g').selectAll('text').data(nodes).join('text').attr('fill', fontColor).attr('text-anchor', 'middle').attr('key', function (d) {
191
+ return d.type;
192
+ }).style('color', '#fff').style('font-size', '14px').text(function (d) {
193
+ return d.name;
194
+ });
195
+ var edgepaths = g.selectAll('.edgepath').data(links).enter().append('path').attr('class', 'edgepath').attr('fill-opacity', 0).attr('stroke-opacity', 0).attr('id', function (d, i) {
196
+ return "edgepath".concat(i);
197
+ }).style('pointer-events', 'none');
198
+ var edgelabels = g.selectAll('.edgelabel').data(links).enter().append('text').style('pointer-events', 'none').attr('class', 'edgelabel').attr('font-size', edgeLabelSize).attr('fill', '#aaa').attr('visibility', 'visible').attr('key', function (d) {
199
+ return d.type;
200
+ }).attr('id', function (d, i) {
201
+ return "edgelabel".concat(i);
202
+ });
203
+ edgelabels.append('textPath').attr('xlink:href', function (d, i) {
204
+ return "#edgepath".concat(i);
205
+ }).style('text-anchor', 'middle').style('pointer-events', 'none').attr('startOffset', '50%').text(function (d) {
206
+ return d.property;
207
+ });
208
+ simulation$1.on('tick', function () {
209
+ nodes.forEach(function (d) {
210
+ // x軸 超過寬度380,回彈到380座標軸區域位置。 ——作用爲:超出範圍的回彈到視圖寬度範圍內
211
+ if (d.x >= contentWidth - 20) {
212
+ d.x = contentWidth - 20;
213
+ }
214
+ // y軸 超過高度280,回彈到280座標軸區域位置。 ——作用爲:超出範圍的回彈到視圖高度範圍內
215
+ if (d.y >= contentHeight - 20) {
216
+ d.y = contentHeight - 20;
217
+ }
218
+ if (d.x <= 20) {
219
+ d.x = 20;
220
+ }
221
+ if (d.y <= 20) {
222
+ d.y = 20;
223
+ }
224
+ });
225
+ link$1.attr('d', function (d) {
226
+ return getLineCurve(d.source, d.target, lineRaduis);
227
+ });
228
+ node.attr('cx', function (d) {
229
+ return d.x;
230
+ }).attr('cy', function (d) {
231
+ return d.y;
232
+ });
233
+ nodeLabel.attr('x', function (d) {
234
+ return d.x;
235
+ }).attr('y', function (d) {
236
+ return d.y - nodeRadius;
237
+ });
238
+ edgepaths.attr('d', function (d) {
239
+ return getLineCurve(d.source, d.target, lineRaduis);
240
+ });
241
+ });
242
+ };
243
+ var renderSNA = function renderSNA() {
244
+ if (SNAData && SNAData.nodes && SNAData.nodes.length > 0) {
245
+ var div = document.getElementById('sna-graph');
246
+ if (div && div.childNodes[0]) {
247
+ div.removeChild(div.childNodes[0]);
248
+ }
249
+ init(SNAData);
250
+ }
251
+ };
252
+
253
+ // 資料異動或全螢幕切換,重新渲染網絡圖
254
+ useEffect(function () {
255
+ renderSNA();
256
+ }, [SNAData]);
257
+ return /*#__PURE__*/React__default.createElement("div", {
258
+ className: classNames('SNA', {
259
+ 'SNA--smallSize': distance < 200
260
+ }, className),
261
+ style: {
262
+ contentWidth: contentWidth,
263
+ contentHeight: contentHeight,
264
+ backgroundColor: backgroundColor
265
+ }
266
+ }, /*#__PURE__*/React__default.createElement(ExtraTools, {
267
+ intl: intl,
268
+ data: SNAData,
269
+ iconColor: iconColor,
270
+ domToImageId: "sna-graph",
271
+ FontSizeTargets: ['#sna-graph svg g text'],
272
+ exclude: exclude,
273
+ DownloadExcel: DownloadExcel,
274
+ fullscreenDomId: "sna-graph"
275
+ }), /*#__PURE__*/React__default.createElement(ResetBtn, {
276
+ renderSNA: renderSNA
277
+ }), /*#__PURE__*/React__default.createElement("div", {
278
+ id: "sna-graph"
279
+ }));
280
+ };
281
+ SNA.defaultProps = {
282
+ className: undefined,
283
+ intl: undefined,
284
+ width: 1050,
285
+ height: 600,
286
+ distance: 400,
287
+ SNAData: null,
288
+ fontColor: '#000000',
289
+ backgroundColor: '#FFFFFF',
290
+ iconColor: '#825c0d',
291
+ exclude: ['downloadXls', 'downloadTsv'],
292
+ handleClickNodeGoto: null,
293
+ DownloadExcel: undefined
294
+ };
295
+
296
+ /* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
297
+ SNA.propTypes = {
298
+ /** Css Name */
299
+ className: PropTypes.string,
300
+ /** 語言 */
301
+ intl: PropTypes.objectOf(PropTypes.any),
302
+ /** 寬度 */
303
+ width: PropTypes.number,
304
+ /** 高度 */
305
+ height: PropTypes.number,
306
+ /** 點跟點之間的距離 */
307
+ distance: PropTypes.number,
308
+ /** 資料 */
309
+ SNAData: PropTypes.objectOf(PropTypes.any),
310
+ /** 網絡圖文字顏色 */
311
+ fontColor: PropTypes.string,
312
+ /** 網絡圖背景顏色 */
313
+ backgroundColor: PropTypes.string,
314
+ /** icon顏色 */
315
+ iconColor: PropTypes.string,
316
+ /** 不顯示的按鈕 ['share', 'downloadImage', 'downloadTsv', 'downloadXls', 'fullscreen', 'fontSizeChanger'] */
317
+ exclude: PropTypes.arrayOf(PropTypes.string),
318
+ /** 按下點後要轉址的功能 */
319
+ handleClickNodeGoto: PropTypes.func,
320
+ /** Download元件, 由外部傳入的原因是需要環境設定 */
321
+ DownloadExcel: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
322
+ };
323
+
324
+ export { SNA as default };
@@ -1 +1,114 @@
1
- import{b as e,d as l}from"./_rollupPluginBabelHelpers-fde6d1c6.js";import a from"react";import t from"prop-types";import{s as n,c as o}from"./vendor-851c6356.js";import{FormControl as r,Select as s,CircularProgress as i,MenuItem as c}from"@material-ui/core";import{E as u}from"./Empty-70f040a9.js";n(".select__placeholder {\n color: #999; }\n\n.select--small {\n width: 100%; }\n .select--small .MuiSelect-root {\n padding: 0.5rem 1.5rem 0.25rem;\n color: white; }\n .select--small .MuiSelect-root .select__placeholder {\n color: white; }\n .select--small .MuiSelect-root:hover, .select--small .MuiSelect-root:focus {\n background: transparent; }\n .select--small .MuiSvgIcon-root {\n color: white; }\n .select--small .MuiOutlinedInput-root {\n border-radius: 45px; }\n");var m=function(t){var n=t.style,m=t.className,d=t.labelInValue,p=t.disabled,v=t.loading,b=t.placeholder,f=t.variantSmall,g=t.background,y=t.menuItemClass,h=t.options,E=t.value,S=t.defaultValue,j=t.onChange,I=function(e){return(h||[]).find((function(a){return"object"===l(a)?e===a.value:e===a}))||e};return a.createElement(r,{className:o("select",{"select--small":f},m),variant:"outlined"},a.createElement(s,{style:e(e({},n||{}),{},{background:g}),displayEmpty:!0,disabled:p||v,renderValue:function(e){var t=I(e),n="object"===l(t)?t.label:t;return(!e&&0!==e||0===e.length)&&(n=a.createElement("span",{className:"select__placeholder"},b)),a.createElement(a.Fragment,null,n,v&&a.createElement(i,{size:16,style:{marginLeft:8,marginRight:4}}))},value:E,defaultValue:S,onChange:function(e){return j(d?I(e.target.value):e.target.value)}},Array.isArray(h)&&h.length>0?h.map((function(e){var t="object"===l(e)?e.value:e,n="object"===l(e)?e.label:e;return a.createElement(c,{key:t,value:t,ListItemClasses:y},n)})):a.createElement(u,null)))};m.defaultProps={style:void 0,className:void 0,value:void 0,defaultValue:void 0,options:void 0,labelInValue:void 0,disabled:void 0,loading:void 0,placeholder:"Please select...",variantSmall:void 0,background:void 0,menuItemClass:void 0,onChange:function(){}},m.propTypes={style:t.objectOf(t.any),className:t.string,value:t.oneOfType([t.string,t.number]),defaultValue:t.oneOfType([t.string,t.number]),options:t.arrayOf(t.any),labelInValue:t.bool,disabled:t.bool,loading:t.bool,placeholder:t.string,variantSmall:t.bool,background:t.string,menuItemClass:t.objectOf(t.any),onChange:t.func};export{m as S};
1
+ import { b as _objectSpread2, d as _typeof } from './_rollupPluginBabelHelpers-fde6d1c6.js';
2
+ import React__default from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { s as styleInject, c as classNames } from './vendor-851c6356.js';
5
+ import { FormControl, Select as Select$1, CircularProgress, MenuItem } from '@material-ui/core';
6
+ import { E as Empty } from './Empty-70f040a9.js';
7
+
8
+ var css_248z = ".select__placeholder {\n color: #999; }\n\n.select--small {\n width: 100%; }\n .select--small .MuiSelect-root {\n padding: 0.5rem 1.5rem 0.25rem;\n color: white; }\n .select--small .MuiSelect-root .select__placeholder {\n color: white; }\n .select--small .MuiSelect-root:hover, .select--small .MuiSelect-root:focus {\n background: transparent; }\n .select--small .MuiSvgIcon-root {\n color: white; }\n .select--small .MuiOutlinedInput-root {\n border-radius: 45px; }\n";
9
+ styleInject(css_248z);
10
+
11
+ var Select = function Select(props) {
12
+ var style = props.style,
13
+ className = props.className,
14
+ labelInValue = props.labelInValue,
15
+ disabled = props.disabled,
16
+ loading = props.loading,
17
+ placeholder = props.placeholder,
18
+ variantSmall = props.variantSmall,
19
+ background = props.background,
20
+ menuItemClass = props.menuItemClass;
21
+ var options = props.options,
22
+ value = props.value,
23
+ defaultValue = props.defaultValue,
24
+ _onChange = props.onChange;
25
+ var itemFind = function itemFind(key) {
26
+ return (options || []).find(function (option) {
27
+ return _typeof(option) === 'object' ? key === option.value : key === option;
28
+ }) || key;
29
+ };
30
+ return /*#__PURE__*/React__default.createElement(FormControl, {
31
+ className: classNames('select', {
32
+ 'select--small': variantSmall
33
+ }, className),
34
+ variant: "outlined"
35
+ }, /*#__PURE__*/React__default.createElement(Select$1, {
36
+ style: _objectSpread2(_objectSpread2({}, style || {}), {}, {
37
+ background: background
38
+ }),
39
+ displayEmpty: true,
40
+ disabled: disabled || loading,
41
+ renderValue: function renderValue(id) {
42
+ var finder = itemFind(id);
43
+ var content = _typeof(finder) === 'object' ? finder.label : finder;
44
+ if (!id && id !== 0 || id.length === 0) content = /*#__PURE__*/React__default.createElement("span", {
45
+ className: "select__placeholder"
46
+ }, placeholder);
47
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, content, loading && /*#__PURE__*/React__default.createElement(CircularProgress, {
48
+ size: 16,
49
+ style: {
50
+ marginLeft: 8,
51
+ marginRight: 4
52
+ }
53
+ }));
54
+ },
55
+ value: value,
56
+ defaultValue: defaultValue,
57
+ onChange: function onChange(event) {
58
+ return _onChange(labelInValue ? itemFind(event.target.value) : event.target.value);
59
+ }
60
+ }, Array.isArray(options) && options.length > 0 ? options.map(function (option) {
61
+ var key = _typeof(option) === 'object' ? option.value : option;
62
+ var text = _typeof(option) === 'object' ? option.label : option;
63
+ return /*#__PURE__*/React__default.createElement(MenuItem, {
64
+ key: key,
65
+ value: key,
66
+ ListItemClasses: menuItemClass
67
+ }, text);
68
+ }) : /*#__PURE__*/React__default.createElement(Empty, null)));
69
+ };
70
+ Select.defaultProps = {
71
+ style: undefined,
72
+ className: undefined,
73
+ value: undefined,
74
+ defaultValue: undefined,
75
+ options: undefined,
76
+ labelInValue: undefined,
77
+ disabled: undefined,
78
+ loading: undefined,
79
+ placeholder: 'Please select...',
80
+ variantSmall: undefined,
81
+ background: undefined,
82
+ menuItemClass: undefined,
83
+ onChange: function onChange() {}
84
+ };
85
+ Select.propTypes = {
86
+ /** 樣式 */
87
+ style: PropTypes.objectOf(PropTypes.any),
88
+ /** Css Name */
89
+ className: PropTypes.string,
90
+ /** 選擇的id */
91
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
92
+ /** 預設選擇的id */
93
+ defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
94
+ /** 下拉選單清單 */
95
+ options: PropTypes.arrayOf(PropTypes.any),
96
+ /** onChange時 label value 一起回傳 */
97
+ labelInValue: PropTypes.bool,
98
+ /** 是否禁止使用 */
99
+ disabled: PropTypes.bool,
100
+ /** 是否載入中 */
101
+ loading: PropTypes.bool,
102
+ /** 下拉選單提示字 */
103
+ placeholder: PropTypes.string,
104
+ /** 是否使用小size */
105
+ variantSmall: PropTypes.bool,
106
+ /** 使用變體後的顏色 */
107
+ background: PropTypes.string,
108
+ /** override menuItem class */
109
+ menuItemClass: PropTypes.objectOf(PropTypes.any),
110
+ /** 點選後的返回 */
111
+ onChange: PropTypes.func
112
+ };
113
+
114
+ export { Select as S };
@@ -1 +1,10 @@
1
- export{S as default}from"./Select-98a8e973.js";import"./_rollupPluginBabelHelpers-fde6d1c6.js";import"react";import"prop-types";import"./vendor-851c6356.js";import"react-is";import"@material-ui/styles";import"react-dom";import"@material-ui/core";import"./Empty-70f040a9.js";
1
+ export { S as default } from './Select-98a8e973.js';
2
+ import './_rollupPluginBabelHelpers-fde6d1c6.js';
3
+ import 'react';
4
+ import 'prop-types';
5
+ import './vendor-851c6356.js';
6
+ import 'react-is';
7
+ import '@material-ui/styles';
8
+ import 'react-dom';
9
+ import '@material-ui/core';
10
+ import './Empty-70f040a9.js';
@@ -1 +1,74 @@
1
- import e,{useMemo as n}from"react";import t from"prop-types";import{s as i,c as s}from"./vendor-851c6356.js";import{Fade as r,CircularProgress as o}from"@material-ui/core";i(".customSpin {\n width: 100%;\n min-height: 100px;\n position: relative; }\n .customSpin__spin {\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: 2;\n display: flex;\n justify-content: center;\n align-items: center; }\n");var m={small:16,middle:24,large:40},a=function(t){var i=t.className,a=t.spinning,l=t.children,p=t.size,c=t.style,u=function(e){var n=e<16?16:e;return n>300?300:n},d=n((function(){return"string"==typeof p?Number(p)&&"number"==typeof Number(p)?u(Number(p)):m[p]||40:"number"==typeof p?u(p):40}),[p]);return e.createElement("div",{className:s("customSpin",i),style:c||{}},e.createElement(r,{in:a,style:{transitionDelay:"300ms"},unmountOnExit:!0},e.createElement("div",{className:"customSpin__spin"},e.createElement(o,{size:d}))),l)};a.defaultProps={className:void 0,spinning:!1,children:null,size:void 0,style:void 0},a.propTypes={className:t.string,spinning:t.bool,children:t.node,size:t.oneOfType([t.oneOf(Object.keys(m)),t.number]),style:t.objectOf(t.any)};export{a as S};
1
+ import React__default, { useMemo } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { s as styleInject, c as classNames } from './vendor-851c6356.js';
4
+ import { Fade, CircularProgress } from '@material-ui/core';
5
+
6
+ var css_248z = ".customSpin {\n width: 100%;\n min-height: 100px;\n position: relative; }\n .customSpin__spin {\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: 2;\n display: flex;\n justify-content: center;\n align-items: center; }\n";
7
+ styleInject(css_248z);
8
+
9
+ var stringSize = {
10
+ small: 16,
11
+ middle: 24,
12
+ large: 40
13
+ };
14
+ var Spin = function Spin(props) {
15
+ var className = props.className,
16
+ spinning = props.spinning,
17
+ children = props.children,
18
+ size = props.size,
19
+ style = props.style;
20
+ var maxValue = function maxValue(val) {
21
+ // 極大極小值限制 300/16
22
+ var min = val < 16 ? 16 : val;
23
+ var max = min > 300 ? 300 : min;
24
+ return max;
25
+ };
26
+ var matchSize = useMemo(function () {
27
+ if (typeof size === 'string') {
28
+ if (Number(size) && typeof Number(size) === 'number') {
29
+ return maxValue(Number(size));
30
+ }
31
+ return stringSize[size] || 40;
32
+ }
33
+ if (typeof size === 'number') {
34
+ return maxValue(size);
35
+ }
36
+ // default size is large
37
+ return 40;
38
+ }, [size]);
39
+ return /*#__PURE__*/React__default.createElement("div", {
40
+ className: classNames('customSpin', className),
41
+ style: style || {}
42
+ }, /*#__PURE__*/React__default.createElement(Fade, {
43
+ in: spinning,
44
+ style: {
45
+ transitionDelay: '300ms'
46
+ },
47
+ unmountOnExit: true
48
+ }, /*#__PURE__*/React__default.createElement("div", {
49
+ className: "customSpin__spin"
50
+ }, /*#__PURE__*/React__default.createElement(CircularProgress, {
51
+ size: matchSize
52
+ }))), children);
53
+ };
54
+ Spin.defaultProps = {
55
+ className: undefined,
56
+ spinning: false,
57
+ children: null,
58
+ size: undefined,
59
+ style: undefined
60
+ };
61
+ Spin.propTypes = {
62
+ /** Css Name */
63
+ className: PropTypes.string,
64
+ /** 是否載入中 */
65
+ spinning: PropTypes.bool,
66
+ /** 內容 */
67
+ children: PropTypes.node,
68
+ /** 自訂尺寸 */
69
+ size: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(stringSize)), PropTypes.number]),
70
+ /** 自訂Style設置 */
71
+ style: PropTypes.objectOf(PropTypes.any)
72
+ };
73
+
74
+ export { Spin as S };
@@ -1 +1,8 @@
1
- export{S as default}from"./Spin-690a3597.js";import"react";import"prop-types";import"./vendor-851c6356.js";import"react-is";import"@material-ui/styles";import"react-dom";import"@material-ui/core";
1
+ export { S as default } from './Spin-690a3597.js';
2
+ import 'react';
3
+ import 'prop-types';
4
+ import './vendor-851c6356.js';
5
+ import 'react-is';
6
+ import '@material-ui/styles';
7
+ import 'react-dom';
8
+ import '@material-ui/core';
@@ -1 +1,51 @@
1
- import{c as e}from"./_rollupPluginBabelHelpers-fde6d1c6.js";import r from"react";import a from"prop-types";import{TableContainer as t,Paper as n,Table as l,TableHead as m,TableRow as o,TableCell as c,TableBody as s}from"@material-ui/core";var p=["render"],u=function(a){var u=a.className,i=a.columns,f=a.data;return r.createElement(t,{className:u,component:n},r.createElement(l,{className:"customTable"},r.createElement(m,null,r.createElement(o,null,Array.isArray(i)&&i.map((function(e){var a=e.field,t=e.headerName;return r.createElement(c,{key:a},t)})))),r.createElement(s,null,Array.isArray(f)&&f.map((function(a,t){return r.createElement(o,{key:t.toString()},Array.isArray(i)&&i.map((function(t){var n=t.render,l=e(t,p).field;return r.createElement(c,{key:l,component:"th",scope:"row"},n&&n(a)||a[l])})))})))))};u.defaultProps={className:void 0,columns:[],data:[]},u.propTypes={className:a.string,columns:a.arrayOf(a.any),data:a.arrayOf(a.any)};export{u as default};
1
+ import { c as _objectWithoutProperties } from './_rollupPluginBabelHelpers-fde6d1c6.js';
2
+ import React__default from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { TableContainer, Paper, Table as Table$1, TableHead, TableRow, TableCell, TableBody } from '@material-ui/core';
5
+
6
+ var _excluded = ["render"];
7
+ var Table = function Table(_ref) {
8
+ var className = _ref.className,
9
+ columns = _ref.columns,
10
+ data = _ref.data;
11
+ return /*#__PURE__*/React__default.createElement(TableContainer, {
12
+ className: className,
13
+ component: Paper
14
+ }, /*#__PURE__*/React__default.createElement(Table$1, {
15
+ className: "customTable"
16
+ }, /*#__PURE__*/React__default.createElement(TableHead, null, /*#__PURE__*/React__default.createElement(TableRow, null, Array.isArray(columns) && columns.map(function (_ref2) {
17
+ var field = _ref2.field,
18
+ headerName = _ref2.headerName;
19
+ return /*#__PURE__*/React__default.createElement(TableCell, {
20
+ key: field
21
+ }, headerName);
22
+ }))), /*#__PURE__*/React__default.createElement(TableBody, null, Array.isArray(data) && data.map(function (item, index) {
23
+ return /*#__PURE__*/React__default.createElement(TableRow, {
24
+ key: index.toString()
25
+ }, Array.isArray(columns) && columns.map(function (_ref3) {
26
+ var render = _ref3.render,
27
+ columnProps = _objectWithoutProperties(_ref3, _excluded);
28
+ var field = columnProps.field;
29
+ return /*#__PURE__*/React__default.createElement(TableCell, {
30
+ key: field,
31
+ component: "th",
32
+ scope: "row"
33
+ }, render && render(item) || item[field]);
34
+ }));
35
+ }))));
36
+ };
37
+ Table.defaultProps = {
38
+ className: undefined,
39
+ columns: [],
40
+ data: []
41
+ };
42
+ Table.propTypes = {
43
+ /** Css Name */
44
+ className: PropTypes.string,
45
+ /** 欄位列表 */
46
+ columns: PropTypes.arrayOf(PropTypes.any),
47
+ /** 表格內容 */
48
+ data: PropTypes.arrayOf(PropTypes.any)
49
+ };
50
+
51
+ export { Table as default };