@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.
Files changed (99) hide show
  1. package/lib/components/Autocomplete-e62927dc.js +334 -0
  2. package/lib/components/Autocomplete.js +13 -1
  3. package/lib/components/Avatar.js +53 -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-4fddcd2f.js +92 -0
  8. package/lib/components/Button.js +6 -1
  9. package/lib/components/Carousel.js +4654 -1
  10. package/lib/components/Checkbox.js +37 -1
  11. package/lib/components/CollapseContent.js +179 -1
  12. package/lib/components/ContactModal-33f4e605.js +12020 -0
  13. package/lib/components/ContactModal.js +22 -3
  14. package/lib/components/Drawer-fb5bc1ec.js +157 -0
  15. package/lib/components/Drawer.js +11 -1
  16. package/lib/components/Dropdown.js +134 -1
  17. package/lib/components/Empty-e50b760e.js +45 -0
  18. package/lib/components/Empty.js +5 -1
  19. package/lib/components/ExportButton.js +112 -1
  20. package/lib/components/ExtraTools-a49a1d2f.js +3537 -0
  21. package/lib/components/ExtraTools.js +10 -22
  22. package/lib/components/Filter.js +782 -12
  23. package/lib/components/Footer.js +271 -1
  24. package/lib/components/ForwardLink-6a82c19d.js +106 -0
  25. package/lib/components/ForwardLink.js +8 -0
  26. package/lib/components/Header.js +187 -1
  27. package/lib/components/Image.js +61 -1
  28. package/lib/components/Input.js +82 -1
  29. package/lib/components/InputMethod.js +33949 -12
  30. package/lib/components/KeywordSearch-3af0c402.js +140 -0
  31. package/lib/components/KeywordSearch.js +15 -1
  32. package/lib/components/KeywordTicker.js +190 -1
  33. package/lib/components/Keywords.js +317 -1
  34. package/lib/components/Loading.js +28 -1
  35. package/lib/components/MUITheme.js +2624 -1
  36. package/lib/components/Modal-2c39d5b8.js +108 -0
  37. package/lib/components/Modal.js +9 -1
  38. package/lib/components/MoreButton-6b323fe4.js +110 -0
  39. package/lib/components/MoreButton.js +6 -1
  40. package/lib/components/Pagination.js +3706 -0
  41. package/lib/components/Radio.js +78 -1
  42. package/lib/components/SNA.js +1691 -22
  43. package/lib/components/Select-0f131640.js +115 -0
  44. package/lib/components/Select.js +8 -1
  45. package/lib/components/Spin-1741f625.js +75 -0
  46. package/lib/components/Spin.js +6 -1
  47. package/lib/components/Table.js +51 -1
  48. package/lib/components/Tooltip-65a21a86.js +70 -0
  49. package/lib/components/Tooltip.js +7 -1
  50. package/lib/components/_commonjsHelpers-70de2c37.js +28 -0
  51. package/lib/components/_rollupPluginBabelHelpers-a52356f6.js +142 -0
  52. package/lib/components/createSvgIcon-d9801fb7.js +576 -0
  53. package/lib/components/dataExport-d55d6fa3.js +92 -0
  54. package/lib/components/debounce-127da66c.js +355 -0
  55. package/lib/components/defaultTheme-5839b9b3.js +1505 -0
  56. package/lib/components/globalConfig.js +175 -0
  57. package/lib/components/hoist-non-react-statics.cjs-3f408ad2.js +105 -0
  58. package/lib/components/index-0be0afec.js +481 -0
  59. package/lib/components/index-ef96775f.js +61 -0
  60. package/lib/components/isObjectLike-e111475d.js +190 -0
  61. package/lib/components/style-inject.es-1f59c1d0.js +28 -1
  62. package/lib/components/transform-3a04288b.js +5475 -0
  63. package/lib/components/withTheme-4417822c.js +6 -0
  64. package/lib/index.d.ts +2 -0
  65. package/lib/index.js +2 -0
  66. package/lib/utils/_rollupPluginBabelHelpers-8dd26e1a.js +121 -0
  67. package/lib/utils/arrayMerge.js +4953 -1
  68. package/lib/utils/chunkArray.js +15 -1
  69. package/lib/utils/convert2HtmlEntities.js +42 -1
  70. package/lib/utils/domToImage.js +802 -1
  71. package/lib/utils/downloadGephi.js +106 -1
  72. package/lib/utils/exportXlsx.js +219 -1
  73. package/lib/utils/historyAppendSearch.js +502 -1
  74. package/lib/utils/isDevelopMode.js +5 -1
  75. package/lib/utils/parseYMD.js +36 -1
  76. package/lib/utils/removeDuplicateItem.js +11 -1
  77. package/lib/utils/sendEmail.js +39 -1
  78. package/lib/utils/snaDefine-6a2bcd94.js +5 -0
  79. package/lib/utils/snaDefine.js +1 -1
  80. package/lib/utils/snaPreProcess.js +84 -1
  81. package/package.json +17 -21
  82. package/lib/components/Empty-54b79907.js +0 -1
  83. package/lib/components/KeywordSearch-5a393f12.js +0 -1
  84. package/lib/components/Select-f2441b83.js +0 -1
  85. package/lib/components/_rollupPluginBabelHelpers-1b8c042f.js +0 -1
  86. package/lib/components/_rollupPluginBabelHelpers-ec4e2a53.js +0 -1
  87. package/lib/components/createSvgIcon-62b64929.js +0 -1
  88. package/lib/components/createSvgIcon-e24792d4.js +0 -1
  89. package/lib/components/createTheme-7fffa109.js +0 -1
  90. package/lib/components/dataExport-9fccd4f0.js +0 -1
  91. package/lib/components/debounce-c993109b.js +0 -1
  92. package/lib/components/hoist-non-react-statics.cjs-d6a9befd.js +0 -1
  93. package/lib/components/index-11391ca3.js +0 -7
  94. package/lib/components/index-b2745105.js +0 -7
  95. package/lib/components/isObjectLike-2f1983fe.js +0 -1
  96. package/lib/components/style-inject.es-c875d022.js +0 -1
  97. package/lib/components/transform-0eb2d36e.js +0 -1
  98. package/lib/utils/_commonjsHelpers-e2cda605.js +0 -1
  99. package/lib/utils/_rollupPluginBabelHelpers-928a52ce.js +0 -1
