@daoyi/nmtl-ui 2.0.1-beta.14 → 2.0.1-beta.141

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 (112) hide show
  1. package/README.md +45 -45
  2. package/lib/components/Autocomplete-e40d7145.js +494 -0
  3. package/lib/components/Autocomplete.js +20 -1
  4. package/lib/components/Avatar.js +59 -1
  5. package/lib/components/BackTop.js +124 -1
  6. package/lib/components/BarChart.js +764 -1
  7. package/lib/components/Breadcrumbs.js +146 -1
  8. package/lib/components/Button-8cf35bc0.js +114 -0
  9. package/lib/components/Button.js +7 -1
  10. package/lib/components/Carousel.js +4654 -1
  11. package/lib/components/Checkbox.js +37 -1
  12. package/lib/components/CollapseContent.js +235 -1
  13. package/lib/components/ContactModal-af7fa280.js +12295 -0
  14. package/lib/components/ContactModal.js +24 -3
  15. package/lib/components/Drawer-b770014f.js +247 -0
  16. package/lib/components/Drawer.js +18 -1
  17. package/lib/components/Dropdown.js +134 -1
  18. package/lib/components/Empty-48685dd0.js +46 -0
  19. package/lib/components/Empty.js +5 -1
  20. package/lib/components/ExportButton.js +128 -1
  21. package/lib/components/ExtraTools-c46c1965.js +3676 -0
  22. package/lib/components/ExtraTools.js +11 -22
  23. package/lib/components/Filter.js +821 -12
  24. package/lib/components/Footer.js +317 -1
  25. package/lib/components/ForwardLink-2905563c.js +184 -0
  26. package/lib/components/ForwardLink.js +10 -0
  27. package/lib/components/Header.js +267 -1
  28. package/lib/components/Image.js +61 -1
  29. package/lib/components/Input.js +89 -1
  30. package/lib/components/InputMethod.js +33937 -10
  31. package/lib/components/KeywordSearch-4e621ded.js +156 -0
  32. package/lib/components/KeywordSearch.js +22 -1
  33. package/lib/components/KeywordTicker.js +224 -1
  34. package/lib/components/Keywords.js +383 -1
  35. package/lib/components/Loading.js +32 -1
  36. package/lib/components/MUITheme.js +2657 -1
  37. package/lib/components/Modal-aa77d4d8.js +171 -0
  38. package/lib/components/Modal.js +11 -1
  39. package/lib/components/MoreButton-0b5aaef3.js +148 -0
  40. package/lib/components/MoreButton.js +8 -1
  41. package/lib/components/Pagination.js +3702 -0
  42. package/lib/components/Radio.js +83 -1
  43. package/lib/components/SNA.js +1755 -22
  44. package/lib/components/SegmentedControl-804da0a6.js +113 -0
  45. package/lib/components/SegmentedControl.js +11 -0
  46. package/lib/components/Select-979f7e73.js +189 -0
  47. package/lib/components/Select.js +14 -1
  48. package/lib/components/Spin-07679812.js +79 -0
  49. package/lib/components/Spin.js +7 -1
  50. package/lib/components/Table.js +51 -1
  51. package/lib/components/Tooltip-bbbaa9c7.js +70 -0
  52. package/lib/components/Tooltip.js +7 -1
  53. package/lib/components/_commonjsHelpers-70de2c37.js +28 -0
  54. package/lib/components/_rollupPluginBabelHelpers-a52356f6.js +142 -0
  55. package/lib/components/createSvgIcon-370e163a.js +576 -0
  56. package/lib/components/dataExport-a9e3fae1.js +91 -0
  57. package/lib/components/debounce-127da66c.js +355 -0
  58. package/lib/components/defaultTheme-c5dd0f64.js +1661 -0
  59. package/lib/components/globalConfig.js +474 -0
  60. package/lib/components/hoist-non-react-statics.cjs-3f408ad2.js +105 -0
  61. package/lib/components/index-c33afcb5.js +61 -0
  62. package/lib/components/index-ff95f719.js +481 -0
  63. package/lib/components/isObjectLike-e111475d.js +190 -0
  64. package/lib/components/style-inject.es-1f59c1d0.js +28 -1
  65. package/lib/components/toConsumableArray-c268c112.js +19 -0
  66. package/lib/components/transform-849a452c.js +5475 -0
  67. package/lib/components/useTheme-98b6cf17.js +11 -0
  68. package/lib/components/withTheme-3486f38b.js +6 -0
  69. package/lib/configs/config.selector.js +151 -0
  70. package/lib/configs/index.d.ts +1 -0
  71. package/lib/configs/index.js +1 -0
  72. package/lib/index.d.ts +6 -1
  73. package/lib/index.js +6 -1
  74. package/lib/utils/_rollupPluginBabelHelpers-9802e640.js +121 -0
  75. package/lib/utils/arrayMerge.js +4953 -1
  76. package/lib/utils/chunkArray.js +15 -1
  77. package/lib/utils/convert2HtmlEntities.js +57 -1
  78. package/lib/utils/domToImage.js +802 -1
  79. package/lib/utils/downloadGephi.js +106 -1
  80. package/lib/utils/exportXlsx.js +221 -1
  81. package/lib/utils/historyAppendSearch.js +502 -1
  82. package/lib/utils/index.d.ts +2 -0
  83. package/lib/utils/index.js +2 -0
  84. package/lib/utils/isDevelopMode.js +5 -1
  85. package/lib/utils/newWindowHint-72ebfe3b.js +53 -0
  86. package/lib/utils/parseYMD.js +36 -1
  87. package/lib/utils/prepareTimelineData.js +100 -0
  88. package/lib/utils/removeDuplicateItem.js +11 -1
  89. package/lib/utils/sendEmail.js +39 -1
  90. package/lib/utils/snaDefine-6a2bcd94.js +5 -0
  91. package/lib/utils/snaDefine.js +1 -1
  92. package/lib/utils/snaPreProcess.js +84 -1
  93. package/lib/utils/syncTimelineA11y.js +327 -0
  94. package/package.json +141 -128
  95. package/lib/components/Empty-54b79907.js +0 -1
  96. package/lib/components/KeywordSearch-5a393f12.js +0 -1
  97. package/lib/components/Select-f2441b83.js +0 -1
  98. package/lib/components/_rollupPluginBabelHelpers-1b8c042f.js +0 -1
  99. package/lib/components/_rollupPluginBabelHelpers-ec4e2a53.js +0 -1
  100. package/lib/components/createSvgIcon-62b64929.js +0 -1
  101. package/lib/components/createSvgIcon-e24792d4.js +0 -1
  102. package/lib/components/createTheme-7fffa109.js +0 -1
  103. package/lib/components/dataExport-9fccd4f0.js +0 -1
  104. package/lib/components/debounce-c993109b.js +0 -1
  105. package/lib/components/hoist-non-react-statics.cjs-d6a9befd.js +0 -1
  106. package/lib/components/index-11391ca3.js +0 -7
  107. package/lib/components/index-b2745105.js +0 -7
  108. package/lib/components/isObjectLike-2f1983fe.js +0 -1
  109. package/lib/components/style-inject.es-c875d022.js +0 -1
  110. package/lib/components/transform-95ae0119.js +0 -1
  111. package/lib/utils/_commonjsHelpers-e2cda605.js +0 -1
  112. package/lib/utils/_rollupPluginBabelHelpers-928a52ce.js +0 -1
