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

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.
@@ -54,6 +54,9 @@ var ForwardLink = function ForwardLink(_ref) {
54
54
  var newWindowLabel = target === '_blank' && (typeof children === 'string' || title) ? "".concat(typeof children === 'string' ? children : title).concat(getIntl().formatMessage({
55
55
  id: 'aria.newWindow'
56
56
  })) : undefined;
57
+ /* R24:aria-label 已含 title 全文時不再輸出 title 屬性——NVDA 會把 title 屬性當
58
+ description 接在 aria-label 之後再唸一次,造成「書名 ×2」(abo 首頁推薦卡實測) */
59
+ var linkTitle = newWindowLabel ? undefined : domTitle;
57
60
  var linkComponent = /*#__PURE__*/React__default.createElement("div", {
58
61
  className: className
59
62
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -69,7 +72,7 @@ var ForwardLink = function ForwardLink(_ref) {
69
72
  React__default.createElement(Link, {
70
73
  className: classNames('forwardLink__link', linkClassName),
71
74
  target: target,
72
- title: domTitle,
75
+ title: linkTitle,
73
76
  "aria-label": newWindowLabel,
74
77
  to: {
75
78
  pathname: "".concat(locale).concat(pathname),
@@ -1,4 +1,4 @@
1
- export { F as default } from './ForwardLink-83a7eea9.js';
1
+ export { F as default } from './ForwardLink-e86c1080.js';
2
2
  import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
@@ -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';
@@ -2,7 +2,7 @@ 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
4
  import { c as classNames } from './index-b76a85f4.js';
5
- import { F as ForwardLink } from './ForwardLink-83a7eea9.js';
5
+ import { F as ForwardLink } from './ForwardLink-e86c1080.js';
6
6
  import { getIntl } from './globalConfig';
7
7
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
8
8
  import './index-b47819f3.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daoyi/nmtl-ui",
3
- "version": "2.0.1-beta.103",
3
+ "version": "2.0.1-beta.105",
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",