@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,17 @@
1
- export{C as default}from"./ContactModal-d7e2f8bb.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"axios";import"./Modal-a7591b98.js";import"@material-ui/core";import"@material-ui/icons";import"./Button-63c7e9f3.js";import"./Spin-690a3597.js";import"./Select-98a8e973.js";import"./Empty-70f040a9.js";import"./globalConfig-40069b54.js";
1
+ export { C as default } from './ContactModal-a59bc808.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 'axios';
10
+ import './Modal-a7591b98.js';
11
+ import '@material-ui/core';
12
+ import '@material-ui/icons';
13
+ import './Button-63c7e9f3.js';
14
+ import './Spin-690a3597.js';
15
+ import './Select-98a8e973.js';
16
+ import './Empty-70f040a9.js';
17
+ import './globalConfig';
@@ -1 +1,157 @@
1
- import{a as e}from"./_rollupPluginBabelHelpers-fde6d1c6.js";import r,{useState as a}from"react";import n from"prop-types";import{List as t,ListItem as o,ListItemIcon as l,ListItemText as i,IconButton as s,Drawer as d,Divider as p}from"@material-ui/core";import{DehazeRounded as u}from"@material-ui/icons";import{S as c}from"./Select-98a8e973.js";import{useHistory as m,useRouteMatch as g}from"react-router-dom";import{s as f}from"./vendor-851c6356.js";var w=[{value:"zh-tw",label:"繁體中文"}],_=function(e){var r=e.language,a=e.supportLanguages;return a.some((function(e){return e.value===r}))?r:a[0].value};const h=e=>{let{drawerList:a,setOpen:n}=e;const s=m(),{url:d}=g();return r.createElement(t,{className:"drawer__list"},Array.isArray(a)&&a.map(((e,a)=>{let{name:t,icon:p,path:u}=e;return r.createElement(o,{button:!0,key:a.toString(),onClick:()=>{u.indexOf("http")>-1?window.location=u:s.push({pathname:`${d}${u}`}),n(!1)}},p&&r.createElement(l,{style:{marginRight:24}},p),r.createElement(i,{primary:t}))})))};h.defaultProps={},h.propTypes={drawerList:n.arrayOf(n.any).isRequired,setOpen:n.func.isRequired};f(".drawer__icon {\n display: none !important; }\n\n.drawer__header {\n display: flex;\n align-items: center;\n padding: 20px; }\n .drawer__header-title {\n font-size: 18px;\n font-weight: bold; }\n\n.drawer__list {\n padding: 10px !important; }\n .drawer__list .MuiSvgIcon-root {\n margin-left: 8px; }\n\n.drawer__lang {\n margin: 24px 36px !important; }\n\n@media screen and (max-width: 768px) {\n .drawer {\n display: flex;\n justify-content: flex-end; }\n .drawer__icon {\n display: flex !important; } }\n");var y=function(n){var t=n.title,o=n.logo,l=n.locale,i=n.supportLanguages,m=n.drawerList,g=n.onLanguageChange,f=a(!1),w=e(f,2),y=w[0],v=w[1];return r.createElement("div",{className:"drawer"},r.createElement(s,{className:"drawer__icon",onClick:function(){return v(!0)}},r.createElement(u,{fontSize:"large"})),r.createElement(d,{anchor:"right",open:y,onClose:function(){return v(!1)},onKeyDown:function(){return v(!1)}},(o||t)&&r.createElement("div",{className:"drawer__header"},r.createElement("div",{className:"drawer__header-logo"},o),r.createElement("div",{className:"drawer__header-title"},t)),r.createElement(p,null),r.createElement(h,{drawerList:(Array.isArray(m)?m:[]).filter((function(e){return e.showInHeader})),setOpen:v}),r.createElement(p,null),Array.isArray(i)&&i.length>0&&r.createElement(c,{className:"drawer__lang",defaultValue:_({language:l,supportLanguages:i}),onChange:function(e){return g(e)},options:i})))};y.defaultProps={title:void 0,logo:void 0,locale:void 0,supportLanguages:[{value:"en",label:"English"},{value:"zh-tw",label:"繁體中文"},{value:"zh-cn",label:"簡體中文"}],drawerList:void 0,onLanguageChange:function(){}},y.propTypes={title:n.string,logo:n.node,locale:n.string,supportLanguages:n.arrayOf(n.any),drawerList:n.arrayOf(n.any),onLanguageChange:n.func};export{y as D,_ as c,w as d};
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-fde6d1c6.js';
2
+ import React__default, { useState } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { List, ListItem, ListItemIcon, ListItemText, IconButton, Drawer as Drawer$1, Divider } from '@material-ui/core';
5
+ import { DehazeRounded } from '@material-ui/icons';
6
+ import { S as Select } from './Select-98a8e973.js';
7
+ import { useHistory, useRouteMatch } from 'react-router-dom';
8
+ import { s as styleInject } from './vendor-851c6356.js';
9
+
10
+ var defaultSupportLanguage = [
11
+ // { value: 'en', label: 'English' },
12
+ {
13
+ value: 'zh-tw',
14
+ label: '繁體中文'
15
+ }
16
+ // { value: 'zh-cn', label: '簡體中文' },
17
+ ];
18
+
19
+ /* [檢查-語系]本系統是否支援該語系 並回傳語系 */
20
+ var checkLanguageSupport = function checkLanguageSupport(_ref) {
21
+ var language = _ref.language,
22
+ supportLanguages = _ref.supportLanguages;
23
+ var isSupport = supportLanguages.some(function (_ref2) {
24
+ var value = _ref2.value;
25
+ return value === language;
26
+ });
27
+ return isSupport ? language : supportLanguages[0].value;
28
+ };
29
+
30
+ const DrawerList = _ref => {
31
+ let {
32
+ drawerList,
33
+ setOpen
34
+ } = _ref;
35
+ const history = useHistory();
36
+ const {
37
+ url
38
+ } = useRouteMatch();
39
+ return /*#__PURE__*/React__default.createElement(List, {
40
+ className: "drawer__list"
41
+ }, Array.isArray(drawerList) && drawerList.map((_ref2, index) => {
42
+ let {
43
+ name,
44
+ icon,
45
+ path
46
+ } = _ref2;
47
+ return /*#__PURE__*/React__default.createElement(ListItem, {
48
+ button: true,
49
+ key: index.toString(),
50
+ onClick: () => {
51
+ if (path.indexOf('http') > -1) {
52
+ window.location = path;
53
+ } else {
54
+ history.push({
55
+ pathname: `${url}${path}`
56
+ });
57
+ }
58
+ setOpen(false);
59
+ }
60
+ }, icon && /*#__PURE__*/React__default.createElement(ListItemIcon, {
61
+ style: {
62
+ marginRight: 24
63
+ }
64
+ }, icon), /*#__PURE__*/React__default.createElement(ListItemText, {
65
+ primary: name
66
+ }));
67
+ }));
68
+ };
69
+ DrawerList.defaultProps = {};
70
+ DrawerList.propTypes = {
71
+ drawerList: PropTypes.arrayOf(PropTypes.any).isRequired,
72
+ setOpen: PropTypes.func.isRequired
73
+ };
74
+
75
+ var css_248z = ".drawer__icon {\n display: none !important; }\n\n.drawer__header {\n display: flex;\n align-items: center;\n padding: 20px; }\n .drawer__header-title {\n font-size: 18px;\n font-weight: bold; }\n\n.drawer__list {\n padding: 10px !important; }\n .drawer__list .MuiSvgIcon-root {\n margin-left: 8px; }\n\n.drawer__lang {\n margin: 24px 36px !important; }\n\n@media screen and (max-width: 768px) {\n .drawer {\n display: flex;\n justify-content: flex-end; }\n .drawer__icon {\n display: flex !important; } }\n";
76
+ styleInject(css_248z);
77
+
78
+ var Drawer = function Drawer(_ref) {
79
+ var title = _ref.title,
80
+ logo = _ref.logo,
81
+ locale = _ref.locale,
82
+ supportLanguages = _ref.supportLanguages,
83
+ drawerList = _ref.drawerList,
84
+ onLanguageChange = _ref.onLanguageChange;
85
+ var _useState = useState(false),
86
+ _useState2 = _slicedToArray(_useState, 2),
87
+ open = _useState2[0],
88
+ setOpen = _useState2[1];
89
+ return /*#__PURE__*/React__default.createElement("div", {
90
+ className: "drawer"
91
+ }, /*#__PURE__*/React__default.createElement(IconButton, {
92
+ className: "drawer__icon",
93
+ onClick: function onClick() {
94
+ return setOpen(true);
95
+ }
96
+ }, /*#__PURE__*/React__default.createElement(DehazeRounded, {
97
+ fontSize: "large"
98
+ })), /*#__PURE__*/React__default.createElement(Drawer$1, {
99
+ anchor: "right",
100
+ open: open,
101
+ onClose: function onClose() {
102
+ return setOpen(false);
103
+ },
104
+ onKeyDown: function onKeyDown() {
105
+ return setOpen(false);
106
+ }
107
+ }, (logo || title) && /*#__PURE__*/React__default.createElement("div", {
108
+ className: "drawer__header"
109
+ }, /*#__PURE__*/React__default.createElement("div", {
110
+ className: "drawer__header-logo"
111
+ }, logo), /*#__PURE__*/React__default.createElement("div", {
112
+ className: "drawer__header-title"
113
+ }, title)), /*#__PURE__*/React__default.createElement(Divider, null), /*#__PURE__*/React__default.createElement(DrawerList, {
114
+ drawerList: (Array.isArray(drawerList) ? drawerList : []).filter(function (_ref2) {
115
+ var showInHeader = _ref2.showInHeader;
116
+ return showInHeader;
117
+ }),
118
+ setOpen: setOpen
119
+ }), /*#__PURE__*/React__default.createElement(Divider, null), Array.isArray(supportLanguages) && supportLanguages.length > 0 && /*#__PURE__*/React__default.createElement(Select, {
120
+ className: "drawer__lang",
121
+ defaultValue: checkLanguageSupport({
122
+ language: locale,
123
+ supportLanguages: supportLanguages
124
+ }),
125
+ onChange: function onChange(value) {
126
+ return onLanguageChange(value);
127
+ },
128
+ options: supportLanguages
129
+ })));
130
+ };
131
+ Drawer.defaultProps = {
132
+ title: undefined,
133
+ logo: undefined,
134
+ locale: undefined,
135
+ supportLanguages: [{
136
+ value: 'en',
137
+ label: 'English'
138
+ }, {
139
+ value: 'zh-tw',
140
+ label: '繁體中文'
141
+ }, {
142
+ value: 'zh-cn',
143
+ label: '簡體中文'
144
+ }],
145
+ drawerList: undefined,
146
+ onLanguageChange: function onLanguageChange() {}
147
+ };
148
+ Drawer.propTypes = {
149
+ title: PropTypes.string,
150
+ logo: PropTypes.node,
151
+ locale: PropTypes.string,
152
+ supportLanguages: PropTypes.arrayOf(PropTypes.any),
153
+ drawerList: PropTypes.arrayOf(PropTypes.any),
154
+ onLanguageChange: PropTypes.func
155
+ };
156
+
157
+ export { Drawer as D, checkLanguageSupport as c, defaultSupportLanguage as d };
@@ -1 +1,13 @@
1
- export{D as default}from"./Drawer-af3ed21a.js";import"./_rollupPluginBabelHelpers-fde6d1c6.js";import"react";import"prop-types";import"@material-ui/core";import"@material-ui/icons";import"./Select-98a8e973.js";import"./vendor-851c6356.js";import"react-is";import"@material-ui/styles";import"react-dom";import"./Empty-70f040a9.js";import"react-router-dom";
1
+ export { D as default } from './Drawer-af3ed21a.js';
2
+ import './_rollupPluginBabelHelpers-fde6d1c6.js';
3
+ import 'react';
4
+ import 'prop-types';
5
+ import '@material-ui/core';
6
+ import '@material-ui/icons';
7
+ import './Select-98a8e973.js';
8
+ import './vendor-851c6356.js';
9
+ import 'react-is';
10
+ import '@material-ui/styles';
11
+ import 'react-dom';
12
+ import './Empty-70f040a9.js';
13
+ import 'react-router-dom';
@@ -1 +1,135 @@
1
- import{a as e}from"./_rollupPluginBabelHelpers-fde6d1c6.js";import n,{useRef as o,useState as r}from"react";import{s as t,c as i}from"./vendor-851c6356.js";import a from"prop-types";import{Button as l,Menu as c,Divider as s,MenuItem as d,ListItemIcon as p,ListItemText as u}from"@material-ui/core";import{makeStyles as m}from"@material-ui/styles";import"react-is";import"react-dom";t("");var f={default:"outlined",primary:"contained",link:"text"},b=function(t){var a=t.className,b=t.type,v=t.disabled,y=t.children,C=t.icon,E=t.options,g=t.onOpen,h=t.onClose,k=t.getPopupContainer,O=o(null),P=r(!1),A=e(P,2),N=A[0],x=A[1],j=m((function(){return{root:{opacity:.6,pointerEvents:"none",cursor:"pointer"},disabled:!0}}));return n.createElement("div",{className:i("dropdown",a)},n.createElement(l,{id:"basic-button",ref:O,"aria-controls":"basic-menu","aria-haspopup":"true","aria-expanded":N?"true":void 0,onClick:function(){E&&Array.isArray(E)&&E.length>0&&(x(!0),g&&g())},variant:f[b]||"text",startIcon:C||null,disabled:v||!1},y||null),n.createElement(c,{id:"basic-menu",getContentAnchorEl:null,container:k||O.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},anchorEl:O.current,open:N,onClose:function(){x(!1),h&&h()},MenuListProps:{"aria-labelledby":"basic-button"}},E&&Array.isArray(E)&&E.map((function(e,o){return n.createElement("div",{key:o.toString()},e.divider&&n.createElement(s,null),n.createElement(d,{className:e.disabled?j().root:"",onClick:function(){x(!1),h&&h(),e.onClick&&e.onClick({label:e.label,value:e.value})}},e.icon&&n.createElement(p,null,e.icon),e.label&&n.createElement(u,null,e.label)))}))))};b.defaultProps={className:void 0,children:void 0,icon:void 0,type:"link",disabled:void 0,options:void 0,getPopupContainer:void 0,onOpen:void 0,onClose:void 0},b.propTypes={className:a.string,children:a.node,icon:a.node,type:a.oneOf(Object.keys(f)),disabled:a.bool,options:a.arrayOf(a.any),getPopupContainer:a.func,onOpen:a.func,onClose:a.func};export{b as default};
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-fde6d1c6.js';
2
+ import React__default, { useRef, useState } from 'react';
3
+ import { s as styleInject, c as classNames } from './vendor-851c6356.js';
4
+ import PropTypes from 'prop-types';
5
+ import { Button, Menu, Divider, MenuItem, ListItemIcon, ListItemText } from '@material-ui/core';
6
+ import { makeStyles } from '@material-ui/styles';
7
+ import 'react-is';
8
+ import 'react-dom';
9
+
10
+ var css_248z = "";
11
+ styleInject(css_248z);
12
+
13
+ var buttonType = {
14
+ default: 'outlined',
15
+ primary: 'contained',
16
+ link: 'text'
17
+ };
18
+ var Dropdown = function Dropdown(props) {
19
+ var className = props.className,
20
+ type = props.type,
21
+ disabled = props.disabled; // Attributes
22
+
23
+ var children = props.children,
24
+ icon = props.icon; // Node/Elements
25
+
26
+ var options = props.options; // Data List
27
+
28
+ var onOpen = props.onOpen,
29
+ _onClose = props.onClose,
30
+ getPopupContainer = props.getPopupContainer; // Callback List
31
+
32
+ var buttonRef = useRef(null);
33
+ var _useState = useState(false),
34
+ _useState2 = _slicedToArray(_useState, 2),
35
+ open = _useState2[0],
36
+ setOpen = _useState2[1];
37
+ var useStyles = makeStyles(function () {
38
+ return {
39
+ root: {
40
+ opacity: 0.6,
41
+ pointerEvents: 'none',
42
+ cursor: 'pointer'
43
+ },
44
+ disabled: true
45
+ };
46
+ });
47
+ return /*#__PURE__*/React__default.createElement("div", {
48
+ className: classNames('dropdown', className)
49
+ }, /*#__PURE__*/React__default.createElement(Button, {
50
+ id: "basic-button",
51
+ ref: buttonRef,
52
+ "aria-controls": "basic-menu",
53
+ "aria-haspopup": "true",
54
+ "aria-expanded": open ? 'true' : undefined,
55
+ onClick: function onClick() {
56
+ if (options && Array.isArray(options) && options.length > 0) {
57
+ setOpen(true);
58
+ if (onOpen) onOpen();
59
+ }
60
+ },
61
+ variant: buttonType[type] || 'text',
62
+ startIcon: icon || null,
63
+ disabled: disabled || false
64
+ }, children || null), /*#__PURE__*/React__default.createElement(Menu, {
65
+ id: "basic-menu",
66
+ getContentAnchorEl: null,
67
+ container: getPopupContainer || buttonRef.current,
68
+ anchorOrigin: {
69
+ vertical: 'bottom',
70
+ horizontal: 'center'
71
+ },
72
+ transformOrigin: {
73
+ vertical: 'top',
74
+ horizontal: 'center'
75
+ },
76
+ anchorEl: buttonRef.current,
77
+ open: open,
78
+ onClose: function onClose() {
79
+ setOpen(false);
80
+ if (_onClose) _onClose();
81
+ },
82
+ MenuListProps: {
83
+ 'aria-labelledby': 'basic-button'
84
+ }
85
+ }, options && Array.isArray(options) && options.map(function (item, index) {
86
+ return /*#__PURE__*/React__default.createElement("div", {
87
+ key: index.toString()
88
+ }, item.divider && /*#__PURE__*/React__default.createElement(Divider, null), /*#__PURE__*/React__default.createElement(MenuItem, {
89
+ className: item.disabled ? useStyles().root : '',
90
+ onClick: function onClick() {
91
+ setOpen(false);
92
+ if (_onClose) _onClose();
93
+ if (item.onClick) item.onClick({
94
+ label: item.label,
95
+ value: item.value
96
+ });
97
+ }
98
+ }, item.icon && /*#__PURE__*/React__default.createElement(ListItemIcon, null, item.icon), item.label && /*#__PURE__*/React__default.createElement(ListItemText, null, item.label)));
99
+ })));
100
+ };
101
+ Dropdown.defaultProps = {
102
+ className: undefined,
103
+ children: undefined,
104
+ icon: undefined,
105
+ type: 'link',
106
+ disabled: undefined,
107
+ options: undefined,
108
+ getPopupContainer: undefined,
109
+ onOpen: undefined,
110
+ onClose: undefined
111
+ };
112
+
113
+ /* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
114
+ Dropdown.propTypes = {
115
+ /** Css Name */
116
+ className: PropTypes.string,
117
+ /** 按鈕內容 */
118
+ children: PropTypes.node,
119
+ /** 按鈕左側Icon */
120
+ icon: PropTypes.node,
121
+ /** 按鈕類型 */
122
+ type: PropTypes.oneOf(Object.keys(buttonType)),
123
+ /** Menu按鈕是否禁用 */
124
+ disabled: PropTypes.bool,
125
+ /** Menu Data list */
126
+ options: PropTypes.arrayOf(PropTypes.any),
127
+ /** Menu content render by node */
128
+ getPopupContainer: PropTypes.func,
129
+ /** Menu 開啟 Callback */
130
+ onOpen: PropTypes.func,
131
+ /** Menu 關閉 Callback */
132
+ onClose: PropTypes.func
133
+ };
134
+
135
+ export { Dropdown as default };
@@ -1 +1,44 @@
1
- import e from"react";import t from"prop-types";import{s as a,c}from"./vendor-851c6356.js";a(".antd-empty {\n width: 100%;\n font-size: 1rem;\n line-height: 1.5715;\n text-align: center;\n overflow: hidden;\n height: 100%; }\n .antd-empty .ant-empty-image {\n height: 100px;\n margin-bottom: 8px; }\n .antd-empty .ant-empty-image img {\n height: calc(100% - 22px);\n margin: auto; }\n .antd-empty .antd-empty-description {\n color: rgba(0, 0, 0, 0.85); }\n");var i=function(t){var a=t.className,i=t.description,n=t.emptySrc,l=t.imageStyle;return e.createElement("div",{className:c("antd-empty",a)},e.createElement("div",{className:"ant-empty-image"},e.createElement("img",{src:n||"data:image/svg+xml,%3csvg class='ant-empty-img-default' width='184' height='152' viewBox='0 0 184 152' xmlns='http://www.w3.org/2000/svg'%3e %3cg fill='none' fill-rule='evenodd'%3e %3cg transform='translate(24 31.67)'%3e %3cellipse fill='%23f5f5f5' fill-opacity='0.8' cx='67.797' cy='106.89' rx='67.797' ry='12.668'%3e%3c/ellipse%3e %3cpath fill='%23aeb8c2' d='M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z'%3e%3c/path%3e %3cpath fill='url(%23linearGradient-1)' d='M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z' transform='translate(13.56)'%3e%3c/path%3e %3cpath fill='%23f5f5f7' d='M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z'%3e%3c/path%3e %3cpath fill='%23dce0e6' d='M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z'%3e%3c/path%3e %3c/g%3e %3cpath fill='%23dce0e6' d='M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z'%3e%3c/path%3e %3cg fill='white' transform='translate(149.65 15.383)'%3e %3cellipse cx='20.654' cy='3.167' rx='2.849' ry='2.815'%3e%3c/ellipse%3e %3cpath d='M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z'%3e%3c/path%3e %3c/g%3e %3c/g%3e%3c/svg%3e",alt:i,style:l}),i&&e.createElement("div",{className:"ant-empty-description"},i)))};i.defaultProps={className:void 0,emptySrc:void 0,description:"No Data",imageStyle:{}},i.propTypes={className:t.string,emptySrc:t.string,description:t.node,imageStyle:t.objectOf(t.any)};export{i as E};
1
+ import React__default from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { s as styleInject, c as classNames } from './vendor-851c6356.js';
4
+
5
+ var img = "data:image/svg+xml,%3csvg class='ant-empty-img-default' width='184' height='152' viewBox='0 0 184 152' xmlns='http://www.w3.org/2000/svg'%3e %3cg fill='none' fill-rule='evenodd'%3e %3cg transform='translate(24 31.67)'%3e %3cellipse fill='%23f5f5f5' fill-opacity='0.8' cx='67.797' cy='106.89' rx='67.797' ry='12.668'%3e%3c/ellipse%3e %3cpath fill='%23aeb8c2' d='M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z'%3e%3c/path%3e %3cpath fill='url(%23linearGradient-1)' d='M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z' transform='translate(13.56)'%3e%3c/path%3e %3cpath fill='%23f5f5f7' d='M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z'%3e%3c/path%3e %3cpath fill='%23dce0e6' d='M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z'%3e%3c/path%3e %3c/g%3e %3cpath fill='%23dce0e6' d='M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z'%3e%3c/path%3e %3cg fill='white' transform='translate(149.65 15.383)'%3e %3cellipse cx='20.654' cy='3.167' rx='2.849' ry='2.815'%3e%3c/ellipse%3e %3cpath d='M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z'%3e%3c/path%3e %3c/g%3e %3c/g%3e%3c/svg%3e";
6
+
7
+ var css_248z = ".antd-empty {\n width: 100%;\n font-size: 1rem;\n line-height: 1.5715;\n text-align: center;\n overflow: hidden;\n height: 100%; }\n .antd-empty .ant-empty-image {\n height: 100px;\n margin-bottom: 8px; }\n .antd-empty .ant-empty-image img {\n height: calc(100% - 22px);\n margin: auto; }\n .antd-empty .antd-empty-description {\n color: rgba(0, 0, 0, 0.85); }\n";
8
+ styleInject(css_248z);
9
+
10
+ var Empty = function Empty(_ref) {
11
+ var className = _ref.className,
12
+ description = _ref.description,
13
+ emptySrc = _ref.emptySrc,
14
+ imageStyle = _ref.imageStyle;
15
+ return /*#__PURE__*/React__default.createElement("div", {
16
+ className: classNames('antd-empty', className)
17
+ }, /*#__PURE__*/React__default.createElement("div", {
18
+ className: "ant-empty-image"
19
+ }, /*#__PURE__*/React__default.createElement("img", {
20
+ src: emptySrc || img,
21
+ alt: description,
22
+ style: imageStyle
23
+ }), description && /*#__PURE__*/React__default.createElement("div", {
24
+ className: "ant-empty-description"
25
+ }, description)));
26
+ };
27
+ Empty.defaultProps = {
28
+ className: undefined,
29
+ emptySrc: undefined,
30
+ description: 'No Data',
31
+ imageStyle: {}
32
+ };
33
+ Empty.propTypes = {
34
+ /** Css名稱 */
35
+ className: PropTypes.string,
36
+ /** 空白時圖案的Src */
37
+ emptySrc: PropTypes.string,
38
+ /** 描述 */
39
+ description: PropTypes.node,
40
+ /** 圖案的style */
41
+ imageStyle: PropTypes.objectOf(PropTypes.any)
42
+ };
43
+
44
+ export { Empty as E };
@@ -1 +1,7 @@
1
- export{E as default}from"./Empty-70f040a9.js";import"react";import"prop-types";import"./vendor-851c6356.js";import"react-is";import"@material-ui/styles";import"react-dom";
1
+ export { E as default } from './Empty-70f040a9.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';
@@ -1 +1,114 @@
1
- import{a as t}from"./_rollupPluginBabelHelpers-fde6d1c6.js";import e,{useState as o}from"react";import r from"prop-types";import{s as n,c as a,f as i}from"./vendor-851c6356.js";import{ExitToApp as c}from"@material-ui/icons";import{Dialog as l,DialogContent as p,DialogContentText as s,DialogActions as u,Button as f}from"@material-ui/core";import{j as m,a as x}from"./dataExport-f418e6fe.js";import{g as d}from"./globalConfig-40069b54.js";import"react-is";import"@material-ui/styles";import"react-dom";n(".exportButton {\n display: flex;\n align-items: center;\n font-size: 1.5rem;\n transition: color 0.3s ease-in-out;\n -webkit-user-select: none;\n user-select: none; }\n .exportButton--right {\n justify-content: flex-end; }\n .exportButton__text {\n display: flex;\n align-items: center;\n text-decoration: underline;\n cursor: pointer; }\n .exportButton__text__icon {\n font-size: 2rem;\n margin-right: 4px; }\n .exportButton__text:hover {\n font-weight: bold; }\n");var y=function(r){var n=r.className,y=r.color,g=r.right,T=r.forceTxt,_=r.exportText,v=r.exportTypeText,b=r.data,E=d().formatMessage,B=o(!1),k=t(B,2),h=k[0],j=k[1],C=[{type:"CSV",click:function(){return i("\ufeff".concat(x(b)),"output.csv")}},{type:"EXCEL",click:function(){return i("\ufeff".concat(x(b)),"output.xls")}},{type:"TXT",click:function(){return i("\ufeff".concat(m(b)),"output.txt")}}];return e.createElement("div",{style:{color:y},className:a("exportButton",{"exportButton--right":g},n)},e.createElement("div",{className:"exportButton__text",onClick:function(){return T?i("\ufeff".concat(m(b)),"output.txt"):j(!0)}},e.createElement(c,{className:"exportButton__text__icon"}),_||E({id:"common.export"})),e.createElement(l,{open:h,keepMounted:!0,onClose:function(){return j(!1)},"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description"},e.createElement(p,null,e.createElement(s,null,v||E({id:"common.export.type"}))),e.createElement(u,null,C.map((function(t){var o=t.type,r=t.click;return e.createElement(f,{key:o,variant:"text",onClick:function(){r(),j(!1)}},o)})))))};y.defaultProps={className:void 0,color:"#4e3a16",right:void 0,forceTxt:!0,exportText:void 0,exportTypeText:"Export Type",data:void 0},y.propTypes={className:r.string,color:r.string,right:r.bool,forceTxt:r.bool,exportText:r.string,exportTypeText:r.string,data:r.oneOfType([r.objectOf(r.any),r.arrayOf(r.any)])};export{y as default};
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-fde6d1c6.js';
2
+ import React__default, { useState } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { s as styleInject, c as classNames, f as fileDownload } from './vendor-851c6356.js';
5
+ import { ExitToApp } from '@material-ui/icons';
6
+ import { Dialog, DialogContent, DialogContentText, DialogActions, Button } from '@material-ui/core';
7
+ import { j as jsonTxt, a as jsonExcel } from './dataExport-f418e6fe.js';
8
+ import { getIntl } from './globalConfig';
9
+ import 'react-is';
10
+ import '@material-ui/styles';
11
+ import 'react-dom';
12
+
13
+ var css_248z = ".exportButton {\n display: flex;\n align-items: center;\n font-size: 1.5rem;\n transition: color 0.3s ease-in-out;\n -webkit-user-select: none;\n user-select: none; }\n .exportButton--right {\n justify-content: flex-end; }\n .exportButton__text {\n display: flex;\n align-items: center;\n text-decoration: underline;\n cursor: pointer; }\n .exportButton__text__icon {\n font-size: 2rem;\n margin-right: 4px; }\n .exportButton__text:hover {\n font-weight: bold; }\n";
14
+ styleInject(css_248z);
15
+
16
+ var ExportButton = function ExportButton(_ref) {
17
+ var className = _ref.className,
18
+ color = _ref.color,
19
+ right = _ref.right,
20
+ forceTxt = _ref.forceTxt,
21
+ exportText = _ref.exportText,
22
+ exportTypeText = _ref.exportTypeText,
23
+ data = _ref.data;
24
+ var _getIntl = getIntl(),
25
+ formatMessage = _getIntl.formatMessage;
26
+ var _useState = useState(false),
27
+ _useState2 = _slicedToArray(_useState, 2),
28
+ open = _useState2[0],
29
+ setOpen = _useState2[1];
30
+ var buttons = [{
31
+ type: 'CSV',
32
+ click: function click() {
33
+ return fileDownload("\uFEFF".concat(jsonExcel(data)), 'output.csv');
34
+ }
35
+ }, {
36
+ type: 'EXCEL',
37
+ click: function click() {
38
+ return fileDownload("\uFEFF".concat(jsonExcel(data)), 'output.xls');
39
+ }
40
+ }, {
41
+ type: 'TXT',
42
+ click: function click() {
43
+ return fileDownload("\uFEFF".concat(jsonTxt(data)), 'output.txt');
44
+ }
45
+ }];
46
+ return /*#__PURE__*/React__default.createElement("div", {
47
+ style: {
48
+ color: color
49
+ },
50
+ className: classNames('exportButton', {
51
+ 'exportButton--right': right
52
+ }, className)
53
+ }, /*#__PURE__*/React__default.createElement("div", {
54
+ className: "exportButton__text",
55
+ onClick: function onClick() {
56
+ return forceTxt ? fileDownload("\uFEFF".concat(jsonTxt(data)), 'output.txt') : setOpen(true);
57
+ }
58
+ }, /*#__PURE__*/React__default.createElement(ExitToApp, {
59
+ className: "exportButton__text__icon"
60
+ }), exportText || formatMessage({
61
+ id: 'common.export'
62
+ })), /*#__PURE__*/React__default.createElement(Dialog, {
63
+ open: open,
64
+ keepMounted: true,
65
+ onClose: function onClose() {
66
+ return setOpen(false);
67
+ },
68
+ "aria-labelledby": "alert-dialog-slide-title",
69
+ "aria-describedby": "alert-dialog-slide-description"
70
+ }, /*#__PURE__*/React__default.createElement(DialogContent, null, /*#__PURE__*/React__default.createElement(DialogContentText, null, exportTypeText || formatMessage({
71
+ id: 'common.export.type'
72
+ }))), /*#__PURE__*/React__default.createElement(DialogActions, null, buttons.map(function (_ref2) {
73
+ var type = _ref2.type,
74
+ click = _ref2.click;
75
+ return /*#__PURE__*/React__default.createElement(Button, {
76
+ key: type,
77
+ variant: "text",
78
+ onClick: function onClick() {
79
+ click();
80
+ setOpen(false);
81
+ }
82
+ }, type);
83
+ }))));
84
+ };
85
+ ExportButton.defaultProps = {
86
+ className: undefined,
87
+ color: '#4e3a16',
88
+ right: undefined,
89
+ forceTxt: true,
90
+ // 聽說Excel怪怪的 先強制隱藏
91
+ exportText: undefined,
92
+ exportTypeText: 'Export Type',
93
+ data: undefined
94
+ };
95
+
96
+ /* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
97
+ ExportButton.propTypes = {
98
+ /** Css Name */
99
+ className: PropTypes.string,
100
+ /** 主題顏色 */
101
+ color: PropTypes.string,
102
+ /** 靠右起來 */
103
+ right: PropTypes.bool,
104
+ /** 匯出是否強制txt */
105
+ forceTxt: PropTypes.bool,
106
+ /** 匯出的文字 */
107
+ exportText: PropTypes.string,
108
+ /** 匯出類型的文字 */
109
+ exportTypeText: PropTypes.string,
110
+ /** 要匯出的JSON資料 */
111
+ data: PropTypes.oneOfType([PropTypes.objectOf(PropTypes.any), PropTypes.arrayOf(PropTypes.any)])
112
+ };
113
+
114
+ export { ExportButton as default };