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

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.
@@ -5,6 +5,7 @@ import { c as classNames } from './index-b76a85f4.js';
5
5
  import { d as debounce_1 } from './debounce-127da66c.js';
6
6
  import { Fade, NoSsr, Box } from '@material-ui/core';
7
7
  import { r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-e3803ee1.js';
8
+ import { getIntl } from './globalConfig';
8
9
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
9
10
  import './isObjectLike-e111475d.js';
10
11
  import './_commonjsHelpers-70de2c37.js';
@@ -78,9 +79,21 @@ var BackTop = function BackTop(props) {
78
79
  unmountOnExit: true
79
80
  }, /*#__PURE__*/React__default.createElement("div", {
80
81
  className: classNames('backTop', className),
82
+ role: "button",
83
+ tabIndex: 0,
84
+ "aria-label": getIntl().formatMessage({
85
+ id: 'aria.backTop'
86
+ }),
81
87
  onClick: function onClick() {
82
88
  scrollToTop();
83
89
  _onClick();
90
+ },
91
+ onKeyDown: function onKeyDown(event) {
92
+ if (event.key === 'Enter' || event.key === ' ') {
93
+ event.preventDefault();
94
+ scrollToTop();
95
+ _onClick();
96
+ }
84
97
  }
85
98
  }, children ? /*#__PURE__*/React__default.createElement("div", null, children) : /*#__PURE__*/React__default.createElement(NoSsr, null, /*#__PURE__*/React__default.createElement(Box, {
86
99
  className: "backTop__default",
@@ -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';
@@ -1552,6 +1552,23 @@ var SNA = function SNA(props) {
1552
1552
  id: d.id,
1553
1553
  type: d.type
1554
1554
  }) : null;
1555
+ })
1556
+ /* WCAG 2.1.1/2.4.7 可互動節點支援鍵盤(實測回饋 R11):tabindex 可聚焦
1557
+ (焦點框由各專案全域 :focus-visible 提供)、role=link+aria-label 報讀、Enter 觸發 */.attr('tabindex', function (d) {
1558
+ return d.hasClick ? 0 : null;
1559
+ }).attr('role', function (d) {
1560
+ return d.hasClick ? 'link' : null;
1561
+ }).attr('aria-label', function (d) {
1562
+ return d.hasClick ? "".concat(d.name, "-").concat(translateType(d.type)) : null;
1563
+ }).on('keydown', function (d) {
1564
+ if (d.hasClick && event && event.key === 'Enter') {
1565
+ event.preventDefault();
1566
+ handleClickNodeGoto({
1567
+ name: d.name,
1568
+ id: d.id,
1569
+ type: d.type
1570
+ });
1571
+ }
1555
1572
  }).call(drag$1(simulation$1));
1556
1573
  node.append('title').text(function (d) {
1557
1574
  return "".concat(d.name, "-").concat(translateType(d.type));
@@ -79,7 +79,9 @@ var zhtw = {
79
79
  "aria.moreButton.collapsed": "已收合結果",
80
80
  "aria.filter.hint": "(篩選條件,選取後過濾下方結果)",
81
81
  "aria.filter.applied": "已套用篩選:{title},結果已更新",
82
- "aria.export.download": "(下載檔案)"
82
+ "aria.export.download": "(下載檔案)",
83
+ "aria.backTop": "回到頁面頂端",
84
+ "aria.moreButton.hintCollapse": "(點選後收合、僅顯示部分結果)"
83
85
  };
84
86
 
85
87
  var zhcn = {
@@ -147,7 +149,9 @@ var zhcn = {
147
149
  "aria.moreButton.collapsed": "已收合结果",
148
150
  "aria.filter.hint": "(筛选条件,选取后过滤下方结果)",
149
151
  "aria.filter.applied": "已套用筛选:{title},结果已更新",
150
- "aria.export.download": "(下载档案)"
152
+ "aria.export.download": "(下载档案)",
153
+ "aria.backTop": "回到页面顶端",
154
+ "aria.moreButton.hintCollapse": "(点选后收合、仅显示部分结果)"
151
155
  };
152
156
 
153
157
  var enus = {
@@ -215,7 +219,9 @@ var enus = {
215
219
  "aria.moreButton.collapsed": "Results collapsed",
216
220
  "aria.filter.hint": " (filter, updates the results below)",
217
221
  "aria.filter.applied": "Filter applied: {title}. Results updated",
218
- "aria.export.download": " (downloads a file)"
222
+ "aria.export.download": " (downloads a file)",
223
+ "aria.backTop": "Back to top",
224
+ "aria.moreButton.hintCollapse": " (click to collapse results)"
219
225
  };
220
226
 
221
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.100",
3
+ "version": "2.0.1-beta.102",
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",