@daoyi/nmtl-ui 2.0.1-beta.45 → 2.0.1-beta.46

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 (95) hide show
  1. package/lib/components/Autocomplete-aa4a8d6c.js +335 -0
  2. package/lib/components/Autocomplete.js +13 -1
  3. package/lib/components/Avatar.js +49 -1
  4. package/lib/components/BackTop.js +109 -1
  5. package/lib/components/BarChart.js +762 -1
  6. package/lib/components/Breadcrumbs.js +122 -1
  7. package/lib/components/Button-2f8f0493.js +92 -0
  8. package/lib/components/Button.js +6 -1
  9. package/lib/components/Carousel.js +4713 -1
  10. package/lib/components/Checkbox.js +37 -1
  11. package/lib/components/CollapseContent.js +179 -1
  12. package/lib/components/ContactModal-c8240b19.js +10759 -0
  13. package/lib/components/ContactModal.js +22 -1
  14. package/lib/components/Drawer-dd8942f1.js +157 -0
  15. package/lib/components/Drawer.js +11 -1
  16. package/lib/components/Dropdown.js +134 -1
  17. package/lib/components/Empty-3637b766.js +45 -0
  18. package/lib/components/Empty.js +5 -1
  19. package/lib/components/ExportButton.js +112 -1
  20. package/lib/components/ExtraTools-55dad795.js +3479 -0
  21. package/lib/components/ExtraTools.js +10 -1
  22. package/lib/components/Filter.js +776 -1
  23. package/lib/components/Footer.js +271 -1
  24. package/lib/components/ForwardLink.js +105 -1
  25. package/lib/components/Header.js +187 -1
  26. package/lib/components/Image.js +61 -1
  27. package/lib/components/Input.js +77 -1
  28. package/lib/components/InputMethod.js +33963 -1
  29. package/lib/components/KeywordSearch-2d01266e.js +139 -0
  30. package/lib/components/KeywordSearch.js +15 -1
  31. package/lib/components/KeywordTicker.js +180 -1
  32. package/lib/components/Keywords.js +317 -1
  33. package/lib/components/Loading.js +28 -1
  34. package/lib/components/MUITheme.js +2627 -1
  35. package/lib/components/Modal-572e17ea.js +108 -0
  36. package/lib/components/Modal.js +9 -1
  37. package/lib/components/MoreButton-80996b5f.js +110 -0
  38. package/lib/components/MoreButton.js +6 -1
  39. package/lib/components/Radio.js +78 -1
  40. package/lib/components/SNA.js +1735 -1
  41. package/lib/components/Select-5533b506.js +115 -0
  42. package/lib/components/Select.js +8 -1
  43. package/lib/components/Spin-ebf79c17.js +75 -0
  44. package/lib/components/Spin.js +6 -1
  45. package/lib/components/Table.js +51 -1
  46. package/lib/components/Tooltip-907eaa2e.js +70 -0
  47. package/lib/components/Tooltip.js +7 -1
  48. package/lib/components/_commonjsHelpers-70de2c37.js +28 -0
  49. package/lib/components/_rollupPluginBabelHelpers-fde6d1c6.js +491 -1
  50. package/lib/components/createSvgIcon-48da8b6e.js +576 -0
  51. package/lib/components/dataExport-d55d6fa3.js +92 -0
  52. package/lib/components/debounce-127da66c.js +355 -0
  53. package/lib/components/defaultTheme-19a14721.js +1485 -0
  54. package/lib/components/globalConfig-40069b54.js +158 -1
  55. package/lib/components/hoist-non-react-statics.cjs-3f408ad2.js +105 -0
  56. package/lib/components/index-7b60a97d.js +481 -0
  57. package/lib/components/index-f491ebce.js +61 -0
  58. package/lib/components/isObjectLike-e111475d.js +190 -0
  59. package/lib/components/style-inject.es-1f59c1d0.js +28 -0
  60. package/lib/components/transform-3a04288b.js +5475 -0
  61. package/lib/globalConfig.js +186 -0
  62. package/lib/index.d.ts +1 -1
  63. package/lib/index.js +1 -1
  64. package/lib/utils/_rollupPluginBabelHelpers-a6e0e6e3.js +139 -1
  65. package/lib/utils/arrayMerge.js +100 -1
  66. package/lib/utils/chunkArray.js +15 -1
  67. package/lib/utils/convert2HtmlEntities.js +42 -1
  68. package/lib/utils/domToImage.js +802 -1
  69. package/lib/utils/downloadGephi.js +106 -1
  70. package/lib/utils/exportXlsx.js +219 -1
  71. package/lib/utils/historyAppendSearch.js +502 -1
  72. package/lib/utils/isDevelopMode.js +5 -1
  73. package/lib/utils/parseYMD.js +36 -1
  74. package/lib/utils/removeDuplicateItem.js +11 -1
  75. package/lib/utils/sendEmail.js +39 -1
  76. package/lib/utils/snaDefine-6a2bcd94.js +5 -1
  77. package/lib/utils/snaDefine.js +1 -1
  78. package/lib/utils/snaPreProcess.js +84 -1
  79. package/package.json +1 -1
  80. package/lib/components/Autocomplete-5439ff22.js +0 -1
  81. package/lib/components/Button-63c7e9f3.js +0 -1
  82. package/lib/components/ContactModal-d7e2f8bb.js +0 -1
  83. package/lib/components/Drawer-af3ed21a.js +0 -1
  84. package/lib/components/Empty-70f040a9.js +0 -1
  85. package/lib/components/ExtraTools-f10a66a8.js +0 -1
  86. package/lib/components/KeywordSearch-224f84c1.js +0 -1
  87. package/lib/components/Modal-a7591b98.js +0 -1
  88. package/lib/components/MoreButton-f15ca38e.js +0 -1
  89. package/lib/components/Select-98a8e973.js +0 -1
  90. package/lib/components/Spin-690a3597.js +0 -1
  91. package/lib/components/Tooltip-b7eb966d.js +0 -1
  92. package/lib/components/dataExport-f418e6fe.js +0 -1
  93. package/lib/components/globalConfig.js +0 -1
  94. package/lib/components/vendor-851c6356.js +0 -63
  95. package/lib/utils/vendor-3ec75cc9.js +0 -1