@@ -1 +1,146 @@
1
- import e from"react";import{c as t}from"./index-b2745105.js";import r from"prop-types";import{NavLink as a}from"react-router-dom";import{Typography as n,Breadcrumbs as o}from"@material-ui/core";import{s as c}from"./style-inject.es-1f59c1d0.js";c(".breadcrumbItem {\n display: flex;\n opacity: 0.8;\n transition: opacity 0.1s ease-in-out; }\n .breadcrumbItem:hover {\n opacity: 1; }\n .breadcrumbItem--last {\n opacity: 1;\n font-weight: 500 !important; }\n .breadcrumbItem__icon {\n display: flex;\n align-items: center;\n margin-right: 4px; }\n .breadcrumbItem__icon svg {\n font-size: 18px; }\n");const i=r=>{let{className:a,icon:o,text:c,lastItem:i,onClick:s}=r;return e.createElement(n,{color:"textPrimary",className:a,onClick:s},e.createElement("div",{className:t("breadcrumbItem",{"breadcrumbItem--last":i})},o&&e.createElement("span",{className:"breadcrumbItem__icon"},o),e.createElement("span",{className:"breadcrumbItem__text"},c)))};i.defaultProps={className:void 0,icon:void 0,text:void 0,lastItem:void 0,onClick:()=>{}},i.propTypes={className:r.string,icon:r.node,text:r.string,lastItem:r.bool,onClick:r.func};c(".breadcrumbs__link {\n cursor: pointer;\n text-decoration: none !important; }\n");var s=function(r){var n=r.className,c=r.links,s=r.separator;return e.createElement(o,{className:t("breadcrumbs",n),"aria-label":"breadcrumb",separator:s&&s.length>0?s:void 0},Array.isArray(c)&&c.length>0&&c.map((function(t,r){var n=t.icon,o=t.text,s=t.href,m=t.onClick;return r===c.length-1?e.createElement(i,{key:r.toString(),lastItem:!0,icon:n,text:o,onClick:m}):0===r?e.createElement(a,{className:"breadcrumbs__link",key:r.toString(),to:s||"/",onClick:m},e.createElement(i,{icon:n,text:o})):s?e.createElement(a,{className:"breadcrumbs__link",key:r.toString(),to:s,onClick:m},e.createElement(i,{icon:n,text:o})):e.createElement(i,{key:r.toString(),lastItem:!0,icon:n,text:o,onClick:m})})))};s.defaultProps={className:void 0,links:void 0,separator:void 0},s.propTypes={className:r.string,links:r.arrayOf(r.any),separator:r.string};export{s as default};
1
+ import React__default from 'react';
2
+ import { c as classNames } from './index-c33afcb5.js';
3
+ import PropTypes from 'prop-types';
4
+ import { Link } from 'react-router-dom';
5
+ import { Typography, Breadcrumbs as Breadcrumbs$1 } from '@material-ui/core';
6
+ import { getIntl } from './globalConfig';
7
+ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
8
+
9
+ var css_248z$1 = ".breadcrumbItem {\n display: flex;\n opacity: 0.8;\n transition: opacity 0.1s ease-in-out;\n}\n.breadcrumbItem:hover {\n opacity: 1;\n}\n.breadcrumbItem--last {\n opacity: 1;\n font-weight: 500 !important;\n}\n.breadcrumbItem__icon {\n display: flex;\n align-items: center;\n margin-right: 4px;\n}\n.breadcrumbItem__icon svg {\n font-size: 1.125rem;\n}";
10
+ styleInject(css_248z$1);
11
+
12
+ const BreadcrumbItem = _ref => {
13
+ let {
14
+ className,
15
+ icon,
16
+ text,
17
+ lastItem,
18
+ current,
19
+ onClick
20
+ } = _ref;
21
+ return /*#__PURE__*/React__default.createElement(Typography, {
22
+ color: "textPrimary",
23
+ className: className,
24
+ onClick: onClick,
25
+ "aria-current": current ? 'page' : undefined
26
+ }, /*#__PURE__*/React__default.createElement("div", {
27
+ className: classNames('breadcrumbItem', {
28
+ 'breadcrumbItem--last': lastItem
29
+ })
30
+ }, icon && /*#__PURE__*/React__default.createElement("span", {
31
+ className: "breadcrumbItem__icon"
32
+ }, icon), /*#__PURE__*/React__default.createElement("span", {
33
+ className: "breadcrumbItem__text"
34
+ }, text)));
35
+ };
36
+ BreadcrumbItem.defaultProps = {
37
+ className: undefined,
38
+ icon: undefined,
39
+ text: undefined,
40
+ lastItem: undefined,
41
+ current: false,
42
+ onClick: () => {}
43
+ };
44
+ BreadcrumbItem.propTypes = {
45
+ className: PropTypes.string,
46
+ icon: PropTypes.node,
47
+ text: PropTypes.string,
48
+ lastItem: PropTypes.bool,
49
+ /** 目前所在頁(麵包屑最後一項):加 aria-current="page" */
50
+ current: PropTypes.bool,
51
+ onClick: PropTypes.func
52
+ };
53
+
54
+ var css_248z = "@charset \"UTF-8\";\n.breadcrumbs__link {\n cursor: pointer;\n text-decoration: none !important;\n /* WCAG 2.4.7(2026-10-08 人工測試回饋):連結內是 Typography span > div.breadcrumbItem(flex),\n inline 的 <a> 自己沒有文字列,Chrome 的虛線焦點框沿空的行框畫,畫面上看不到。\n 改為 inline-flex,焦點框才會包住整個項目 */\n display: inline-flex;\n}";
55
+ styleInject(css_248z);
56
+
57
+ var Breadcrumbs = function Breadcrumbs(_ref) {
58
+ var className = _ref.className,
59
+ links = _ref.links,
60
+ separator = _ref.separator;
61
+ return /*#__PURE__*/React__default.createElement(Breadcrumbs$1, {
62
+ className: classNames('breadcrumbs', className)
63
+ /* nav 地標名稱依語系(原本中文頁也唸英文 breadcrumb) */,
64
+ "aria-label": getIntl().formatMessage({
65
+ id: 'aria.breadcrumbs'
66
+ }),
67
+ separator: separator && separator.length > 0 ? separator : undefined
68
+ }, Array.isArray(links) && links.length > 0 && links.map(function (_ref2, i) {
69
+ var icon = _ref2.icon,
70
+ text = _ref2.text,
71
+ href = _ref2.href,
72
+ _onClick = _ref2.onClick;
73
+ var lastLink = i === links.length - 1;
74
+
75
+ /* 尾巴=目前所在頁:aria-current="page" 標在這裡(WCAG 4.1.2,數位部人工檢測 GN1410200E,2026-10-07)。
76
+ 目前頁不是互動元件:不掛 onClick(原本滑鼠點得到、鍵盤卻聚焦不到,2026-10-08 人工測試回饋) */
77
+ if (lastLink) return /*#__PURE__*/React__default.createElement(BreadcrumbItem, {
78
+ key: i.toString(),
79
+ lastItem: true,
80
+ current: true,
81
+ icon: icon,
82
+ text: text
83
+ });
84
+
85
+ /* 頭、中間有網址:用 Link 而不是 NavLink。NavLink 沒加 exact 時,「首頁」的 /zh-tw/ 是所有網址的開頭,
86
+ 會被自動標成 aria-current="page"+active,讀屏誤報首頁為目前頁(GN1410200E) */
87
+ if (href || i === 0 && !_onClick) {
88
+ return /*#__PURE__*/React__default.createElement(Link, {
89
+ className: "breadcrumbs__link",
90
+ key: i.toString(),
91
+ to: href || '/',
92
+ onClick: _onClick
93
+ }, /*#__PURE__*/React__default.createElement(BreadcrumbItem, {
94
+ icon: icon,
95
+ text: text
96
+ }));
97
+ }
98
+
99
+ /* 只有 onClick(程式導頁):原本渲染成純文字,滑鼠點得到但鍵盤無法聚焦(WCAG 2.1.1,2026-10-08 人工測試回饋)。
100
+ 作用是前往其他頁,語意是連結 → <a href="#">,可 Tab 聚焦、Enter 啟動,焦點框沿用各站 :focus-visible */
101
+ if (_onClick) {
102
+ return (
103
+ /*#__PURE__*/
104
+ /* 點下去確實會換頁(由呼叫端的 onClick 導頁),不是按鈕 */
105
+ // eslint-disable-next-line jsx-a11y/anchor-is-valid
106
+ React__default.createElement("a", {
107
+ className: "breadcrumbs__link",
108
+ key: i.toString(),
109
+ href: "#",
110
+ onClick: function onClick(e) {
111
+ e.preventDefault();
112
+ _onClick(e);
113
+ }
114
+ }, /*#__PURE__*/React__default.createElement(BreadcrumbItem, {
115
+ icon: icon,
116
+ text: text
117
+ }))
118
+ );
119
+ }
120
+
121
+ /* 中間沒有網址也沒有動作:純文字 */
122
+ return /*#__PURE__*/React__default.createElement(BreadcrumbItem, {
123
+ key: i.toString(),
124
+ lastItem: true,
125
+ icon: icon,
126
+ text: text
127
+ });
128
+ }));
129
+ };
130
+ Breadcrumbs.defaultProps = {
131
+ className: undefined,
132
+ links: undefined,
133
+ separator: undefined
134
+ };
135
+
136
+ /* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
137
+ Breadcrumbs.propTypes = {
138
+ /** Css Name */
139
+ className: PropTypes.string,
140
+ /** 麵包穴的連結們 */
141
+ links: PropTypes.arrayOf(PropTypes.any),
142
+ /** 分割者的符號 */
143
+ separator: PropTypes.string
144
+ };
145
+
146
+ export { Breadcrumbs as default };
@@ -0,0 +1,114 @@
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 { c as classNames } from './index-c33afcb5.js';
5
+ import { Button as Button$1, CircularProgress } from '@material-ui/core';
6
+ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
7
+
8
+ var css_248z = ".button {\n border: 1px solid #ffffff99;\n border-radius: 45px;\n padding: 8px 16px;\n background: #007bff;\n color: white;\n cursor: pointer;\n}\n.button:hover {\n opacity: 0.9;\n}";
9
+ styleInject(css_248z);
10
+
11
+ var _excluded = ["style", "className", "tabIndex", "alt", "text", "size", "variant", "type", "color", "loading", "disabled", "icon", "endIcon", "children", "onClick"];
12
+ var Button = function Button(props) {
13
+ var style = props.style,
14
+ className = props.className,
15
+ tabIndex = props.tabIndex,
16
+ alt = props.alt,
17
+ text = props.text,
18
+ size = props.size,
19
+ variant = props.variant;
20
+ var type = props.type,
21
+ color = props.color,
22
+ loading = props.loading,
23
+ disabled = props.disabled,
24
+ icon = props.icon,
25
+ endIcon = props.endIcon,
26
+ children = props.children,
27
+ onClick = props.onClick;
28
+ /* 本元件原本逐一挑選 props,呼叫端傳入的 aria-*/title/role 會被靜默丟掉——
29
+ nmtl-web 有三處為了補可及名稱而傳 aria-label,其中 areaMap 那處自 80db4537
30
+ 起就一直沒有生效(WCAG 4.1.2,Freego HM1410200C)。
31
+ 把宣告過的 props 取出後,其餘一律往下傳。 */
32
+ props.style;
33
+ props.className;
34
+ props.tabIndex;
35
+ props.alt;
36
+ props.text;
37
+ props.size;
38
+ props.variant;
39
+ props.type;
40
+ props.color;
41
+ props.loading;
42
+ props.disabled;
43
+ props.icon;
44
+ props.endIcon;
45
+ props.children;
46
+ props.onClick;
47
+ var rest = _objectWithoutProperties(props, _excluded);
48
+ return /*#__PURE__*/React__default.createElement(Button$1, _extends({}, rest, {
49
+ style: style,
50
+ className: classNames('button', className),
51
+ tabIndex: tabIndex,
52
+ alt: alt,
53
+ size: size,
54
+ variant: variant,
55
+ color: type || color,
56
+ disabled: loading || disabled,
57
+ onClick: onClick,
58
+ startIcon: icon,
59
+ endIcon: loading ? /*#__PURE__*/React__default.createElement(CircularProgress, {
60
+ size: 16
61
+ }) : endIcon
62
+ }), text, children);
63
+ };
64
+ Button.defaultProps = {
65
+ style: undefined,
66
+ className: undefined,
67
+ tabIndex: undefined,
68
+ alt: undefined,
69
+ text: undefined,
70
+ loading: false,
71
+ disabled: false,
72
+ variant: undefined,
73
+ size: 'small',
74
+ color: 'primary',
75
+ type: undefined,
76
+ children: undefined,
77
+ icon: undefined,
78
+ endIcon: undefined,
79
+ onClick: function onClick() {}
80
+ };
81
+ Button.propTypes = {
82
+ /** 樣式 */
83
+ style: PropTypes.objectOf(PropTypes.any),
84
+ /** Css Name */
85
+ className: PropTypes.string,
86
+ /** Tab 鍵位置 */
87
+ tabIndex: PropTypes.number,
88
+ /** 註解 */
89
+ alt: PropTypes.string,
90
+ /** 輸入的文字 */
91
+ text: PropTypes.string,
92
+ /** 是否載入中 */
93
+ loading: PropTypes.bool,
94
+ /** 是否禁用 */
95
+ disabled: PropTypes.bool,
96
+ /** 按鈕種類 */
97
+ variant: PropTypes.oneOf(['contained', 'outlined', 'text']),
98
+ /** 按鈕的大小 */
99
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
100
+ /** 按鈕顏色 */
101
+ color: PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary']),
102
+ /** 按鈕樣式(同按鈕顏色) */
103
+ type: PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary']),
104
+ /** 按鈕內容 */
105
+ children: PropTypes.node,
106
+ /** 按鈕圖案(前面) */
107
+ icon: PropTypes.node,
108
+ /** 按鈕圖案(後面) */
109
+ endIcon: PropTypes.node,
110
+ /** 點擊後的返回 */
111
+ onClick: PropTypes.func
112
+ };
113
+
114
+ export { Button as B };
@@ -1 +1,7 @@
1
- import e from"react";import o from"prop-types";import{c as n}from"./index-b2745105.js";import{Button as t,CircularProgress as i}from"@material-ui/core";import{s as a}from"./style-inject.es-1f59c1d0.js";a(".button {\n border: 1px solid #ffffff99;\n border-radius: 45px;\n padding: 8px 16px;\n background: #007bff;\n color: white;\n cursor: pointer; }\n .button:hover {\n opacity: 0.9; }\n");var r=function(o){var a=o.style,r=o.className,d=o.tabIndex,l=o.alt,s=o.text,c=o.size,f=o.variant,p=o.type,m=o.color,b=o.loading,u=o.disabled,v=o.icon,y=o.endIcon,x=o.children,g=o.onClick;return e.createElement(t,{style:a,className:n("button",r),tabIndex:d,alt:l,size:c,variant:f,color:p||m,disabled:b||u,onClick:g,startIcon:v,endIcon:b?e.createElement(i,{size:16}):y},s,x)};r.defaultProps={style:void 0,className:void 0,tabIndex:void 0,alt:void 0,text:void 0,loading:!1,disabled:!1,variant:void 0,size:"small",color:"primary",type:void 0,children:void 0,icon:void 0,endIcon:void 0,onClick:function(){}},r.propTypes={style:o.objectOf(o.any),className:o.string,tabIndex:o.number,alt:o.string,text:o.string,loading:o.bool,disabled:o.bool,variant:o.oneOf(["contained","outlined","text"]),size:o.oneOf(["small","medium","large"]),color:o.oneOf(["default","inherit","primary","secondary"]),type:o.oneOf(["default","inherit","primary","secondary"]),children:o.node,icon:o.node,endIcon:o.node,onClick:o.func};export{r as default};
1
+ export { B as default } from './Button-8cf35bc0.js';
2
+ import './_rollupPluginBabelHelpers-a52356f6.js';
3
+ import 'react';
4
+ import 'prop-types';
5
+ import './index-c33afcb5.js';
6
+ import '@material-ui/core';
7
+ import './style-inject.es-1f59c1d0.js';