@daoyi/nmtl-ui 2.0.1-beta.101 → 2.0.1-beta.103

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.
@@ -3,7 +3,7 @@ import React__default, { useState, useRef, useEffect } from 'react';
3
3
  import { c as classNames } from './index-b76a85f4.js';
4
4
  import PropTypes from 'prop-types';
5
5
  import { Typography } from '@material-ui/core';
6
- import { M as MoreButton } from './MoreButton-493f7c82.js';
6
+ import { M as MoreButton } from './MoreButton-19055e07.js';
7
7
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
8
8
  import '@material-ui/icons';
9
9
  import './globalConfig';
@@ -76,7 +76,7 @@ var MoreButton = function MoreButton(props) {
76
76
  tabIndex: 0,
77
77
  "aria-expanded": expand,
78
78
  "aria-label": "".concat(messageText).concat(getIntl().formatMessage({
79
- id: 'aria.moreButton.hint'
79
+ id: expand ? 'aria.moreButton.hintCollapse' : 'aria.moreButton.hint'
80
80
  })),
81
81
  style: {
82
82
  color: shadowColor || 'white',
@@ -1,4 +1,4 @@
1
- export { M as default } from './MoreButton-493f7c82.js';
1
+ export { M as default } from './MoreButton-19055e07.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,
@@ -1552,6 +1553,24 @@ var SNA = function SNA(props) {
1552
1553
  id: d.id,
1553
1554
  type: d.type
1554
1555
  }) : null;
1556
+ })
1557
+ /* WCAG 2.1.1/2.4.7 可互動節點支援鍵盤(實測回饋 R11):tabindex 可聚焦
1558
+ (焦點框由各專案全域 :focus-visible 提供)、role=link+aria-label 報讀、Enter 觸發 */.attr('tabindex', function (d) {
1559
+ return d.hasClick ? 0 : null;
1560
+ }).attr('role', function (d) {
1561
+ return d.hasClick ? 'link' : 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;
1565
+ }).on('keydown', function (d) {
1566
+ if (d.hasClick && event && event.key === 'Enter') {
1567
+ event.preventDefault();
1568
+ handleClickNodeGoto({
1569
+ name: d.name,
1570
+ id: d.id,
1571
+ type: d.type
1572
+ });
1573
+ }
1555
1574
  }).call(drag$1(simulation$1));
1556
1575
  node.append('title').text(function (d) {
1557
1576
  return "".concat(d.name, "-").concat(translateType(d.type));
@@ -1646,6 +1665,7 @@ var SNA = function SNA(props) {
1646
1665
  }));
1647
1666
  };
1648
1667
  SNA.defaultProps = {
1668
+ nodeAriaHint: '',
1649
1669
  className: undefined,
1650
1670
  intl: undefined,
1651
1671
  width: 1050,
@@ -1662,6 +1682,8 @@ SNA.defaultProps = {
1662
1682
 
1663
1683
  /* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
1664
1684
  SNA.propTypes = {
1685
+ /** 可互動節點 aria-label 的行為提示後綴(例:,點選後開啟對應頁面(另開新視窗)) */
1686
+ nodeAriaHint: PropTypes.string,
1665
1687
  /** Css Name */
1666
1688
  className: PropTypes.string,
1667
1689
  /** 語言 */
@@ -80,7 +80,8 @@ var zhtw = {
80
80
  "aria.filter.hint": "(篩選條件,選取後過濾下方結果)",
81
81
  "aria.filter.applied": "已套用篩選:{title},結果已更新",
82
82
  "aria.export.download": "(下載檔案)",
83
- "aria.backTop": "回到頁面頂端"
83
+ "aria.backTop": "回到頁面頂端",
84
+ "aria.moreButton.hintCollapse": "(點選後收合、僅顯示部分結果)"
84
85
  };
85
86
 
86
87
  var zhcn = {
@@ -149,7 +150,8 @@ var zhcn = {
149
150
  "aria.filter.hint": "(筛选条件,选取后过滤下方结果)",
150
151
  "aria.filter.applied": "已套用筛选:{title},结果已更新",
151
152
  "aria.export.download": "(下载档案)",
152
- "aria.backTop": "回到页面顶端"
153
+ "aria.backTop": "回到页面顶端",
154
+ "aria.moreButton.hintCollapse": "(点选后收合、仅显示部分结果)"
153
155
  };
154
156
 
155
157
  var enus = {
@@ -218,7 +220,8 @@ var enus = {
218
220
  "aria.filter.hint": " (filter, updates the results below)",
219
221
  "aria.filter.applied": "Filter applied: {title}. Results updated",
220
222
  "aria.export.download": " (downloads a file)",
221
- "aria.backTop": "Back to top"
223
+ "aria.backTop": "Back to top",
224
+ "aria.moreButton.hintCollapse": " (click to collapse results)"
222
225
  };
223
226
 
224
227
  var _languages;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daoyi/nmtl-ui",
3
- "version": "2.0.1-beta.101",
3
+ "version": "2.0.1-beta.103",
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",