@@ -0,0 +1,108 @@
1
+ import React__default from 'react';
2
+ import { c as classNames } from './index-f491ebce.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-2f8f0493.js';
7
+ import { S as Spin } from './Spin-ebf79c17.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 };
@@ -1 +1,9 @@
1
- export{M as default}from"./Modal-a7591b98.js";import"react";import"./vendor-851c6356.js";import"prop-types";import"react-is";import"@material-ui/styles";import"react-dom";import"@material-ui/core";import"@material-ui/icons";import"./Button-63c7e9f3.js";import"./Spin-690a3597.js";
1
+ export { M as default } from './Modal-572e17ea.js';
2
+ import 'react';
3
+ import './index-f491ebce.js';
4
+ import 'prop-types';
5
+ import '@material-ui/core';
6
+ import '@material-ui/icons';
7
+ import './Button-2f8f0493.js';
8
+ import './style-inject.es-1f59c1d0.js';
9
+ import './Spin-ebf79c17.js';
@@ -0,0 +1,110 @@
1
+ import React__default from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { c as classNames } from './index-f491ebce.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
- export{M as default}from"./MoreButton-f15ca38e.js";import"react";import"prop-types";import"./vendor-851c6356.js";import"react-is";import"@material-ui/styles";import"react-dom";import"@material-ui/icons";
1
+ export { M as default } from './MoreButton-80996b5f.js';
2
+ import 'react';
3
+ import 'prop-types';
4
+ import './index-f491ebce.js';
5
+ import '@material-ui/icons';
6
+ import './style-inject.es-1f59c1d0.js';
@@ -1 +1,78 @@
1
- import{b as e}from"./_rollupPluginBabelHelpers-fde6d1c6.js";import a from"react";import o from"prop-types";import{RadioGroup as r,FormControlLabel as t,Radio as i}from"@material-ui/core";import{s as l}from"./vendor-851c6356.js";import"react-is";import"@material-ui/styles";import"react-dom";l("");var n=function(o){var l=o.className,n=o.name,s=o.defaultValue,m=o.value,u=o.size,d=o.style,c=o.direction,p=o.options,f=o.onChange;return a.createElement(r,{className:"radioGroup",style:e({flexDirection:c},d),name:n,defaultValue:s||void 0,value:m||void 0,onChange:function(e){f&&f(e.target.value)}},Array.isArray(p)&&p.map((function(e){return a.createElement(t,{value:e.value,key:e.value,control:a.createElement(i,{disabled:e.disabled||!1,size:u,className:l}),label:e.label})})))};n.defaultProps={className:void 0,name:void 0,defaultValue:void 0,value:void 0,size:"small",style:void 0,direction:"row",options:void 0,onChange:function(){}},n.propTypes={className:o.string,name:o.string,defaultValue:o.oneOfType([o.string,o.number]),value:o.oneOfType([o.string,o.number]),size:o.oneOf(["small","medium"]),style:o.objectOf(o.any),direction:o.oneOf(["row","column"]),options:o.arrayOf(o.any),onChange:o.func};export{n as default};
1
+ import { b as _objectSpread2 } from './_rollupPluginBabelHelpers-fde6d1c6.js';
2
+ import React__default from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { RadioGroup, FormControlLabel, Radio as Radio$1 } from '@material-ui/core';
5
+ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
6
+
7
+ var css_248z = "";
8
+ styleInject(css_248z);
9
+
10
+ var Radio = function Radio(props) {
11
+ var className = props.className,
12
+ name = props.name,
13
+ defaultValue = props.defaultValue,
14
+ value = props.value,
15
+ size = props.size,
16
+ style = props.style,
17
+ direction = props.direction; // Attributes
18
+ var options = props.options; // DataList
19
+ var _onChange = props.onChange; // Call Back functions
20
+
21
+ return /*#__PURE__*/React__default.createElement(RadioGroup, {
22
+ className: "radioGroup",
23
+ style: _objectSpread2({
24
+ flexDirection: direction
25
+ }, style),
26
+ name: name,
27
+ defaultValue: defaultValue || undefined,
28
+ value: value || undefined,
29
+ onChange: function onChange(event) {
30
+ if (_onChange) _onChange(event.target.value);
31
+ }
32
+ }, Array.isArray(options) && options.map(function (option) {
33
+ return /*#__PURE__*/React__default.createElement(FormControlLabel, {
34
+ value: option.value,
35
+ key: option.value,
36
+ control: /*#__PURE__*/React__default.createElement(Radio$1, {
37
+ disabled: option.disabled || false,
38
+ size: size,
39
+ className: className
40
+ }),
41
+ label: option.label
42
+ });
43
+ }));
44
+ };
45
+ Radio.defaultProps = {
46
+ className: undefined,
47
+ name: undefined,
48
+ defaultValue: undefined,
49
+ value: undefined,
50
+ size: 'small',
51
+ style: undefined,
52
+ direction: 'row',
53
+ options: undefined,
54
+ onChange: function onChange() {}
55
+ };
56
+ Radio.propTypes = {
57
+ /** Css Name */
58
+ className: PropTypes.string,
59
+ /** 搭配FormControl 使用的名稱 */
60
+ name: PropTypes.string,
61
+ /** 預設內容 */
62
+ defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
63
+ /** 如果你就是好想要Value */
64
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
65
+ /** Radio的大小 */
66
+ // size: PropTypes.string,
67
+ size: PropTypes.oneOf(['small', 'medium']),
68
+ /** 樣式 */
69
+ style: PropTypes.objectOf(PropTypes.any),
70
+ /** Radio的方向 */
71
+ direction: PropTypes.oneOf(['row', 'column']),
72
+ /** Radio的清單 */
73
+ options: PropTypes.arrayOf(PropTypes.any),
74
+ /** 選擇時的callback */
75
+ onChange: PropTypes.func
76
+ };
77
+
78
+ export { Radio as default };