@daoyi/nmtl-ui 2.0.1-beta.7 → 2.0.1-beta.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Autocomplete-e62927dc.js +334 -0
- package/lib/components/Autocomplete.js +13 -1
- package/lib/components/Avatar.js +53 -1
- package/lib/components/BackTop.js +109 -1
- package/lib/components/BarChart.js +762 -1
- package/lib/components/Breadcrumbs.js +122 -1
- package/lib/components/Button-4fddcd2f.js +92 -0
- package/lib/components/Button.js +6 -1
- package/lib/components/Carousel.js +4654 -1
- package/lib/components/Checkbox.js +37 -1
- package/lib/components/CollapseContent.js +179 -1
- package/lib/components/ContactModal-33f4e605.js +12020 -0
- package/lib/components/ContactModal.js +22 -3
- package/lib/components/Drawer-fb5bc1ec.js +157 -0
- package/lib/components/Drawer.js +11 -1
- package/lib/components/Dropdown.js +134 -1
- package/lib/components/Empty-e50b760e.js +45 -0
- package/lib/components/Empty.js +5 -1
- package/lib/components/ExportButton.js +112 -1
- package/lib/components/ExtraTools-a49a1d2f.js +3537 -0
- package/lib/components/ExtraTools.js +10 -22
- package/lib/components/Filter.js +782 -12
- package/lib/components/Footer.js +271 -1
- package/lib/components/ForwardLink-6a82c19d.js +106 -0
- package/lib/components/ForwardLink.js +8 -0
- package/lib/components/Header.js +187 -1
- package/lib/components/Image.js +61 -1
- package/lib/components/Input.js +82 -1
- package/lib/components/InputMethod.js +33949 -12
- package/lib/components/KeywordSearch-3af0c402.js +140 -0
- package/lib/components/KeywordSearch.js +15 -1
- package/lib/components/KeywordTicker.js +190 -1
- package/lib/components/Keywords.js +317 -1
- package/lib/components/Loading.js +28 -1
- package/lib/components/MUITheme.js +2624 -1
- package/lib/components/Modal-2c39d5b8.js +108 -0
- package/lib/components/Modal.js +9 -1
- package/lib/components/MoreButton-6b323fe4.js +110 -0
- package/lib/components/MoreButton.js +6 -1
- package/lib/components/Pagination.js +3706 -0
- package/lib/components/Radio.js +78 -1
- package/lib/components/SNA.js +1691 -22
- package/lib/components/Select-0f131640.js +115 -0
- package/lib/components/Select.js +8 -1
- package/lib/components/Spin-1741f625.js +75 -0
- package/lib/components/Spin.js +6 -1
- package/lib/components/Table.js +51 -1
- package/lib/components/Tooltip-65a21a86.js +70 -0
- package/lib/components/Tooltip.js +7 -1
- package/lib/components/_commonjsHelpers-70de2c37.js +28 -0
- package/lib/components/_rollupPluginBabelHelpers-a52356f6.js +142 -0
- package/lib/components/createSvgIcon-d9801fb7.js +576 -0
- package/lib/components/dataExport-d55d6fa3.js +92 -0
- package/lib/components/debounce-127da66c.js +355 -0
- package/lib/components/defaultTheme-5839b9b3.js +1505 -0
- package/lib/components/globalConfig.js +175 -0
- package/lib/components/hoist-non-react-statics.cjs-3f408ad2.js +105 -0
- package/lib/components/index-0be0afec.js +481 -0
- package/lib/components/index-ef96775f.js +61 -0
- package/lib/components/isObjectLike-e111475d.js +190 -0
- package/lib/components/style-inject.es-1f59c1d0.js +28 -1
- package/lib/components/transform-3a04288b.js +5475 -0
- package/lib/components/withTheme-4417822c.js +6 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/utils/_rollupPluginBabelHelpers-8dd26e1a.js +121 -0
- package/lib/utils/arrayMerge.js +4953 -1
- package/lib/utils/chunkArray.js +15 -1
- package/lib/utils/convert2HtmlEntities.js +42 -1
- package/lib/utils/domToImage.js +802 -1
- package/lib/utils/downloadGephi.js +106 -1
- package/lib/utils/exportXlsx.js +219 -1
- package/lib/utils/historyAppendSearch.js +502 -1
- package/lib/utils/isDevelopMode.js +5 -1
- package/lib/utils/parseYMD.js +36 -1
- package/lib/utils/removeDuplicateItem.js +11 -1
- package/lib/utils/sendEmail.js +39 -1
- package/lib/utils/snaDefine-6a2bcd94.js +5 -0
- package/lib/utils/snaDefine.js +1 -1
- package/lib/utils/snaPreProcess.js +84 -1
- package/package.json +17 -21
- package/lib/components/Empty-54b79907.js +0 -1
- package/lib/components/KeywordSearch-5a393f12.js +0 -1
- package/lib/components/Select-f2441b83.js +0 -1
- package/lib/components/_rollupPluginBabelHelpers-1b8c042f.js +0 -1
- package/lib/components/_rollupPluginBabelHelpers-ec4e2a53.js +0 -1
- package/lib/components/createSvgIcon-62b64929.js +0 -1
- package/lib/components/createSvgIcon-e24792d4.js +0 -1
- package/lib/components/createTheme-7fffa109.js +0 -1
- package/lib/components/dataExport-9fccd4f0.js +0 -1
- package/lib/components/debounce-c993109b.js +0 -1
- package/lib/components/hoist-non-react-statics.cjs-d6a9befd.js +0 -1
- package/lib/components/index-11391ca3.js +0 -7
- package/lib/components/index-b2745105.js +0 -7
- package/lib/components/isObjectLike-2f1983fe.js +0 -1
- package/lib/components/style-inject.es-c875d022.js +0 -1
- package/lib/components/transform-0eb2d36e.js +0 -1
- package/lib/utils/_commonjsHelpers-e2cda605.js +0 -1
- package/lib/utils/_rollupPluginBabelHelpers-928a52ce.js +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { c as classNames } from './index-ef96775f.js';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { Dialog, DialogTitle, IconButton, DialogContent, DialogActions, CircularProgress } from '@material-ui/core';
|
|
5
|
+
import { CloseSharp } from '@material-ui/icons';
|
|
6
|
+
import { B as Button } from './Button-4fddcd2f.js';
|
|
7
|
+
import { S as Spin } from './Spin-1741f625.js';
|
|
8
|
+
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
9
|
+
|
|
10
|
+
var css_248z = ".modal__title h2 {\n display: flex;\n align-items: center; }\n\n.modal__title__text {\n flex: 1;\n font-size: 16px;\n padding: 8px 0;\n color: white; }\n\n.modal__title__close {\n cursor: pointer;\n color: white; }\n\n.modal--transparent .MuiPaper-root {\n background: transparent !important;\n box-shadow: none; }\n\n.modal--transparent .modal__title {\n background: transparent !important; }\n";
|
|
11
|
+
styleInject(css_248z);
|
|
12
|
+
|
|
13
|
+
var Modal = function Modal(props) {
|
|
14
|
+
var className = props.className,
|
|
15
|
+
title = props.title,
|
|
16
|
+
children = props.children,
|
|
17
|
+
footer = props.footer,
|
|
18
|
+
cancelText = props.cancelText,
|
|
19
|
+
okText = props.okText,
|
|
20
|
+
visible = props.visible,
|
|
21
|
+
onOk = props.onOk,
|
|
22
|
+
onCancel = props.onCancel;
|
|
23
|
+
var closable = props.closable,
|
|
24
|
+
loading = props.loading,
|
|
25
|
+
fullWidth = props.fullWidth,
|
|
26
|
+
transparent = props.transparent;
|
|
27
|
+
var endIcon = loading && /*#__PURE__*/React__default.createElement(CircularProgress, {
|
|
28
|
+
size: 14
|
|
29
|
+
});
|
|
30
|
+
return /*#__PURE__*/React__default.createElement(Dialog, {
|
|
31
|
+
className: classNames('modal', {
|
|
32
|
+
'modal--transparent': transparent
|
|
33
|
+
}, className),
|
|
34
|
+
fullWidth: fullWidth,
|
|
35
|
+
open: visible || false,
|
|
36
|
+
onClose: function onClose() {
|
|
37
|
+
return closable && onCancel();
|
|
38
|
+
}
|
|
39
|
+
}, /*#__PURE__*/React__default.createElement(DialogTitle, {
|
|
40
|
+
className: "modal__title"
|
|
41
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
42
|
+
className: "modal__title__text"
|
|
43
|
+
}, title), closable && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
44
|
+
onClick: onCancel
|
|
45
|
+
}, /*#__PURE__*/React__default.createElement(CloseSharp, {
|
|
46
|
+
className: "modal__title__close"
|
|
47
|
+
}))), /*#__PURE__*/React__default.createElement(DialogContent, null, /*#__PURE__*/React__default.createElement(Spin, {
|
|
48
|
+
spinning: loading
|
|
49
|
+
}, children)), footer !== null && /*#__PURE__*/React__default.createElement(DialogActions, null, footer === undefined && (cancelText || okText) ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, cancelText && /*#__PURE__*/React__default.createElement(Button, {
|
|
50
|
+
onClick: onCancel,
|
|
51
|
+
color: "default",
|
|
52
|
+
endIcon: endIcon,
|
|
53
|
+
disabled: loading
|
|
54
|
+
}, cancelText), okText && /*#__PURE__*/React__default.createElement(Button, {
|
|
55
|
+
onClick: onOk,
|
|
56
|
+
color: "primary",
|
|
57
|
+
endIcon: endIcon,
|
|
58
|
+
disabled: loading,
|
|
59
|
+
autoFocus: true
|
|
60
|
+
}, okText)) : footer));
|
|
61
|
+
};
|
|
62
|
+
Modal.defaultProps = {
|
|
63
|
+
className: undefined,
|
|
64
|
+
loading: undefined,
|
|
65
|
+
transparent: undefined,
|
|
66
|
+
closable: true,
|
|
67
|
+
title: undefined,
|
|
68
|
+
children: undefined,
|
|
69
|
+
fullWidth: undefined,
|
|
70
|
+
footer: undefined,
|
|
71
|
+
cancelText: 'Cancel',
|
|
72
|
+
okText: 'Ok',
|
|
73
|
+
visible: undefined,
|
|
74
|
+
onOk: function onOk() {},
|
|
75
|
+
onCancel: function onCancel() {}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
|
|
79
|
+
Modal.propTypes = {
|
|
80
|
+
/** Css Name */
|
|
81
|
+
className: PropTypes.string,
|
|
82
|
+
/** 是否正在載入中 */
|
|
83
|
+
loading: PropTypes.bool,
|
|
84
|
+
/** 是否正透明模式 */
|
|
85
|
+
transparent: PropTypes.bool,
|
|
86
|
+
/** 是否可以取消關閉(含close icon) */
|
|
87
|
+
closable: PropTypes.bool,
|
|
88
|
+
/** Modal Title */
|
|
89
|
+
title: PropTypes.node,
|
|
90
|
+
/** Modal 內容 */
|
|
91
|
+
children: PropTypes.node,
|
|
92
|
+
/** 版面是否滿版 */
|
|
93
|
+
fullWidth: PropTypes.bool,
|
|
94
|
+
/** Footer */
|
|
95
|
+
footer: PropTypes.node,
|
|
96
|
+
/** 取消文字 */
|
|
97
|
+
cancelText: PropTypes.string,
|
|
98
|
+
/** 確認文字 */
|
|
99
|
+
okText: PropTypes.string,
|
|
100
|
+
/** 是否出現 */
|
|
101
|
+
visible: PropTypes.bool,
|
|
102
|
+
/** 完成的callback */
|
|
103
|
+
onOk: PropTypes.func,
|
|
104
|
+
/** 關閉Modal */
|
|
105
|
+
onCancel: PropTypes.func
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export { Modal as M };
|
package/lib/components/Modal.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
export { M as default } from './Modal-2c39d5b8.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import './index-ef96775f.js';
|
|
4
|
+
import 'prop-types';
|
|
5
|
+
import '@material-ui/core';
|
|
6
|
+
import '@material-ui/icons';
|
|
7
|
+
import './Button-4fddcd2f.js';
|
|
8
|
+
import './style-inject.es-1f59c1d0.js';
|
|
9
|
+
import './Spin-1741f625.js';
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { c as classNames } from './index-ef96775f.js';
|
|
4
|
+
import { ExpandLess, ExpandMore } from '@material-ui/icons';
|
|
5
|
+
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
6
|
+
|
|
7
|
+
var css_248z = ".moreButton {\n width: -moz-fit-content;\n width: fit-content;\n display: flex;\n align-items: center;\n position: relative;\n margin: 1rem 0rem;\n border-radius: 8px;\n padding: 1rem 2.5rem;\n -webkit-user-select: none;\n user-select: none;\n cursor: pointer; }\n .moreButton__mask {\n transition: all 0.3s ease-in-out;\n position: absolute;\n left: 0;\n top: 0;\n border-radius: 8px;\n width: 100%;\n height: 100%;\n opacity: 0; }\n .moreButton:hover .moreButton__mask {\n opacity: 1; }\n .moreButton--shadow {\n transition: all 0.3s ease-in-out;\n border: 3px solid #ffffff;\n position: relative;\n left: 0px;\n top: 0px; }\n .moreButton--shadow:hover {\n box-shadow: initial !important;\n left: 3px;\n top: 3px; }\n .moreButton--small {\n border: 0;\n padding: 0;\n left: 0px !important;\n top: 0px !important;\n background: transparent !important;\n box-shadow: initial !important; }\n .moreButton--small .moreButton__mask {\n opacity: 0 !important; }\n .moreButton__icon {\n display: flex;\n z-index: 1; }\n .moreButton__icon--small {\n font-size: 1.5rem;\n border-radius: 45px;\n color: white !important; }\n .moreButton__text {\n z-index: 1;\n font-size: 1.5rem;\n line-height: 1.5rem;\n transition: color 0.3s ease-in-out; }\n .moreButton__text--small {\n margin-left: 0.75rem;\n font-size: 1.5rem;\n color: #0c2a4d; }\n .moreButton__text--small:hover {\n text-decoration: underline; }\n";
|
|
8
|
+
styleInject(css_248z);
|
|
9
|
+
|
|
10
|
+
var MoreButton = function MoreButton(props) {
|
|
11
|
+
var primaryColor = props.primaryColor,
|
|
12
|
+
secondaryColor = props.secondaryColor,
|
|
13
|
+
shadowColor = props.shadowColor;
|
|
14
|
+
var small = props.small,
|
|
15
|
+
enableShadow = props.enableShadow,
|
|
16
|
+
customExpandIcon = props.customExpandIcon;
|
|
17
|
+
var expand = props.expand,
|
|
18
|
+
setExpand = props.setExpand,
|
|
19
|
+
_onClick = props.onClick,
|
|
20
|
+
formatMessage = props.formatMessage;
|
|
21
|
+
var smallIcon = expand ? /*#__PURE__*/React__default.createElement(ExpandLess, {
|
|
22
|
+
className: "moreButton__icon--small",
|
|
23
|
+
style: {
|
|
24
|
+
background: shadowColor || primaryColor
|
|
25
|
+
}
|
|
26
|
+
}) : /*#__PURE__*/React__default.createElement(ExpandMore, {
|
|
27
|
+
className: "moreButton__icon--small",
|
|
28
|
+
style: {
|
|
29
|
+
background: shadowColor || primaryColor
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
var smallMessage = expand ? 'common.show.less' : 'common.show.more';
|
|
33
|
+
var message = small ? smallMessage : 'common.watch.more';
|
|
34
|
+
var largeIcon = customExpandIcon && /*#__PURE__*/React__default.createElement("img", {
|
|
35
|
+
src: customExpandIcon,
|
|
36
|
+
alt: "more"
|
|
37
|
+
});
|
|
38
|
+
var icon = small ? smallIcon : largeIcon;
|
|
39
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
40
|
+
className: classNames('moreButton', {
|
|
41
|
+
'moreButton--shadow': enableShadow
|
|
42
|
+
}, {
|
|
43
|
+
'moreButton--small': small
|
|
44
|
+
}),
|
|
45
|
+
style: {
|
|
46
|
+
color: shadowColor || 'white',
|
|
47
|
+
background: primaryColor,
|
|
48
|
+
boxShadow: enableShadow ? "3px 3px 0 0 ".concat(shadowColor) : undefined
|
|
49
|
+
},
|
|
50
|
+
onClick: function onClick() {
|
|
51
|
+
setExpand(!expand);
|
|
52
|
+
_onClick();
|
|
53
|
+
}
|
|
54
|
+
}, !enableShadow && /*#__PURE__*/React__default.createElement("div", {
|
|
55
|
+
className: "moreButton__mask",
|
|
56
|
+
style: {
|
|
57
|
+
background: secondaryColor
|
|
58
|
+
}
|
|
59
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
60
|
+
className: "moreButton__icon"
|
|
61
|
+
}, icon), /*#__PURE__*/React__default.createElement("div", {
|
|
62
|
+
className: classNames('moreButton__text', {
|
|
63
|
+
'moreButton__text--small': small
|
|
64
|
+
}),
|
|
65
|
+
style: {
|
|
66
|
+
color: small ? shadowColor || primaryColor : undefined,
|
|
67
|
+
marginLeft: icon ? '0.5rem' : undefined
|
|
68
|
+
}
|
|
69
|
+
}, formatMessage ? formatMessage({
|
|
70
|
+
id: message
|
|
71
|
+
}) : message));
|
|
72
|
+
};
|
|
73
|
+
MoreButton.defaultProps = {
|
|
74
|
+
primaryColor: '#271702',
|
|
75
|
+
// default為文學網站的主色系
|
|
76
|
+
secondaryColor: '#aa8859',
|
|
77
|
+
// default為文學網站的次色系
|
|
78
|
+
shadowColor: undefined,
|
|
79
|
+
small: false,
|
|
80
|
+
enableShadow: false,
|
|
81
|
+
expand: false,
|
|
82
|
+
customExpandIcon: undefined,
|
|
83
|
+
formatMessage: undefined,
|
|
84
|
+
setExpand: function setExpand() {},
|
|
85
|
+
onClick: function onClick() {}
|
|
86
|
+
};
|
|
87
|
+
MoreButton.propTypes = {
|
|
88
|
+
/** 按鈕主色系顏色 */
|
|
89
|
+
primaryColor: PropTypes.string,
|
|
90
|
+
/** 按鈕次色系顏色 */
|
|
91
|
+
secondaryColor: PropTypes.string,
|
|
92
|
+
/** 按鈕影子顏色 */
|
|
93
|
+
shadowColor: PropTypes.string,
|
|
94
|
+
/** 展開是否為小圖示 */
|
|
95
|
+
small: PropTypes.bool,
|
|
96
|
+
/** 是否啟動陰影模式 */
|
|
97
|
+
enableShadow: PropTypes.bool,
|
|
98
|
+
/** 客製化自己的大圖標 */
|
|
99
|
+
customExpandIcon: PropTypes.node,
|
|
100
|
+
/** 是否展開(僅有在small=true作動) */
|
|
101
|
+
expand: PropTypes.bool,
|
|
102
|
+
/** 語系翻譯的formateMessag(useIntl) */
|
|
103
|
+
formatMessage: PropTypes.func,
|
|
104
|
+
/** 設定是否展開 */
|
|
105
|
+
setExpand: PropTypes.func,
|
|
106
|
+
/** 點擊的callback */
|
|
107
|
+
onClick: PropTypes.func
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export { MoreButton as M };
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export { M as default } from './MoreButton-6b323fe4.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'prop-types';
|
|
4
|
+
import './index-ef96775f.js';
|
|
5
|
+
import '@material-ui/icons';
|
|
6
|
+
import './style-inject.es-1f59c1d0.js';
|