@daoyi/nmtl-ui 2.0.1-beta.90 → 2.0.1-beta.92

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 (60) hide show
  1. package/README.md +45 -45
  2. package/lib/components/{Autocomplete-24e9686d.js → Autocomplete-5d6f1df8.js} +57 -15
  3. package/lib/components/Autocomplete.js +6 -5
  4. package/lib/components/Avatar.js +1 -1
  5. package/lib/components/BackTop.js +3 -3
  6. package/lib/components/BarChart.js +1 -1
  7. package/lib/components/Breadcrumbs.js +1 -1
  8. package/lib/components/{Button-430d39e6.js → Button-305b69a0.js} +1 -1
  9. package/lib/components/Button.js +2 -2
  10. package/lib/components/Carousel.js +2 -61
  11. package/lib/components/Checkbox.js +1 -1
  12. package/lib/components/CollapseContent.js +3 -3
  13. package/lib/components/{ContactModal-523ae294.js → ContactModal-1997d146.js} +94 -22
  14. package/lib/components/ContactModal.js +10 -10
  15. package/lib/components/{Drawer-ec47e780.js → Drawer-b9855a54.js} +10 -3
  16. package/lib/components/Drawer.js +6 -5
  17. package/lib/components/Dropdown.js +2 -2
  18. package/lib/components/{Empty-dc5fc2fc.js → Empty-bf77164f.js} +1 -1
  19. package/lib/components/Empty.js +2 -2
  20. package/lib/components/ExportButton.js +2 -2
  21. package/lib/components/{ExtraTools-0ffc772b.js → ExtraTools-5954ee3a.js} +75 -78
  22. package/lib/components/ExtraTools.js +4 -4
  23. package/lib/components/Filter.js +3 -3
  24. package/lib/components/Footer.js +10 -10
  25. package/lib/components/{ForwardLink-15222b22.js → ForwardLink-aa950a50.js} +17 -8
  26. package/lib/components/ForwardLink.js +4 -3
  27. package/lib/components/Header.js +25 -9
  28. package/lib/components/Image.js +2 -2
  29. package/lib/components/Input.js +1 -1
  30. package/lib/components/InputMethod.js +197 -187
  31. package/lib/components/{KeywordSearch-91167d24.js → KeywordSearch-33341dd3.js} +3 -3
  32. package/lib/components/KeywordSearch.js +7 -6
  33. package/lib/components/KeywordTicker.js +5 -4
  34. package/lib/components/Keywords.js +7 -6
  35. package/lib/components/Loading.js +1 -1
  36. package/lib/components/{Modal-6b8c72d7.js → Modal-5a27951f.js} +12 -4
  37. package/lib/components/Modal.js +5 -4
  38. package/lib/components/{MoreButton-4d5d94da.js → MoreButton-44d3b4fe.js} +1 -1
  39. package/lib/components/MoreButton.js +2 -2
  40. package/lib/components/Pagination.js +3 -3
  41. package/lib/components/Radio.js +1 -1
  42. package/lib/components/SNA.js +4 -4
  43. package/lib/components/{Select-7da870e0.js → Select-e550d0a5.js} +24 -7
  44. package/lib/components/Select.js +4 -4
  45. package/lib/components/{Spin-9a07b106.js → Spin-8dc60bfe.js} +1 -1
  46. package/lib/components/Spin.js +2 -2
  47. package/lib/components/Table.js +1 -1
  48. package/lib/components/{Tooltip-6d53cb6e.js → Tooltip-6ebfa9c1.js} +2 -2
  49. package/lib/components/Tooltip.js +3 -3
  50. package/lib/components/{_rollupPluginBabelHelpers-ed61ffc0.js → _rollupPluginBabelHelpers-a52356f6.js} +24 -42
  51. package/lib/components/globalConfig.js +30 -21
  52. package/lib/components/{index-f491ebce.js → index-b76a85f4.js} +1 -1
  53. package/lib/utils/{_rollupPluginBabelHelpers-a6e0e6e3.js → _rollupPluginBabelHelpers-8dd26e1a.js} +24 -42
  54. package/lib/utils/arrayMerge.js +21 -21
  55. package/lib/utils/exportXlsx.js +1 -1
  56. package/lib/utils/historyAppendSearch.js +1 -1
  57. package/lib/utils/snaPreProcess.js +1 -1
  58. package/package.json +125 -125
  59. /package/lib/components/{createSvgIcon-ff0e3b99.js → createSvgIcon-e3803ee1.js} +0 -0
  60. /package/lib/components/{index-a6f22b92.js → index-b47819f3.js} +0 -0