@@ -1 +1,37 @@
1
- import{c as e,_ as o}from"./_rollupPluginBabelHelpers-ec4e2a53.js";import r from"react";import a from"prop-types";import{FormControlLabel as t,Checkbox as n}from"@material-ui/core";var l=["onCheck","disabled","children"],c=function(a){var c=a.onCheck,i=a.disabled,d=a.children,p=e(a,l);return r.createElement(t,{control:r.createElement(n,o({},p,{disabled:i,onChange:function(e){c(e&&e.target&&e.target.checked),e.stopPropagation()}})),label:d})};c.defaultProps={disabled:void 0,children:void 0,onCheck:function(){}},c.propTypes={disabled:a.bool,children:a.node,onCheck:a.func};export{c as default};
1
+ import { c as _objectWithoutProperties, _ as _extends } from './_rollupPluginBabelHelpers-a52356f6.js';
2
+ import React__default from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { FormControlLabel, Checkbox as Checkbox$1 } from '@material-ui/core';
5
+
6
+ var _excluded = ["onCheck", "disabled", "children"];
7
+ var Checkbox = function Checkbox(_ref) {
8
+ var onCheck = _ref.onCheck,
9
+ disabled = _ref.disabled,
10
+ children = _ref.children,
11
+ prop = _objectWithoutProperties(_ref, _excluded);
12
+ return /*#__PURE__*/React__default.createElement(FormControlLabel, {
13
+ control: /*#__PURE__*/React__default.createElement(Checkbox$1, _extends({}, prop, {
14
+ disabled: disabled,
15
+ onChange: function onChange(event) {
16
+ onCheck(event && event.target && event.target.checked);
17
+ event.stopPropagation();
18
+ }
19
+ })),
20
+ label: children
21
+ });
22
+ };
23
+ Checkbox.defaultProps = {
24
+ disabled: undefined,
25
+ children: undefined,
26
+ onCheck: function onCheck() {}
27
+ };
28
+ Checkbox.propTypes = {
29
+ /** 是否禁止使用 */
30
+ disabled: PropTypes.bool,
31
+ /** 顯示的內容值 */
32
+ children: PropTypes.node,
33
+ /** 勾選時的callback */
34
+ onCheck: PropTypes.func
35
+ };
36
+
37
+ export { Checkbox as default };
@@ -1 +1,179 @@
1
- import e,{useState as n,useRef as t,useEffect as o}from"react";import{c as l}from"./index-11391ca3.js";import a from"prop-types";import{Typography as r}from"@material-ui/core";import s from"./MoreButton.js";import{s as i}from"./style-inject.es-c875d022.js";import"@material-ui/icons";i(".collapseContent__desc {\n font-size: 1.5rem !important;\n text-indent: 3rem;\n font-family: 'Noto Sans TC', 'Arial', sans-serif !important;\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n white-space: pre-wrap;\n word-break: break-all; }\n .collapseContent__desc p,\n .collapseContent__desc pre {\n margin: 0; }\n .collapseContent__desc--1 {\n -webkit-line-clamp: 1; }\n .collapseContent__desc--2 {\n -webkit-line-clamp: 2; }\n .collapseContent__desc--3 {\n -webkit-line-clamp: 3; }\n .collapseContent__desc--4 {\n -webkit-line-clamp: 4; }\n .collapseContent__desc--5 {\n -webkit-line-clamp: 5; }\n .collapseContent__desc--10 {\n -webkit-line-clamp: 10; }\n .collapseContent__desc--lightHeight {\n line-height: 2.25; }\n .collapseContent__desc--expand {\n -webkit-line-clamp: initial; }\n .collapseContent__desc--indent {\n text-indent: 3rem; }\n");const c=a=>{const{className:i,content:c,textColor:p,lineClamp:d,useLightHeight:m,useTextIndent:C}=a,{formatMessage:_,primaryColor:g,secondaryColor:h,shadowColor:f}=a;if(!c)return e.createElement(e.Fragment,null);const[u,b]=n(),[w,x]=n(),v=t();return o((()=>{if(c&&v&&v.current){const e=v.current,{clientHeight:n,scrollHeight:t}=e||{};x(t>n)}}),[v,c]),e.createElement("div",{className:l("collapseContent",i)},e.createElement(r,{ref:v,variant:"inherit",className:l("collapseContent__desc",`collapseContent__desc--${d<=5?d:10}`,{"collapseContent__desc--indent":C},{"collapseContent__desc--expand":u},{"collapseContent__desc--lightHeight":m}),color:"textSecondary",style:{color:p}},(y=c)&&0!==y.length?e.createElement("div",{dangerouslySetInnerHTML:{__html:`<div>${y.replaceAll("\n\n","\n").split("\n").join("<div/><br/><div>")}</div>`}}):y),w&&e.createElement(s,{small:!0,primaryColor:g,secondaryColor:h,shadowColor:f,formatMessage:_,expand:u,setExpand:b}));var y};c.defaultProps={className:void 0,content:void 0,textColor:void 0,lineClamp:2,useLightHeight:void 0,useTextIndent:!0,formatMessage:void 0,primaryColor:"#271702",secondaryColor:"#aa8859",shadowColor:void 0},c.propTypes={className:a.string,content:a.string,textColor:a.string,lineClamp:a.number,useLightHeight:a.bool,useTextIndent:a.bool,formatMessage:a.func,primaryColor:a.string,secondaryColor:a.string,shadowColor:a.string};export{c as default};
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
2
+ import React__default, { useState, useRef, useEffect } from 'react';
3
+ import { c as classNames } from './index-ef96775f.js';
4
+ import PropTypes from 'prop-types';
5
+ import { Typography } from '@material-ui/core';
6
+ import { M as MoreButton } from './MoreButton-6b323fe4.js';
7
+ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
8
+ import '@material-ui/icons';
9
+
10
+ const HtmlToReactParser = require('html-to-react').Parser;
11
+ const htmlToReactParser = new HtmlToReactParser();
12
+
13
+ // full options list (defaults)
14
+ const md = require('markdown-it')({
15
+ html: true,
16
+ // Enable HTML tags in source
17
+ xhtmlOut: true,
18
+ // Use '/' to close single tags (<br />).
19
+ // This is only for full CommonMark compatibility.
20
+ breaks: true,
21
+ // Convert '\n' in paragraphs into <br>
22
+ langPrefix: 'language-',
23
+ // CSS language prefix for fenced blocks. Can be
24
+ // useful for external highlighters.
25
+ linkify: false,
26
+ // Autoconvert URL-like text to links
27
+
28
+ // Enable some language-neutral replacement + quotes beautification
29
+ // For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js
30
+ typographer: false,
31
+ // Double + single quotes replacement pairs, when typographer enabled,
32
+ // and smartquotes on. Could be either a String or an Array.
33
+ //
34
+ // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
35
+ // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
36
+ quotes: '“”‘’',
37
+ // Highlighter function. Should return escaped HTML,
38
+ // or '' if the source string is not changed and should be escaped externally.
39
+ // If result starts with <pre... internal wrapper is skipped.
40
+ highlight( /* str, lang */
41
+ ) {
42
+ return '';
43
+ }
44
+ });
45
+
46
+ // eslint-disable-next-line import/prefer-default-export
47
+ const convert2HtmlEntities = text => {
48
+ if (text === undefined) return '';
49
+ return htmlToReactParser.parse(md.render(text));
50
+ };
51
+
52
+ /* eslint-disable react/no-danger */
53
+ var textDivider = (text => {
54
+ if (!text || text.length === 0) return text;
55
+ return (
56
+ /*#__PURE__*/
57
+ // <div
58
+ // dangerouslySetInnerHTML={{
59
+ // __html: `<div>${convert2HtmlEntities(text.replaceAll('\n\n', '\n').split('\n').join('<div/><br/><div>'))}</div>`,
60
+ // }}
61
+ // />
62
+ React__default.createElement("div", null, convert2HtmlEntities(text.replaceAll('\n\n', '\n').split('\n').join('<div/><br/><div>')))
63
+ );
64
+ });
65
+
66
+ var css_248z = ".collapseContent__desc {\n font-size: 1.5rem !important;\n text-indent: 3rem;\n font-family: 'Noto Sans TC', 'Arial', sans-serif !important;\n display: -webkit-box;\n overflow: hidden;\n -webkit-box-orient: vertical;\n white-space: pre-wrap;\n word-break: break-all; }\n .collapseContent__desc p,\n .collapseContent__desc pre {\n margin: 0; }\n .collapseContent__desc--1 {\n -webkit-line-clamp: 1; }\n .collapseContent__desc--2 {\n -webkit-line-clamp: 2; }\n .collapseContent__desc--3 {\n -webkit-line-clamp: 3; }\n .collapseContent__desc--4 {\n -webkit-line-clamp: 4; }\n .collapseContent__desc--5 {\n -webkit-line-clamp: 5; }\n .collapseContent__desc--10 {\n -webkit-line-clamp: 10; }\n .collapseContent__desc--lightHeight {\n line-height: 2.25; }\n .collapseContent__desc--expand {\n -webkit-line-clamp: initial; }\n .collapseContent__desc--indent {\n text-indent: 3rem; }\n";
67
+ styleInject(css_248z);
68
+
69
+ // const remUnit = 16;
70
+
71
+ var CollapseContent = function CollapseContent(props) {
72
+ var className = props.className,
73
+ content = props.content,
74
+ textColor = props.textColor,
75
+ lineClamp = props.lineClamp,
76
+ useLightHeight = props.useLightHeight,
77
+ useTextIndent = props.useTextIndent;
78
+ var formatMessage = props.formatMessage,
79
+ primaryColor = props.primaryColor,
80
+ secondaryColor = props.secondaryColor,
81
+ shadowColor = props.shadowColor;
82
+ if (!content) return /*#__PURE__*/React__default.createElement(React__default.Fragment, null); // 元件不可以回傳undefined storybook會該該叫
83
+
84
+ var _useState = useState(),
85
+ _useState2 = _slicedToArray(_useState, 2),
86
+ expand = _useState2[0],
87
+ setExpand = _useState2[1];
88
+ var _useState3 = useState(),
89
+ _useState4 = _slicedToArray(_useState3, 2),
90
+ overflow = _useState4[0],
91
+ setOverflow = _useState4[1];
92
+ var contentRef = useRef();
93
+ useEffect(function () {
94
+ if (!content) return;
95
+ if (contentRef && contentRef.current) {
96
+ // const childrenDOM = contentRef.current.children || [];
97
+ // const dom = childrenDOM.length === 1 ? contentRef.current.children[0] : contentRef.current;
98
+ var dom = contentRef.current;
99
+ var _ref = dom || {},
100
+ clientHeight = _ref.clientHeight,
101
+ scrollHeight = _ref.scrollHeight;
102
+ setOverflow(scrollHeight > clientHeight);
103
+ }
104
+ }, [contentRef, content]);
105
+
106
+ // const { fontSizeRem, textIndent } = useMemo(
107
+ // () => ({ fontSizeRem: `${fontSize / remUnit}rem`, textIndent: `${(fontSize / remUnit) * 2}rem` }),
108
+ // [fontSize]
109
+ // );
110
+
111
+ return /*#__PURE__*/React__default.createElement("div", {
112
+ className: classNames('collapseContent', className)
113
+ }, /*#__PURE__*/React__default.createElement(Typography, {
114
+ ref: contentRef,
115
+ variant: "inherit",
116
+ className: classNames('collapseContent__desc', "collapseContent__desc--".concat(lineClamp <= 5 ? lineClamp : 10), {
117
+ 'collapseContent__desc--indent': useTextIndent
118
+ }, {
119
+ 'collapseContent__desc--expand': expand
120
+ }, {
121
+ 'collapseContent__desc--lightHeight': useLightHeight
122
+ }),
123
+ color: "textSecondary",
124
+ style: {
125
+ color: textColor
126
+ }
127
+ }, textDivider(content)), overflow && /*#__PURE__*/React__default.createElement(MoreButton, {
128
+ small: true,
129
+ primaryColor: primaryColor,
130
+ secondaryColor: secondaryColor,
131
+ shadowColor: shadowColor,
132
+ formatMessage: formatMessage,
133
+ expand: expand,
134
+ setExpand: setExpand
135
+ }));
136
+ };
137
+ CollapseContent.defaultProps = {
138
+ className: undefined,
139
+ content: undefined,
140
+ textColor: undefined,
141
+ // fontSize: 24,
142
+ lineClamp: 2,
143
+ useLightHeight: undefined,
144
+ useTextIndent: true,
145
+ formatMessage: undefined,
146
+ primaryColor: '#271702',
147
+ // default為文學網站的主色系
148
+ secondaryColor: '#aa8859',
149
+ // default為文學網站的次色系
150
+ shadowColor: undefined
151
+ };
152
+
153
+ /* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
154
+ CollapseContent.propTypes = {
155
+ /** Css Name */
156
+ className: PropTypes.string,
157
+ /** 內文 */
158
+ content: PropTypes.string,
159
+ /** 內文字體顏色 */
160
+ textColor: PropTypes.string,
161
+ /** 內文字大小 */
162
+ // fontSize: PropTypes.number,
163
+ /** 多行文字縮減 */
164
+ lineClamp: PropTypes.number,
165
+ /** 是否增加lightHeight(2.25) */
166
+ useLightHeight: PropTypes.bool,
167
+ /** 文字前面是否空格 */
168
+ useTextIndent: PropTypes.bool,
169
+ /** 語系翻譯的formateMessag(useIntl) */
170
+ formatMessage: PropTypes.func,
171
+ /** 顯示更多按鈕主色系顏色 */
172
+ primaryColor: PropTypes.string,
173
+ /** 顯示更多按鈕次色系顏色 */
174
+ secondaryColor: PropTypes.string,
175
+ /** 顯示更多按鈕影子顏色 */
176
+ shadowColor: PropTypes.string
177
+ };
178
+
179
+ export { CollapseContent as default };