@daoyi/nmtl-ui 2.0.1-beta.102 → 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.
- package/lib/components/SNA.js +8 -3
- package/package.json +1 -1
package/lib/components/SNA.js
CHANGED
|
@@ -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
|
-
})
|
|
1562
|
-
|
|
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