@daoyi/nmtl-ui 2.0.1-beta.102 → 2.0.1-beta.104

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.
@@ -6,7 +6,7 @@ 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-d378ca7f.js';
9
+ import { K as KeywordSearch } from './KeywordSearch-c0be0348.js';
10
10
  import { S as Select } from './Select-e0790135.js';
11
11
  import { c as checkLanguageSupport, D as Drawer, d as defaultSupportLanguage } from './Drawer-2cbcec04.js';
12
12
  import { getIntl } from './globalConfig';
@@ -25,6 +25,7 @@ var KeywordSearch = function KeywordSearch(_ref) {
25
25
  keyword = _ref.keyword,
26
26
  searchAPI = _ref.searchAPI,
27
27
  placeholder = _ref.placeholder,
28
+ ariaLabel = _ref.ariaLabel,
28
29
  setMenuOpen = _ref.setMenuOpen,
29
30
  menuOpen = _ref.menuOpen,
30
31
  onSearch = _ref.onSearch;
@@ -72,6 +73,7 @@ var KeywordSearch = function KeywordSearch(_ref) {
72
73
  'keywordSearch--focus': menuOpen
73
74
  }, className)
74
75
  }, /*#__PURE__*/React__default.createElement(Autocomplete, {
76
+ ariaLabel: ariaLabel,
75
77
  freeTyping: true,
76
78
  renderAfterDefaultValueChange: true,
77
79
  defaultValue: {
@@ -123,6 +125,7 @@ KeywordSearch.defaultProps = {
123
125
  keyword: undefined,
124
126
  searchAPI: undefined,
125
127
  placeholder: undefined,
128
+ ariaLabel: undefined,
126
129
  menuOpen: false,
127
130
  setMenuOpen: function setMenuOpen() {},
128
131
  onSearch: function onSearch() {}
@@ -140,6 +143,8 @@ KeywordSearch.propTypes = {
140
143
  searchAPI: PropTypes.string,
141
144
  /** 提示字 */
142
145
  placeholder: PropTypes.string,
146
+ /** 輸入框可及名稱(可含輸入後效果提示;未提供時以 placeholder 代替) */
147
+ ariaLabel: PropTypes.string,
143
148
  /** Dropdown是否開啟 */
144
149
  menuOpen: PropTypes.bool,
145
150
  /** 設定Dropdown開啟 */
@@ -1,4 +1,4 @@
1
- export { K as default } from './KeywordSearch-d378ca7f.js';
1
+ export { K as default } from './KeywordSearch-c0be0348.js';
2
2
  import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
@@ -1407,7 +1407,8 @@ var SNA = function SNA(props) {
1407
1407
  distance = props.distance,
1408
1408
  SNAData = props.SNAData,
1409
1409
  handleClickNodeGoto = props.handleClickNodeGoto,
1410
- DownloadExcel = props.DownloadExcel;
1410
+ DownloadExcel = props.DownloadExcel,
1411
+ nodeAriaHint = props.nodeAriaHint;
1411
1412
  // styles
1412
1413
  var width = props.width,
1413
1414
  height = props.height,
@@ -1558,8 +1559,9 @@ var SNA = function SNA(props) {
1558
1559
  return d.hasClick ? 0 : null;
1559
1560
  }).attr('role', function (d) {
1560
1561
  return d.hasClick ? 'link' : null;
1561
- }).attr('aria-label', function (d) {
1562
- return d.hasClick ? "".concat(d.name, "-").concat(translateType(d.type)) : null;
1562
+ })
1563
+ /* 報讀提示點選後行為(實測回饋 R15-29):提示文字由消費端提供(是否另開新視窗依專案 handleClickNodeGoto 而定) */.attr('aria-label', function (d) {
1564
+ return d.hasClick ? "".concat(d.name, "-").concat(translateType(d.type)).concat(nodeAriaHint || '') : null;
1563
1565
  }).on('keydown', function (d) {
1564
1566
  if (d.hasClick && event && event.key === 'Enter') {
1565
1567
  event.preventDefault();
@@ -1663,6 +1665,7 @@ var SNA = function SNA(props) {
1663
1665
  }));
1664
1666
  };
1665
1667
  SNA.defaultProps = {
1668
+ nodeAriaHint: '',
1666
1669
  className: undefined,
1667
1670
  intl: undefined,
1668
1671
  width: 1050,
@@ -1679,6 +1682,8 @@ SNA.defaultProps = {
1679
1682
 
1680
1683
  /* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
1681
1684
  SNA.propTypes = {
1685
+ /** 可互動節點 aria-label 的行為提示後綴(例:,點選後開啟對應頁面(另開新視窗)) */
1686
+ nodeAriaHint: PropTypes.string,
1682
1687
  /** Css Name */
1683
1688
  className: PropTypes.string,
1684
1689
  /** 語言 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daoyi/nmtl-ui",
3
- "version": "2.0.1-beta.102",
3
+ "version": "2.0.1-beta.104",
4
4
  "description": "This project is to be used as a starter kit for building React component using Storybook and Rollup",
5
5
  "author": "daoyi",
6
6
  "main": "lib/index.js",