@daoyi/nmtl-ui 2.0.1-beta.90 → 2.0.1-beta.92

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.
Files changed (60) hide show
  1. package/README.md +45 -45
  2. package/lib/components/{Autocomplete-24e9686d.js → Autocomplete-5d6f1df8.js} +57 -15
  3. package/lib/components/Autocomplete.js +6 -5
  4. package/lib/components/Avatar.js +1 -1
  5. package/lib/components/BackTop.js +3 -3
  6. package/lib/components/BarChart.js +1 -1
  7. package/lib/components/Breadcrumbs.js +1 -1
  8. package/lib/components/{Button-430d39e6.js → Button-305b69a0.js} +1 -1
  9. package/lib/components/Button.js +2 -2
  10. package/lib/components/Carousel.js +2 -61
  11. package/lib/components/Checkbox.js +1 -1
  12. package/lib/components/CollapseContent.js +3 -3
  13. package/lib/components/{ContactModal-523ae294.js → ContactModal-1997d146.js} +94 -22
  14. package/lib/components/ContactModal.js +10 -10
  15. package/lib/components/{Drawer-ec47e780.js → Drawer-b9855a54.js} +10 -3
  16. package/lib/components/Drawer.js +6 -5
  17. package/lib/components/Dropdown.js +2 -2
  18. package/lib/components/{Empty-dc5fc2fc.js → Empty-bf77164f.js} +1 -1
  19. package/lib/components/Empty.js +2 -2
  20. package/lib/components/ExportButton.js +2 -2
  21. package/lib/components/{ExtraTools-0ffc772b.js → ExtraTools-5954ee3a.js} +75 -78
  22. package/lib/components/ExtraTools.js +4 -4
  23. package/lib/components/Filter.js +3 -3
  24. package/lib/components/Footer.js +10 -10
  25. package/lib/components/{ForwardLink-15222b22.js → ForwardLink-aa950a50.js} +17 -8
  26. package/lib/components/ForwardLink.js +4 -3
  27. package/lib/components/Header.js +25 -9
  28. package/lib/components/Image.js +2 -2
  29. package/lib/components/Input.js +1 -1
  30. package/lib/components/InputMethod.js +197 -187
  31. package/lib/components/{KeywordSearch-91167d24.js → KeywordSearch-33341dd3.js} +3 -3
  32. package/lib/components/KeywordSearch.js +7 -6
  33. package/lib/components/KeywordTicker.js +5 -4
  34. package/lib/components/Keywords.js +7 -6
  35. package/lib/components/Loading.js +1 -1
  36. package/lib/components/{Modal-6b8c72d7.js → Modal-5a27951f.js} +12 -4
  37. package/lib/components/Modal.js +5 -4
  38. package/lib/components/{MoreButton-4d5d94da.js → MoreButton-44d3b4fe.js} +1 -1
  39. package/lib/components/MoreButton.js +2 -2
  40. package/lib/components/Pagination.js +3 -3
  41. package/lib/components/Radio.js +1 -1
  42. package/lib/components/SNA.js +4 -4
  43. package/lib/components/{Select-7da870e0.js → Select-e550d0a5.js} +24 -7
  44. package/lib/components/Select.js +4 -4
  45. package/lib/components/{Spin-9a07b106.js → Spin-8dc60bfe.js} +1 -1
  46. package/lib/components/Spin.js +2 -2
  47. package/lib/components/Table.js +1 -1
  48. package/lib/components/{Tooltip-6d53cb6e.js → Tooltip-6ebfa9c1.js} +2 -2
  49. package/lib/components/Tooltip.js +3 -3
  50. package/lib/components/{_rollupPluginBabelHelpers-ed61ffc0.js → _rollupPluginBabelHelpers-a52356f6.js} +24 -42
  51. package/lib/components/globalConfig.js +30 -21
  52. package/lib/components/{index-f491ebce.js → index-b76a85f4.js} +1 -1
  53. package/lib/utils/{_rollupPluginBabelHelpers-a6e0e6e3.js → _rollupPluginBabelHelpers-8dd26e1a.js} +24 -42
  54. package/lib/utils/arrayMerge.js +21 -21
  55. package/lib/utils/exportXlsx.js +1 -1
  56. package/lib/utils/historyAppendSearch.js +1 -1
  57. package/lib/utils/snaPreProcess.js +1 -1
  58. package/package.json +125 -125
  59. /package/lib/components/{createSvgIcon-ff0e3b99.js → createSvgIcon-e3803ee1.js} +0 -0
  60. /package/lib/components/{index-a6f22b92.js → index-b47819f3.js} +0 -0
@@ -1,16 +1,16 @@
1
- import { _ as _extends$1, a as _slicedToArray$2, b as _objectSpread2, e as _defineProperty$1 } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { _ as _extends$1, a as _slicedToArray$2, b as _objectSpread2, e as _defineProperty$1 } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { createContext, forwardRef, createElement, useContext, useRef, useEffect, useReducer, useCallback, useMemo, useLayoutEffect, Component, useState, useImperativeHandle, Fragment } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { h as hoistNonReactStatics_cjs } from './hoist-non-react-statics.cjs-3f408ad2.js';
5
5
  import axios from 'axios';