@@ -1,8 +1,8 @@
1
- import { f as _taggedTemplateLiteral, e as _defineProperty } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { f as _taggedTemplateLiteral, e as _defineProperty } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useContext, createElement, useCallback } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { c as classNames } from './index-f491ebce.js';
5
- import { q as queryString } from './index-a6f22b92.js';
4
+ import { c as classNames } from './index-b76a85f4.js';
5
+ import { q as queryString } from './index-b47819f3.js';
6
6
  import { useHistory } from 'react-router-dom';
7
7
  import { isValidElementType, typeOf } from 'react-is';
8
8
  import { h as hoistNonReactStatics_cjs } from './hoist-non-react-statics.cjs-3f408ad2.js';
@@ -1,25 +1,25 @@
1
- import { a as _slicedToArray, d as _typeof } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { a as _slicedToArray, d as _typeof } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useState, useEffect } from 'react';
3
- import { c as classNames } from './index-f491ebce.js';
3
+ import { c as classNames } from './index-b76a85f4.js';
4
4
  import PropTypes from 'prop-types';
5
5
  import axios from 'axios';
6
- import { C as ContactModal } from './ContactModal-523ae294.js';
7
- import { S as Spin } from './Spin-9a07b106.js';
6
+ import { C as ContactModal } from './ContactModal-1997d146.js';
7
+ import { S as Spin } from './Spin-8dc60bfe.js';
8
8
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
9
9
  import './hoist-non-react-statics.cjs-3f408ad2.js';
10
10
  import 'react-is';
11
- import './Modal-6b8c72d7.js';
11
+ import './Modal-5a27951f.js';
12
12
  import '@material-ui/core';
13
13
  import '@material-ui/icons';
14
- import './Button-430d39e6.js';
14
+ import './Button-305b69a0.js';
15
+ import './globalConfig';
15
16
  import './_commonjsHelpers-70de2c37.js';
16
- import './Select-7da870e0.js';
17
- import './Empty-dc5fc2fc.js';
18
- import './createSvgIcon-ff0e3b99.js';
17
+ import './Select-e550d0a5.js';
18
+ import './Empty-bf77164f.js';
19
+ import './createSvgIcon-e3803ee1.js';
19
20
  import './defaultTheme-ed7746fe.js';
20
21
  import '@material-ui/styles';
21
22
  import 'react-dom';
22
- import './globalConfig';
23
23
 
24
24
  /* eslint-disable max-len */
25
25
  const NmtlLogo = _ref => {
@@ -1,9 +1,10 @@
1
- import { c as _objectWithoutProperties } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { c as _objectWithoutProperties } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useMemo } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { q as queryString } from './index-a6f22b92.js';
4
+ import { q as queryString } from './index-b47819f3.js';
5
5
  import { useHistory, Link } from 'react-router-dom';
6
6
  import { Tooltip } from '@material-ui/core';
7
+ import { getIntl } from './globalConfig';
7
8
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
8
9
 
9
10
  var css_248z = ".forwardLink {\n width: -moz-fit-content;\n width: fit-content;\n max-width: 100%;\n display: flex;\n}\n.forwardLink__link {\n color: unset;\n text-decoration: none;\n text-overflow: ellipsis;\n overflow: hidden;\n cursor: pointer;\n display: block;\n width: 100%;\n}\n.forwardLink__link--disabled {\n cursor: not-allowed;\n}";
@@ -25,10 +26,10 @@ var ForwardLink = function ForwardLink(_ref) {
25
26
  var _useMemo = useMemo(function () {
26
27
  var _rest$pathname;
27
28
  if (disabled) return {};
28
- /*
29
- * 若將 search 寫在 pathname 中,意即 pathname=/asd?zxc=qwe
30
- * 會導致換頁時 React route dom 無法匹配 => 空白畫面
31
- * 若真有此情況發生 需把 search 提領出來
29
+ /*
30
+ * 若將 search 寫在 pathname 中,意即 pathname=/asd?zxc=qwe
31
+ * 會導致換頁時 React route dom 無法匹配 => 空白畫面
32
+ * 若真有此情況發生 需把 search 提領出來
32
33
  */
33
34
  var foundIndex = (_rest$pathname = rest.pathname) === null || _rest$pathname === void 0 ? void 0 : _rest$pathname.indexOf('?');
34
35
  if (foundIndex > -1) return {
@@ -44,17 +45,25 @@ var ForwardLink = function ForwardLink(_ref) {
44
45
  pathname = _useMemo$pathname === void 0 ? '' : _useMemo$pathname,
45
46
  _useMemo$search = _useMemo.search,
46
47
  search = _useMemo$search === void 0 ? '' : _useMemo$search;
48
+
49
+ /* WAVE: Redundant title text — title 與連結內文相同時不輸出,避免輔具重複朗讀 */
50
+ var domTitle = tip || typeof children === 'string' && children === title ? undefined : title;
51
+ /* WCAG 3.2.x 另開新視窗預告:target="_blank" 時以 aria-label 註明 */
52
+ var newWindowLabel = target === '_blank' && (typeof children === 'string' || title) ? "".concat(typeof children === 'string' ? children : title).concat(getIntl().formatMessage({
53
+ id: 'aria.newWindow'
54
+ })) : undefined;
47
55
  var linkComponent = /*#__PURE__*/React__default.createElement("div", {
48
56
  className: className
49
57
  }, /*#__PURE__*/React__default.createElement("div", {
50
58
  className: "forwardLink"
51
59
  }, disabled ? /*#__PURE__*/React__default.createElement("div", {
52
- title: tip ? undefined : title,
60
+ title: domTitle,
53
61
  className: "forwardLink__link--disabled"
54
62
  }, children) : /*#__PURE__*/React__default.createElement(Link, {
55
63
  className: "forwardLink__link",
56
64
  target: target,
57
- title: tip ? undefined : title,
65
+ title: domTitle,
66
+ "aria-label": newWindowLabel,
58
67
  to: {
59
68
  pathname: "".concat(locale).concat(pathname),
60
69
  search: search
@@ -1,8 +1,9 @@
1
- export { F as default } from './ForwardLink-15222b22.js';
2
- import './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ export { F as default } from './ForwardLink-aa950a50.js';
2
+ import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
5
- import './index-a6f22b92.js';
5
+ import './index-b47819f3.js';
6
6
  import 'react-router-dom';
7
7
  import '@material-ui/core';
8
+ import './globalConfig';
8
9
  import './style-inject.es-1f59c1d0.js';
@@ -1,27 +1,28 @@
1
- import { a as _slicedToArray } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useState, useRef, useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { c as classNames } from './index-f491ebce.js';
4
+ import { c as classNames } from './index-b76a85f4.js';
5
5
  import { d as debounce_1 } from './debounce-127da66c.js';
6
6
  import { useHistory, useRouteMatch, NavLink } from 'react-router-dom';
7
7
  import { Typography, IconButton } from '@material-ui/core';
8
8
  import { SearchOutlined } from '@material-ui/icons';
9
- import { K as KeywordSearch } from './KeywordSearch-91167d24.js';
10
- import { S as Select } from './Select-7da870e0.js';
11
- import { c as checkLanguageSupport, D as Drawer, d as defaultSupportLanguage } from './Drawer-ec47e780.js';
9
+ import { K as KeywordSearch } from './KeywordSearch-33341dd3.js';
10
+ import { S as Select } from './Select-e550d0a5.js';
11
+ import { c as checkLanguageSupport, D as Drawer, d as defaultSupportLanguage } from './Drawer-b9855a54.js';
12
+ import { getIntl } from './globalConfig';
12
13
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
13
14
  import './isObjectLike-e111475d.js';
14
15
  import './_commonjsHelpers-70de2c37.js';
15
16
  import 'axios';
16
- import './Autocomplete-24e9686d.js';
17
+ import './Autocomplete-5d6f1df8.js';
17
18
  import '@material-ui/lab';
18
- import './createSvgIcon-ff0e3b99.js';
19
+ import './createSvgIcon-e3803ee1.js';
19
20
  import './defaultTheme-ed7746fe.js';
20
21
  import 'react-is';
21
22
  import '@material-ui/styles';
22
23
  import 'react-dom';
23
24
  import './toConsumableArray-dbe8af76.js';
24
- import './Empty-dc5fc2fc.js';
25
+ import './Empty-bf77164f.js';
25
26
 
26
27
  var css_248z = "@charset \"UTF-8\";\n.header {\n display: flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.6);\n background-color: rgba(255, 255, 255, 0.6);\n padding: 12px 36px !important;\n position: fixed;\n top: 0;\n z-index: 10;\n width: 100% !important;\n transition: top 0.3s ease-in-out;\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);\n}\n.header__logo {\n display: flex;\n width: -moz-fit-content !important;\n width: fit-content !important;\n margin-right: 30px !important;\n cursor: pointer;\n}\n.header__logo__img {\n display: flex;\n align-items: center;\n}\n.header__logo__title {\n white-space: nowrap;\n margin-left: 1rem !important;\n font-size: 1.5rem !important;\n font-weight: 700 !important;\n font-family: \"Noto Sans TC\" !important;\n}\n.header__links {\n display: flex;\n justify-content: flex-end;\n padding-right: 14px;\n}\n.header__links a {\n text-decoration: none;\n}\n.header__links--full {\n flex: 1;\n}\n.header__links__item {\n color: rgba(0, 0, 0, 0.85);\n font-size: 1.125rem !important;\n font-weight: 500 !important;\n white-space: nowrap;\n padding: 6px 14px;\n font-family: \"Noto Sans TC\" !important;\n}\n.header__links__item--active .header__links__item {\n font-weight: 800 !important;\n background: transparent;\n border-radius: 45px;\n}\n.header__links__item:hover {\n font-weight: 800 !important;\n}\n.header__language {\n min-width: 100px !important;\n}\n.header__searchIcon {\n display: none !important;\n}\n@media screen and (max-width: 768px) {\n .header--smallUseSearchIcon .header__searchIcon {\n display: flex !important;\n margin-right: 10px !important;\n }\n .header--smallUseSearchIcon .keywordSearch {\n visibility: hidden;\n flex: 1;\n width: 0;\n }\n}\n.header--hide {\n top: -100px;\n}\n.header--focus .header__links {\n display: none;\n}\n.header .MuiTypography-root {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.header .autocomplete {\n float: right;\n}\n.header .autocomplete .MuiAutocomplete-inputRoot[class*=MuiOutlinedInput-root] {\n padding: 1px 8px !important;\n}\n.header .keywordSearch {\n margin-right: 8px;\n}\n.header .keywordSearch--focus .autocomplete {\n width: 100% !important;\n}\n.header .keywordSearch--animation .autocomplete {\n width: 240px;\n transition: width 0.3s ease-in-out;\n}\n\n/* 避免寬度460以下炸版 */\n@media screen and (max-width: 460px) {\n .header .keywordSearch--animation .autocomplete {\n width: 100%;\n }\n}\n@media screen and (max-width: 768px) {\n .header {\n padding: 12px 15px !important;\n }\n .header__logo {\n margin-right: 16px !important;\n }\n .header__logo__title {\n display: none !important;\n }\n .header__links {\n display: none;\n }\n .header__links__item {\n font-size: 1rem !important;\n }\n .header__language {\n display: none !important;\n }\n .header--focus .header__logo {\n display: none !important;\n }\n\n .autocomplete__icon {\n display: none !important;\n }\n}";
27
28
  styleInject(css_248z);
@@ -78,8 +79,19 @@ var Header = function Header(props) {
78
79
  }, className)
79
80
  }, /*#__PURE__*/React__default.createElement("div", {
80
81
  className: "header__logo",
82
+ role: "link",
83
+ tabIndex: 0,
84
+ "aria-label": getIntl().formatMessage({
85
+ id: 'aria.header.logoHome'
86
+ }),
81
87
  onClick: function onClick() {
82
88
  return history.push("/".concat(locale, "/main/home"));
89
+ },
90
+ onKeyDown: function onKeyDown(event) {
91
+ if (event.key === 'Enter') {
92
+ event.preventDefault();
93
+ history.push("/".concat(locale, "/main/home"));
94
+ }
83
95
  }
84
96
  }, logo && /*#__PURE__*/React__default.createElement("div", {
85
97
  className: "header__logo__img"
@@ -121,9 +133,13 @@ var Header = function Header(props) {
121
133
  }, label);
122
134
  })), /*#__PURE__*/React__default.createElement(IconButton, {
123
135
  className: "header__searchIcon",
136
+ "aria-label": getIntl().formatMessage({
137
+ id: 'aria.header.searchOpen'
138
+ }),
124
139
  onClick: onSearchIconClick
125
140
  }, /*#__PURE__*/React__default.createElement(SearchOutlined, {
126
- fontSize: "large"
141
+ fontSize: "large",
142
+ "aria-hidden": "true"
127
143
  })), showDarkModeSwitch , Array.isArray(supportLanguages) && supportLanguages.length > 0 && /*#__PURE__*/React__default.createElement(Select, {
128
144
  className: "header__language",
129
145
  defaultValue: checkLanguageSupport({
@@ -1,6 +1,6 @@
1
- import { a as _slicedToArray } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useState } from 'react';
3
- import { c as classNames } from './index-f491ebce.js';
3
+ import { c as classNames } from './index-b76a85f4.js';
4
4
  import PropTypes from 'prop-types';
5
5
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React__default from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { c as classNames } from './index-f491ebce.js';
3
+ import { c as classNames } from './index-b76a85f4.js';
4
4
  import { OutlinedInput } from '@material-ui/core';
5
5
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
6
6