6
- import { M as Modal } from './Modal-6b8c72d7.js';
6
+ import { M as Modal } from './Modal-5a27951f.js';
7
7
  import { c as commonjsGlobal, a as getDefaultExportFromCjs } from './_commonjsHelpers-70de2c37.js';
8
- import { c as classNames } from './index-f491ebce.js';
8
+ import { c as classNames } from './index-b76a85f4.js';
9
9
  import { Input, Button, Box, Typography, FormControl, RadioGroup, FormControlLabel, Radio, TextField, TextareaAutosize } from '@material-ui/core';
10
- import { S as Select } from './Select-7da870e0.js';
11
- import { s as styleInject } from './style-inject.es-1f59c1d0.js';
12
- import { r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-ff0e3b99.js';
10
+ import { S as Select } from './Select-e550d0a5.js';
13
11
  import { getIntl } from './globalConfig';
12
+ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
13
+ import { r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-e3803ee1.js';
14
14
 
15
15
  var isArray$1 = Array.isArray;
16
16
  var keyList = Object.keys;
@@ -10000,7 +10000,9 @@ const VCode = _ref => {
10000
10000
  visible,
10001
10001
  onChange,
10002
10002
  formatMessage,
10003
- name
10003
+ name,
10004
+ inputId,
10005
+ required
10004
10006
  } = _ref;
10005
10007
  const [codeConfig, setCodeConfig] = useState(getConfig());
10006
10008
  const {
@@ -10020,6 +10022,10 @@ const VCode = _ref => {
10020
10022
  return /*#__PURE__*/React__default.createElement("div", {
10021
10023
  className: "vcode"
10022
10024
  }, /*#__PURE__*/React__default.createElement(Input, {
10025
+ inputProps: {
10026
+ id: inputId,
10027
+ 'aria-required': required || undefined
10028
+ },
10023
10029
  placeholder: formatMessage({
10024
10030
  id: 'common.form.code.check'
10025
10031
  }),
@@ -10027,14 +10033,20 @@ const VCode = _ref => {
10027
10033
  }), /*#__PURE__*/React__default.createElement("div", {
10028
10034
  className: "vcode__box"
10029
10035
  }, /*#__PURE__*/React__default.createElement("div", {
10030
- className: "vcode__image"
10036
+ className: "vcode__image",
10037
+ role: "img",
10038
+ "aria-label": getIntl().formatMessage({
10039
+ id: 'aria.vcode.image'
10040
+ })
10031
10041
  }, /*#__PURE__*/React__default.createElement("canvas", {
10032
10042
  id: "bgi",
10033
10043
  width: "200",
10034
- height: "200"
10044
+ height: "200",
10045
+ "aria-hidden": "true"
10035
10046
  }), data.map((v, i) => /*#__PURE__*/React__default.createElement("div", {
10036
10047
  key: i.toString(),
10037
10048
  className: "vcode__image__itemStr",
10049
+ "aria-hidden": "true",
10038
10050
  style: {
10039
10051
  transform: `rotate(${rotate[i]}deg)`,
10040
10052
  fontSize: `${fz[i]}px`,
@@ -10042,7 +10054,18 @@ const VCode = _ref => {
10042
10054
  }
10043
10055
  }, convert(v))), /*#__PURE__*/React__default.createElement("div", {
10044
10056
  className: "vcode__image__mask",
10045
- onClick: refresh
10057
+ role: "button",
10058
+ tabIndex: 0,
10059
+ "aria-label": getIntl().formatMessage({
10060
+ id: 'aria.vcode.refresh'
10061
+ }),
10062
+ onClick: refresh,
10063
+ onKeyDown: e => {
10064
+ if (e.key === 'Enter' || e.key === ' ') {
10065
+ e.preventDefault();
10066
+ refresh();
10067
+ }
10068
+ }
10046
10069
  }, formatMessage({
10047
10070
  id: 'common.click.refresh'
10048
10071
  }))), /*#__PURE__*/React__default.createElement(ErrorMessage, {
@@ -10056,14 +10079,20 @@ VCode.defaultProps = {
10056
10079
  // placeholder: undefined,
10057
10080
  onChange: () => {},
10058
10081
  formatMessage: () => {},
10059
- name: undefined
10082
+ name: undefined,
10083
+ inputId: undefined,
10084
+ required: false
10060
10085
  };
10061
10086
  VCode.propTypes = {
10062
10087
  visible: PropTypes.bool,
10063
10088
  // placeholder: PropTypes.string,
10064
10089
  onChange: PropTypes.func,
10065
10090
  formatMessage: PropTypes.func,
10066
- name: PropTypes.string
10091
+ name: PropTypes.string,
10092
+ /** 與外部 label 關聯用的 input id(WCAG 3.3.2) */
10093
+ inputId: PropTypes.string,
10094
+ /** 是否必填(aria-required) */
10095
+ required: PropTypes.bool
10067
10096
  };
10068
10097
 
10069
10098
  var facebookLoginWithButton = {exports: {}};
@@ -10090,7 +10119,9 @@ const EmailInput = _ref => {
10090
10119
  value,
10091
10120
  placeholder,
10092
10121
  onChange,
10093
- onNotify
10122
+ onNotify,
10123
+ inputId,
10124
+ required
10094
10125
  } = _ref;
10095
10126
  const [init, setInit] = useState(false); // google login 在init時會先failed
10096
10127
  useMemo(() => () => setTimeout(() => setInit(true), 1000), []); // 故延遲一秒後再給google call(最非最佳解 可優化)
@@ -10139,6 +10170,10 @@ const EmailInput = _ref => {
10139
10170
  className: "emailInput__operator"
10140
10171
  }, /*#__PURE__*/React__default.createElement(Input, {
10141
10172
  value: value,
10173
+ inputProps: {
10174
+ id: inputId,
10175
+ 'aria-required': required || undefined
10176
+ },
10142
10177
  placeholder: placeholder,
10143
10178
  onChange: e => onChange(e.target.value)
10144
10179
  })));
@@ -10147,13 +10182,19 @@ EmailInput.defaultProps = {
10147
10182
  value: undefined,
10148
10183
  placeholder: undefined,
10149
10184
  onChange: () => {},
10150
- onNotify: () => {}
10185
+ onNotify: () => {},
10186
+ inputId: undefined,
10187
+ required: false
10151
10188
  };
10152
10189
  EmailInput.propTypes = {
10153
10190
  value: PropTypes.string,
10154
10191
  placeholder: PropTypes.string,
10155
10192
  onChange: PropTypes.func,
10156
- onNotify: PropTypes.func
10193
+ onNotify: PropTypes.func,
10194
+ /** 與外部 label 關聯用的 input id(WCAG 3.3.2) */
10195
+ inputId: PropTypes.string,
10196
+ /** 是否必填(aria-required) */
10197
+ required: PropTypes.bool
10157
10198
  };
10158
10199
 
10159
10200
  var CloudUpload = {};
@@ -10208,7 +10249,7 @@ function __generator(thisArg, body) {
10208
10249
  function verb(n) { return function (v) { return step([n, v]); }; }
10209
10250
  function step(op) {
10210
10251
  if (f) throw new TypeError("Generator is already executing.");
10211
- while (_) try {
10252
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
10212
10253
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
10213
10254
  if (y = 0, t) op = [op[0] & 2, t.value];
10214
10255
  switch (op[0]) {
@@ -11538,7 +11579,7 @@ Upload.propTypes = {
11538
11579
  onChange: PropTypes.func.isRequired
11539
11580
  };
11540
11581
 
11541
- var css_248z = ".formItem {\n width: 100%;\n margin-bottom: 16px;\n}\n.formItem:last-child {\n margin-bottom: initial;\n}\n.formItem__title {\n display: flex;\n font-size: 16px;\n font-weight: bold;\n}\n.formItem__title__star {\n margin-left: 3px;\n color: #d93333;\n}\n.formItem__operator {\n margin: 2px 0;\n font-size: 14px;\n}\n.formItem__operator__radio__desc {\n margin-left: 35px !important;\n}\n.formItem__operator--unsupport {\n border: 1px solid #d93333;\n background: pink;\n color: black;\n padding: 5px 10px;\n}\n.formItem__error {\n color: #d93333;\n font-weight: bold;\n}\n.formItem textarea {\n border: 1px solid #d9d9d9;\n border-radius: 3px;\n width: 100%;\n background: transparent;\n padding: 6px 10px;\n}\n.formItem ::-webkit-calendar-picker-indicator {\n filter: invert(1);\n}";
11582
+ var css_248z = ".formItem {\n width: 100%;\n margin-bottom: 16px;\n}\n.formItem:last-child {\n margin-bottom: initial;\n}\n.formItem__title {\n display: flex;\n font-size: 16px;\n font-weight: bold;\n}\n.formItem__title__star {\n margin-left: 3px;\n color: #b91c1c;\n}\n.formItem__operator {\n margin: 2px 0;\n font-size: 14px;\n}\n.formItem__operator__radio__desc {\n margin-left: 35px !important;\n}\n.formItem__operator--unsupport {\n border: 1px solid #d93333;\n background: pink;\n color: black;\n padding: 5px 10px;\n}\n.formItem__error {\n color: #b91c1c;\n font-weight: bold;\n}\n.formItem textarea {\n border: 1px solid #d9d9d9;\n border-radius: 3px;\n width: 100%;\n background: transparent;\n padding: 6px 10px;\n}\n.formItem ::-webkit-calendar-picker-indicator {\n filter: invert(1);\n}";
11542
11583
  styleInject(css_248z);
11543
11584
 
11544
11585
  const FormItem = _ref => {
@@ -11558,22 +11599,35 @@ const FormItem = _ref => {
11558
11599
  const currentPlaceholder = placeholder || `${formatMessage({
11559
11600
  id: 'common.enter'
11560
11601
  })} ${label}`;
11602
+ /* WCAG 1.3.1/3.3.2 欄位與標題的程式化關聯(WAVE: Missing form label) */
11603
+ const inputId = `form-input-${name}`;
11604
+ const labelId = `form-label-${name}`;
11605
+ const a11yInputProps = {
11606
+ id: inputId,
11607
+ 'aria-required': required || undefined
11608
+ };
11609
+ /* 這些欄位型別會渲染帶 inputId 的 input,標題才能用 label htmlFor;其餘型別改以 aria-labelledby 關聯 */
11610
+ const hasInputId = ['input', 'textarea', 'datePicker', 'email', 'vcode'].includes(type);
11561
11611
  const render = field => {
11562
11612
  let component;
11563
11613
  switch (type) {
11564
11614
  case 'input':
11565
11615
  component = /*#__PURE__*/React__default.createElement(Input, _extends$1({}, field, {
11616
+ inputProps: a11yInputProps,
11566
11617
  placeholder: currentPlaceholder
11567
11618
  }));
11568
11619
  break;
11569
11620
  case 'textarea':
11570
11621
  component = /*#__PURE__*/React__default.createElement(TextareaAutosize, _extends$1({}, field, {
11622
+ id: inputId,
11623
+ "aria-required": required || undefined,
11571
11624
  minRows: 3,
11572
11625
  placeholder: currentPlaceholder
11573
11626
  }));
11574
11627
  break;
11575
11628
  case 'select':
11576
11629
  component = /*#__PURE__*/React__default.createElement(Select, _extends$1({}, field, {
11630
+ ariaLabelledby: labelId,
11577
11631
  options: options,
11578
11632
  placeholder: currentPlaceholder,
11579
11633
  onChange: age => setFieldValue(field.name, age)
@@ -11581,12 +11635,15 @@ const FormItem = _ref => {
11581
11635
  break;
11582
11636
  case 'datePicker':
11583
11637
  component = /*#__PURE__*/React__default.createElement(TextField, _extends$1({}, field, {
11638
+ inputProps: a11yInputProps,
11584
11639
  type: "date",
11585
11640
  onChange: event => setFieldValue(field.name, event.target.value)
11586
11641
  }));
11587
11642
  break;
11588
11643
  case 'email':
11589
11644
  component = /*#__PURE__*/React__default.createElement(EmailInput, _extends$1({}, field, {
11645
+ inputId: inputId,
11646
+ required: required,
11590
11647
  placeholder: currentPlaceholder,
11591
11648
  onChange: email => setFieldValue(field.name, email),
11592
11649
  onNotify: onNotify
@@ -11594,7 +11651,8 @@ const FormItem = _ref => {
11594
11651
  break;
11595
11652
  case 'radio':
11596
11653
  component = /*#__PURE__*/React__default.createElement(FormControl, {
11597
- component: "fieldset"
11654
+ component: "fieldset",
11655
+ "aria-labelledby": labelId
11598
11656
  }, /*#__PURE__*/React__default.createElement(RadioGroup, field, options.map(option => /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(FormControlLabel, {
11599
11657
  key: option.value,
11600
11658
  value: option.value,
@@ -11612,6 +11670,8 @@ const FormItem = _ref => {
11612
11670
  break;
11613
11671
  case 'vcode':
11614
11672
  component = /*#__PURE__*/React__default.createElement(VCode, {
11673
+ inputId: inputId,
11674
+ required: required,
11615
11675
  placeholder: currentPlaceholder,
11616
11676
  onChange: pass => setFieldValue(field.name, pass),
11617
11677
  formatMessage: formatMessage,
@@ -11633,11 +11693,23 @@ const FormItem = _ref => {
11633
11693
  return /*#__PURE__*/React__default.createElement("div", {
11634
11694
  id: `form-${name}`,
11635
11695
  className: "formItem"
11636
- }, label && /*#__PURE__*/React__default.createElement("div", {
11637
- className: "formItem__title"
11696
+ }, label && (hasInputId ?
11697
+ /*#__PURE__*/
11698
+ // eslint-disable-next-line jsx-a11y/label-has-for, jsx-a11y/label-has-associated-control
11699
+ React__default.createElement("label", {
11700
+ className: "formItem__title",
11701
+ id: labelId,
11702
+ htmlFor: inputId
11703
+ }, label, required && /*#__PURE__*/React__default.createElement("div", {
11704
+ className: "formItem__title__star",
11705
+ "aria-hidden": "true"
11706
+ }, '*')) : /*#__PURE__*/React__default.createElement("div", {
11707
+ className: "formItem__title",
11708
+ id: labelId
11638
11709
  }, label, required && /*#__PURE__*/React__default.createElement("div", {
11639
- className: "formItem__title__star"
11640
- }, "*")), hint && /*#__PURE__*/React__default.createElement(Box, {
11710
+ className: "formItem__title__star",
11711
+ "aria-hidden": "true"
11712
+ }, '*'))), hint && /*#__PURE__*/React__default.createElement(Box, {
11641
11713
  my: 1
11642
11714
  }, /*#__PURE__*/React__default.createElement(Typography, {
11643
11715
  variant: "body2"
@@ -1,22 +1,22 @@
1
- export { C as default } from './ContactModal-523ae294.js';
2
- import './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ export { C as default } from './ContactModal-1997d146.js';
2
+ import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
5
5
  import './hoist-non-react-statics.cjs-3f408ad2.js';
6
6
  import 'react-is';
7
7
  import 'axios';
8
- import './Modal-6b8c72d7.js';
9
- import './index-f491ebce.js';
8
+ import './Modal-5a27951f.js';
9
+ import './index-b76a85f4.js';
10
10
  import '@material-ui/core';
11
11
  import '@material-ui/icons';
12
- import './Button-430d39e6.js';
12
+ import './Button-305b69a0.js';
13
13
  import './style-inject.es-1f59c1d0.js';
14
- import './Spin-9a07b106.js';
14
+ import './Spin-8dc60bfe.js';
15
+ import './globalConfig';
15
16
  import './_commonjsHelpers-70de2c37.js';
16
- import './Select-7da870e0.js';
17
- import './Empty-dc5fc2fc.js';
18
- import './createSvgIcon-ff0e3b99.js';
17
+ import './Select-e550d0a5.js';
18
+ import './Empty-bf77164f.js';
19
+ import './createSvgIcon-e3803ee1.js';
19
20
  import './defaultTheme-ed7746fe.js';
20
21
  import '@material-ui/styles';
21
22
  import 'react-dom';
22
- import './globalConfig';
@@ -1,10 +1,11 @@
1
- import { a as _slicedToArray } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { List, ListItem, ListItemIcon, ListItemText, IconButton, Drawer as Drawer$1, Divider } from '@material-ui/core';
5
5
  import { DehazeRounded } from '@material-ui/icons';
6
- import { S as Select } from './Select-7da870e0.js';
6
+ import { S as Select } from './Select-e550d0a5.js';
7
7
  import { useHistory, useRouteMatch } from 'react-router-dom';
8
+ import { getIntl } from './globalConfig';
8
9
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
9
10
 
10
11
  var defaultSupportLanguage = [
@@ -90,11 +91,17 @@ var Drawer = function Drawer(_ref) {
90
91
  className: "drawer"
91
92
  }, /*#__PURE__*/React__default.createElement(IconButton, {
92
93
  className: "drawer__icon",
94
+ "aria-label": getIntl().formatMessage({
95
+ id: 'aria.header.menuOpen'
96
+ }),
97
+ "aria-haspopup": "menu",
98
+ "aria-expanded": open,
93
99
  onClick: function onClick() {
94
100
  return setOpen(true);
95
101
  }
96
102
  }, /*#__PURE__*/React__default.createElement(DehazeRounded, {
97
- fontSize: "large"
103
+ fontSize: "large",
104
+ "aria-hidden": "true"
98
105
  })), /*#__PURE__*/React__default.createElement(Drawer$1, {
99
106
  anchor: "right",
100
107
  open: open,
@@ -1,11 +1,12 @@
1
- export { D as default } from './Drawer-ec47e780.js';
2
- import './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ export { D as default } from './Drawer-b9855a54.js';
2
+ import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
5
5
  import '@material-ui/core';
6
6
  import '@material-ui/icons';
7
- import './Select-7da870e0.js';
8
- import './index-f491ebce.js';
9
- import './Empty-dc5fc2fc.js';
7
+ import './Select-e550d0a5.js';
8
+ import './index-b76a85f4.js';
9
+ import './Empty-bf77164f.js';
10
10
  import './style-inject.es-1f59c1d0.js';
11
11
  import 'react-router-dom';
12
+ import './globalConfig';
@@ -1,6 +1,6 @@
1
- import { a as _slicedToArray } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useRef, useState } from 'react';
3
- import { c as classNames } from './index-f491ebce.js';
3
+ import { c as classNames } from './index-b76a85f4.js';
4
4
  import PropTypes from 'prop-types';
5
5
  import { Button, Menu, Divider, MenuItem, ListItemIcon, ListItemText } from '@material-ui/core';
6
6
  import { makeStyles } from '@material-ui/styles';
@@ -1,6 +1,6 @@
1
1
  import React__default from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { c as classNames } from './index-f491ebce.js';
3
+ import { c as classNames } from './index-b76a85f4.js';
4
4
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
5
5
 
6
6
  var img = "data:image/svg+xml,%3csvg class='ant-empty-img-default' width='184' height='152' viewBox='0 0 184 152' xmlns='http://www.w3.org/2000/svg'%3e %3cg fill='none' fill-rule='evenodd'%3e %3cg transform='translate(24 31.67)'%3e %3cellipse fill='%23f5f5f5' fill-opacity='0.8' cx='67.797' cy='106.89' rx='67.797' ry='12.668'%3e%3c/ellipse%3e %3cpath fill='%23aeb8c2' d='M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z'%3e%3c/path%3e %3cpath fill='url(%23linearGradient-1)' d='M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z' transform='translate(13.56)'%3e%3c/path%3e %3cpath fill='%23f5f5f7' d='M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z'%3e%3c/path%3e %3cpath fill='%23dce0e6' d='M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z'%3e%3c/path%3e %3c/g%3e %3cpath fill='%23dce0e6' d='M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z'%3e%3c/path%3e %3cg fill='white' transform='translate(149.65 15.383)'%3e %3cellipse cx='20.654' cy='3.167' rx='2.849' ry='2.815'%3e%3c/ellipse%3e %3cpath d='M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z'%3e%3c/path%3e %3c/g%3e %3c/g%3e%3c/svg%3e";
@@ -1,5 +1,5 @@
1
- export { E as default } from './Empty-dc5fc2fc.js';
1
+ export { E as default } from './Empty-bf77164f.js';
2
2
  import 'react';
3
3
  import 'prop-types';
4
- import './index-f491ebce.js';
4
+ import './index-b76a85f4.js';
5
5
  import './style-inject.es-1f59c1d0.js';
@@ -1,7 +1,7 @@
1
- import { a as _slicedToArray } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { c as classNames } from './index-f491ebce.js';
4
+ import { c as classNames } from './index-b76a85f4.js';
5
5
  import { ExitToApp } from '@material-ui/icons';
6
6
  import { Dialog, DialogContent, DialogContentText, DialogActions, Button } from '@material-ui/core';
7
7
  import { f as fileDownload, j as jsonTxt, a as jsonExcel } from './dataExport-d55d6fa3.js';
@@ -1,11 +1,11 @@
1
- import { _ as _extends } from './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ import { _ as _extends } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import * as React from 'react';
3
3
  import React__default, { Component, forwardRef, useState } from 'react';
4
- import { c as classNames } from './index-f491ebce.js';
4
+ import { c as classNames } from './index-b76a85f4.js';
5
5
  import PropTypes from 'prop-types';
6
6
  import { a as getDefaultExportFromCjs } from './_commonjsHelpers-70de2c37.js';
7
7
  import { Menu, MenuItem, useMediaQuery, IconButton } from '@material-ui/core';
8
- import { T as Tooltip } from './Tooltip-6d53cb6e.js';
8
+ import { T as Tooltip } from './Tooltip-6ebfa9c1.js';
9
9
  import { s as snaToExcel, f as fileDownload$1, a as jsonExcel } from './dataExport-d55d6fa3.js';
10
10
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
11
11
 
@@ -66,67 +66,6 @@ function objectToGetParams(object) {
66
66
  return params.length > 0 ? "?" + params.join('&') : '';
67
67
  }
68
68
 
69
- var classnames = {exports: {}};
70
-
71
- /*!
72
- Copyright (c) 2018 Jed Watson.
73
- Licensed under the MIT License (MIT), see
74
- http://jedwatson.github.io/classnames
75
- */
76
-
77
- (function (module) {
78
- /* global define */
79
-
80
- (function () {
81
-
82
- var hasOwn = {}.hasOwnProperty;
83
-
84
- function classNames() {
85
- var classes = [];
86
-
87
- for (var i = 0; i < arguments.length; i++) {
88
- var arg = arguments[i];
89
- if (!arg) continue;
90
-
91
- var argType = typeof arg;
92
-
93
- if (argType === 'string' || argType === 'number') {
94
- classes.push(arg);
95
- } else if (Array.isArray(arg)) {
96
- if (arg.length) {
97
- var inner = classNames.apply(null, arg);
98
- if (inner) {
99
- classes.push(inner);
100
- }
101
- }
102
- } else if (argType === 'object') {
103
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
104
- classes.push(arg.toString());
105
- continue;
106
- }
107
-
108
- for (var key in arg) {
109
- if (hasOwn.call(arg, key) && arg[key]) {
110
- classes.push(key);
111
- }
112
- }
113
- }
114
- }
115
-
116
- return classes.join(' ');
117
- }
118
-
119
- if (module.exports) {
120
- classNames.default = classNames;
121
- module.exports = classNames;
122
- } else {
123
- window.classNames = classNames;
124
- }
125
- }());
126
- } (classnames));
127
-
128
- var cx = classnames.exports;
129
-
130
69
  var __extends$2 = (undefined && undefined.__extends) || (function () {
131
70
  var extendStatics = function (d, b) {
132
71
  extendStatics = Object.setPrototypeOf ||
@@ -277,7 +216,7 @@ var ShareButton$1 = /** @class */ (function (_super) {
277
216
  }
278
217
  ShareButton.prototype.render = function () {
279
218
  var _a = this.props; _a.beforeOnClick; var children = _a.children, className = _a.className, disabled = _a.disabled, disabledStyle = _a.disabledStyle, forwardedRef = _a.forwardedRef; _a.networkLink; var networkName = _a.networkName; _a.onShareWindowClose; _a.openShareDialogOnClick; _a.opts; var resetButtonStyle = _a.resetButtonStyle, style = _a.style; _a.url; _a.windowHeight; _a.windowPosition; _a.windowWidth; var rest = __rest$1(_a, ["beforeOnClick", "children", "className", "disabled", "disabledStyle", "forwardedRef", "networkLink", "networkName", "onShareWindowClose", "openShareDialogOnClick", "opts", "resetButtonStyle", "style", "url", "windowHeight", "windowPosition", "windowWidth"]);
280
- var newClassName = cx('react-share__ShareButton', {
219
+ var newClassName = classNames('react-share__ShareButton', {
281
220
  'react-share__ShareButton--disabled': !!disabled,
282
221
  disabled: !!disabled,
283
222
  }, className);
@@ -1131,7 +1070,7 @@ var SocialMediaShareCount = /** @class */ (function (_super) {
1131
1070
  SocialMediaShareCount.prototype.render = function () {
1132
1071
  var _a = this.state, count = _a.count, isLoading = _a.isLoading;
1133
1072
  var _b = this.props, _c = _b.children, children = _c === void 0 ? defaultChildren : _c, className = _b.className; _b.getCount; var rest = __rest(_b, ["children", "className", "getCount"]);
1134
- return (React__default.createElement("span", __assign({ className: cx('react-share__ShareCount', className) }, rest), !isLoading && count !== undefined && children(count)));
1073
+ return (React__default.createElement("span", __assign({ className: classNames('react-share__ShareCount', className) }, rest), !isLoading && count !== undefined && children(count)));
1135
1074
  };
1136
1075
  return SocialMediaShareCount;
1137
1076
  }(Component));
@@ -3208,6 +3147,16 @@ var css_248z = ".extraTools {\n width: 100%;\n display: inline-flex;\n justif
3208
3147
  styleInject(css_248z);
3209
3148
 
3210
3149
  /* eslint-disable prefer-destructuring */
3150
+
3151
+ /* 視覺隱藏文字(供按鈕內容作為可及名稱, WCAG 4.1.2) */
3152
+ const hiddenTextStyle = {
3153
+ position: 'absolute',
3154
+ width: 1,
3155
+ height: 1,
3156
+ overflow: 'hidden',
3157
+ clip: 'rect(1px, 1px, 1px, 1px)',
3158
+ whiteSpace: 'nowrap'
3159
+ };
3211
3160
  const ShareButton = _ref => {
3212
3161
  let {
3213
3162
  className
@@ -3215,11 +3164,15 @@ const ShareButton = _ref => {
3215
3164
  return /*#__PURE__*/React__default.createElement("div", {
3216
3165
  className: classNames('extraTools__share', className)
3217
3166
  }, /*#__PURE__*/React__default.createElement(FacebookShareButton, {
3218
- url: document.location.href
3167
+ url: document.location.href,
3168
+ "aria-label": "\u5206\u4EAB\u81F3 Facebook"
3219
3169
  }, /*#__PURE__*/React__default.createElement(FacebookIcon, {
3220
3170
  size: 32,
3221
- round: true
3222
- })));
3171
+ round: true,
3172
+ "aria-hidden": "true"
3173
+ }), /*#__PURE__*/React__default.createElement("span", {
3174
+ style: hiddenTextStyle
3175
+ }, "\u5206\u4EAB\u81F3 Facebook")));
3223
3176
  };
3224
3177
  ShareButton.defaultProps = {
3225
3178
  className: undefined
@@ -3281,9 +3234,23 @@ const DownloadMenu = _ref2 => {
3281
3234
  placement: "bottom"
3282
3235
  }, /*#__PURE__*/React__default.createElement("div", {
3283
3236
  className: "extraTools__download-icon",
3284
- onClick: e => setAnchorEl(e.currentTarget)
3237
+ role: "button",
3238
+ tabIndex: 0,
3239
+ "aria-label": intl ? intl.formatMessage({
3240
+ id: 'knowledge.writersAndWorksSNA.download'
3241
+ }) : '下載',
3242
+ "aria-haspopup": "menu",
3243
+ "aria-expanded": Boolean(anchorEl),
3244
+ onClick: e => setAnchorEl(e.currentTarget),
3245
+ onKeyDown: e => {
3246
+ if (e.key === 'Enter' || e.key === ' ') {
3247
+ e.preventDefault();
3248
+ setAnchorEl(e.currentTarget);
3249
+ }
3250
+ }
3285
3251
  }, /*#__PURE__*/React__default.createElement(DownloadImg, {
3286
- fill: iconColor
3252
+ fill: iconColor,
3253
+ "aria-hidden": "true"
3287
3254
  }))), /*#__PURE__*/React__default.createElement(Menu, {
3288
3255
  id: "download-menu",
3289
3256
  anchorEl: anchorEl,
@@ -3350,11 +3317,23 @@ const FullscreenBtn = _ref4 => {
3350
3317
  placement: "bottom"
3351
3318
  }, /*#__PURE__*/React__default.createElement("div", {
3352
3319
  className: "extraTools__fullscreenBtn-icon",
3320
+ role: "button",
3321
+ tabIndex: 0,
3322
+ "aria-label": intl ? intl.formatMessage({
3323
+ id: 'knowledge.writersAndWorksSNA.fullscreen'
3324
+ }) : '全螢幕模式',
3353
3325
  onClick: () => {
3354
3326
  if (screenfull.isEnabled && fullscreenDomId) screenfull.request(document.getElementById(fullscreenDomId));
3327
+ },
3328
+ onKeyDown: e => {
3329
+ if (e.key === 'Enter' || e.key === ' ') {
3330
+ e.preventDefault();
3331
+ if (screenfull.isEnabled && fullscreenDomId) screenfull.request(document.getElementById(fullscreenDomId));
3332
+ }
3355
3333
  }
3356
3334
  }, /*#__PURE__*/React__default.createElement(SVGComponent, {
3357
- fill: iconColor
3335
+ fill: iconColor,
3336
+ "aria-hidden": "true"
3358
3337
  }))));
3359
3338
  };
3360
3339
  FullscreenBtn.defaultProps = {
@@ -3389,22 +3368,35 @@ const FontSizeChanger = _ref5 => {
3389
3368
  targets: FontSizeTargets,
3390
3369
  options: FontSizeOptions,
3391
3370
  customButtons: {
3371
+ /* 外層按鈕由 react-font-size-changer 渲染,以 role="img" + aria-label 提供按鈕可及名稱(WCAG 4.1.2) */
3392
3372
  up: /*#__PURE__*/React__default.createElement(Tooltip, {
3393
3373
  title: intl ? intl.formatMessage({
3394
3374
  id: 'knowledge.writersAndWorksSNA.big'
3395
3375
  }) : '字級放大',
3396
3376
  placement: "bottom"
3377
+ }, /*#__PURE__*/React__default.createElement("span", {
3378
+ role: "img",
3379
+ "aria-label": intl ? intl.formatMessage({
3380
+ id: 'knowledge.writersAndWorksSNA.big'
3381
+ }) : '字級放大'
3397
3382
  }, /*#__PURE__*/React__default.createElement(SVGComponent$2, {
3398
- fill: iconColor
3399
- })),
3383
+ fill: iconColor,
3384
+ "aria-hidden": "true"
3385
+ }))),
3400
3386
  down: /*#__PURE__*/React__default.createElement(Tooltip, {
3401
3387
  title: intl ? intl.formatMessage({
3402
3388
  id: 'knowledge.writersAndWorksSNA.small'
3403
3389
  }) : '字級縮小',
3404
3390
  placement: "bottom"
3391
+ }, /*#__PURE__*/React__default.createElement("span", {
3392
+ role: "img",
3393
+ "aria-label": intl ? intl.formatMessage({
3394
+ id: 'knowledge.writersAndWorksSNA.small'
3395
+ }) : '字級縮小'
3405
3396
  }, /*#__PURE__*/React__default.createElement(SVGComponent$1, {
3406
- fill: iconColor
3407
- })),
3397
+ fill: iconColor,
3398
+ "aria-hidden": "true"
3399
+ }))),
3408
3400
  style: {
3409
3401
  border: 'none'
3410
3402
  },
@@ -3454,14 +3446,19 @@ const SNAResetBtn = _ref6 => {
3454
3446
  }) : '回到原來位置與大小',
3455
3447
  placement: "bottom"
3456
3448
  }, /*#__PURE__*/React__default.createElement(IconButton, {
3449
+ "aria-label": intl ? intl.formatMessage({
3450
+ id: 'common.sna.reset'
3451
+ }) : '回到原來位置與大小',
3457
3452
  onClick: () => renderSNA(),
3458
3453
  style: {
3459
3454
  padding: '0px'
3460
3455
  }
3461
3456
  }, isMobile ? /*#__PURE__*/React__default.createElement(ResetMobileIcon, {
3462
- fill: iconColor
3457
+ fill: iconColor,
3458
+ "aria-hidden": "true"
3463
3459
  }) : /*#__PURE__*/React__default.createElement(ResetIcon, {
3464
- fill: iconColor
3460
+ fill: iconColor,
3461
+ "aria-hidden": "true"
3465
3462
  })))));
3466
3463
  };
3467
3464
  SNAResetBtn.defaultProps = {
@@ -1,10 +1,10 @@
1
- export { E as default } from './ExtraTools-0ffc772b.js';
2
- import './_rollupPluginBabelHelpers-ed61ffc0.js';
1
+ export { E as default } from './ExtraTools-5954ee3a.js';
2
+ import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
- import './index-f491ebce.js';
4
+ import './index-b76a85f4.js';
5
5
  import 'prop-types';
6
6
  import './_commonjsHelpers-70de2c37.js';
7
7
  import '@material-ui/core';
8
- import './Tooltip-6d53cb6e.js';
8
+ import './Tooltip-6ebfa9c1.js';
9
9
  import './style-inject.es-1f59c1d0.js';
10
10
  import './dataExport-d55d6fa3.js';