@daoyi/nmtl-ui 2.0.1-beta.130 → 2.0.1-beta.133
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/{Autocomplete-3b418e5f.js → Autocomplete-0ea4a31c.js} +3 -3
- package/lib/components/Autocomplete.js +4 -4
- package/lib/components/BackTop.js +2 -2
- package/lib/components/{ContactModal-7e5b14e8.js → ContactModal-159de99c.js} +298 -204
- package/lib/components/ContactModal.js +7 -7
- package/lib/components/Drawer-a5be9257.js +245 -0
- package/lib/components/Drawer.js +6 -5
- package/lib/components/Footer.js +7 -7
- package/lib/components/Header.js +17 -12
- package/lib/components/{KeywordSearch-fec33a2c.js → KeywordSearch-db9c45d9.js} +1 -1
- package/lib/components/KeywordSearch.js +5 -5
- package/lib/components/Keywords.js +2 -2
- package/lib/components/MUITheme.js +2 -2
- package/lib/components/Pagination.js +5 -5
- package/lib/components/SegmentedControl-81f63afc.js +113 -0
- package/lib/components/SegmentedControl.js +11 -0
- package/lib/components/{Select-cb3e1ba1.js → Select-89841c71.js} +3 -3
- package/lib/components/Select.js +4 -4
- package/lib/components/{createSvgIcon-e3803ee1.js → createSvgIcon-dc603596.js} +1 -1
- package/lib/components/{defaultTheme-ed7746fe.js → defaultTheme-c5dd0f64.js} +1 -1
- package/lib/components/globalConfig.js +12 -0
- package/lib/components/{toConsumableArray-dbe8af76.js → toConsumableArray-c268c112.js} +1 -1
- package/lib/components/{useTheme-d16d02d9.js → useTheme-98b6cf17.js} +1 -1
- package/lib/components/{withTheme-2d778133.js → withTheme-3486f38b.js} +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +7 -1
- package/lib/components/Drawer-629e59c7.js +0 -176
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
export { C as default } from './ContactModal-
|
|
1
|
+
export { C as default } from './ContactModal-159de99c.js';
|
|
2
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
|
+
import './defaultTheme-c5dd0f64.js';
|
|
8
|
+
import '@material-ui/styles';
|
|
9
|
+
import './useTheme-98b6cf17.js';
|
|
10
|
+
import './withTheme-3486f38b.js';
|
|
7
11
|
import 'axios';
|
|
8
12
|
import './Modal-e04532fa.js';
|
|
9
13
|
import './index-b76a85f4.js';
|
|
@@ -14,11 +18,7 @@ import './style-inject.es-1f59c1d0.js';
|
|
|
14
18
|
import './Spin-8f87eadc.js';
|
|
15
19
|
import './globalConfig';
|
|
16
20
|
import './_commonjsHelpers-70de2c37.js';
|
|
17
|
-
import './
|
|
18
|
-
import '@material-ui/styles';
|
|
19
|
-
import './useTheme-d16d02d9.js';
|
|
20
|
-
import './withTheme-2d778133.js';
|
|
21
|
-
import './Select-cb3e1ba1.js';
|
|
21
|
+
import './Select-89841c71.js';
|
|
22
22
|
import './Empty-c6a44967.js';
|
|
23
|
-
import './createSvgIcon-
|
|
23
|
+
import './createSvgIcon-dc603596.js';
|
|
24
24
|
import 'react-dom';
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { _ as _extends, a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
|
|
2
|
+
import React__default, { useState } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { List, ListItem, ListItemIcon, ListItemText, IconButton, Drawer as Drawer$1, Divider } from '@material-ui/core';
|
|
5
|
+
import { DehazeRounded, CloseRounded } from '@material-ui/icons';
|
|
6
|
+
import { S as Select } from './Select-89841c71.js';
|
|
7
|
+
import { S as SegmentedControl } from './SegmentedControl-81f63afc.js';
|
|
8
|
+
import { useRouteMatch, NavLink } from 'react-router-dom';
|
|
9
|
+
import { getIntl } from './globalConfig';
|
|
10
|
+
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
11
|
+
|
|
12
|
+
var defaultSupportLanguage = [
|
|
13
|
+
// { value: 'en', label: 'English' },
|
|
14
|
+
{
|
|
15
|
+
value: 'zh-tw',
|
|
16
|
+
label: '繁體中文'
|
|
17
|
+
}
|
|
18
|
+
// { value: 'zh-cn', label: '簡體中文' },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
/* [檢查-語系]本系統是否支援該語系 並回傳語系 */
|
|
22
|
+
var checkLanguageSupport = function checkLanguageSupport(_ref) {
|
|
23
|
+
var language = _ref.language,
|
|
24
|
+
supportLanguages = _ref.supportLanguages;
|
|
25
|
+
var isSupport = supportLanguages.some(function (_ref2) {
|
|
26
|
+
var value = _ref2.value;
|
|
27
|
+
return value === language;
|
|
28
|
+
});
|
|
29
|
+
return isSupport ? language : supportLanguages[0].value;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/* 抽屜內的主選單:與桌機頁首一致用真連結(可長按另開、讀屏唸「連結」)。
|
|
33
|
+
* 保留 MUI List/ListItem/ListItemText 結構:各站以主題或 app.scss 覆蓋了這些 class
|
|
34
|
+
* (ada 的 MuiList 深底白字、tahl 的 hover 色),換成自訂標記會讓那些樣式失效。
|
|
35
|
+
* - ListItem 以 NavLink 渲染成 <a href>;目前所在頁由 NavLink 自動加 aria-current="page",
|
|
36
|
+
* 並掛上 Mui-selected(沿用各站既有的選中底色)與 drawer__link--active(左側色條+粗體)
|
|
37
|
+
* - ButtonBase 對非 <button> 元件會補 role="button",須明確清掉,否則讀屏仍唸成按鈕 */
|
|
38
|
+
const DrawerList = _ref => {
|
|
39
|
+
let {
|
|
40
|
+
drawerList,
|
|
41
|
+
setOpen
|
|
42
|
+
} = _ref;
|
|
43
|
+
const {
|
|
44
|
+
url
|
|
45
|
+
} = useRouteMatch();
|
|
46
|
+
return /*#__PURE__*/React__default.createElement("nav", null, /*#__PURE__*/React__default.createElement(List, {
|
|
47
|
+
className: "drawer__list"
|
|
48
|
+
}, Array.isArray(drawerList) && drawerList.map((_ref2, index) => {
|
|
49
|
+
let {
|
|
50
|
+
name,
|
|
51
|
+
icon,
|
|
52
|
+
path = ''
|
|
53
|
+
} = _ref2;
|
|
54
|
+
const internalProps = {
|
|
55
|
+
component: NavLink,
|
|
56
|
+
to: `${url}${path}`,
|
|
57
|
+
activeClassName: 'Mui-selected drawer__link--active'
|
|
58
|
+
};
|
|
59
|
+
/* 外部連結比照桌機頁首另開新視窗,並預先提示(WCAG 3.2.2) */
|
|
60
|
+
const externalProps = {
|
|
61
|
+
component: 'a',
|
|
62
|
+
href: path,
|
|
63
|
+
target: '_blank',
|
|
64
|
+
rel: 'noopener noreferrer',
|
|
65
|
+
'aria-label': `${name}${getIntl().formatMessage({
|
|
66
|
+
id: 'aria.newWindow'
|
|
67
|
+
})}`
|
|
68
|
+
};
|
|
69
|
+
const linkProps = path.indexOf('http') > -1 ? externalProps : internalProps;
|
|
70
|
+
return /*#__PURE__*/React__default.createElement("li", {
|
|
71
|
+
key: index.toString()
|
|
72
|
+
}, /*#__PURE__*/React__default.createElement(ListItem, _extends({
|
|
73
|
+
button: true,
|
|
74
|
+
className: "drawer__link",
|
|
75
|
+
role: undefined,
|
|
76
|
+
onClick: () => setOpen(false)
|
|
77
|
+
}, linkProps), icon && /*#__PURE__*/React__default.createElement(ListItemIcon, {
|
|
78
|
+
style: {
|
|
79
|
+
marginRight: 24
|
|
80
|
+
}
|
|
81
|
+
}, icon), /*#__PURE__*/React__default.createElement(ListItemText, {
|
|
82
|
+
primary: name
|
|
83
|
+
})));
|
|
84
|
+
})));
|
|
85
|
+
};
|
|
86
|
+
DrawerList.defaultProps = {};
|
|
87
|
+
DrawerList.propTypes = {
|
|
88
|
+
drawerList: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
89
|
+
setOpen: PropTypes.func.isRequired
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
var css_248z = "@charset \"UTF-8\";\n/* 抽屜內容統一靠左對齊在同一條線上(選單文字、工具區標籤都從 1.5rem 起排) */\n.drawer {\n /* 兩層 class 提高權重,蓋過 MUI 主題注入的 .MuiIconButton-root */\n /* ListItem(渲染成 <a>)。hover/選中底色沿用 MUI 與各站主題的 MuiListItem、Mui-selected 設定 */\n /* 目前所在頁:左側色條+粗體,不只靠底色(WCAG 1.4.1)。\n 色條畫在文字元素上取 currentColor:各站常以 !important 改抽屜文字色(ada 白字、tahl 藍綠),\n 色條才會與文字同色;ListItem 本身是 position:relative,色條貼齊整列左緣 */\n /* 語系超過 3 種時退回下拉:撐滿工具區寬度 */\n}\n.drawer__icon {\n display: none !important;\n}\n.drawer__paper {\n width: 20rem;\n max-width: 90vw;\n /* 開啟時 MUI 把焦點放在紙面本身(tabindex=-1 的容器,非操作元件),不畫焦點框;\n 須 !important 才蓋得過各站 a11y.scss 的全域 :focus-visible */\n}\n.drawer__paper:focus {\n outline: none !important;\n}\n.drawer__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n padding: 0.75rem 0.5rem 0.75rem 1.5rem;\n}\n.drawer__header-brand {\n display: flex;\n align-items: center;\n min-width: 0;\n}\n.drawer__header-title {\n font-size: 1.125rem;\n font-weight: bold;\n}\n.drawer__header .drawer__close {\n flex-shrink: 0;\n /* 觸控目標 48px(WCAG 2.5.5):共用主題把 IconButton padding 改成 8(只剩 40px),\n 部分子站手機版又把根字級縮到 70%,故用 px 保底 */\n min-width: 48px;\n min-height: 48px;\n margin-left: auto;\n /* 深色主題(palette.type=dark,如 ada、tahl)的 IconButton 預設白色,在淺色抽屜上看不見 → 沿用抽屜文字色 */\n color: inherit;\n}\n.drawer__header .drawer__close.Mui-focusVisible {\n outline: 2px solid currentColor;\n}\n.drawer__list > li {\n list-style: none;\n}\n.drawer__list .drawer__link {\n /* 觸控目標 48px(WCAG 2.5.5) */\n min-height: 3rem;\n /* 文字與工具區標籤對齊 1.5rem(蓋過 MuiListItem-gutters 的 16px) */\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n color: inherit;\n text-decoration: none;\n /* 連結撐滿抽屜寬度,紙面又會捲動(overflow:auto),外凸的焦點框左右會被裁掉 → 內縮完整框。\n 各站 a11y.scss 的全域 :focus-visible 以 !important 設 outline-offset,這裡也須 !important 才蓋得過 */\n}\n.drawer__list .drawer__link:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: -4px !important;\n}\n.drawer__link--active .MuiTypography-root {\n font-weight: 700;\n}\n.drawer__link--active .MuiTypography-root::before {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 0.25rem;\n background: currentColor;\n}\n.drawer__tools {\n display: flex;\n flex-direction: column;\n gap: 1.25rem;\n padding: 1.25rem 1.5rem;\n}\n.drawer__lang.select {\n width: 100%;\n}\n\n@media screen and (max-width: 768px) {\n .drawer {\n display: flex;\n justify-content: flex-end;\n }\n .drawer__icon {\n display: flex !important;\n }\n}";
|
|
93
|
+
styleInject(css_248z);
|
|
94
|
+
|
|
95
|
+
/* 語系不多時並排成分段按鈕(點一下即切換),太多才退回下拉 */
|
|
96
|
+
var MAX_SEGMENTED_LANGUAGES = 3;
|
|
97
|
+
var Drawer = function Drawer(_ref) {
|
|
98
|
+
var title = _ref.title,
|
|
99
|
+
logo = _ref.logo,
|
|
100
|
+
locale = _ref.locale,
|
|
101
|
+
supportLanguages = _ref.supportLanguages,
|
|
102
|
+
drawerList = _ref.drawerList,
|
|
103
|
+
onLanguageChange = _ref.onLanguageChange,
|
|
104
|
+
languageSelectLabel = _ref.languageSelectLabel,
|
|
105
|
+
extraTools = _ref.extraTools;
|
|
106
|
+
var _useState = useState(false),
|
|
107
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
108
|
+
open = _useState2[0],
|
|
109
|
+
setOpen = _useState2[1];
|
|
110
|
+
var languages = Array.isArray(supportLanguages) ? supportLanguages : [];
|
|
111
|
+
var currentLanguage = languages.length > 0 ? checkLanguageSupport({
|
|
112
|
+
language: locale,
|
|
113
|
+
supportLanguages: languages
|
|
114
|
+
}) : undefined;
|
|
115
|
+
/* extraTools 可傳函式,依擺放位置(header/drawer)給不同版面 */
|
|
116
|
+
var tools = typeof extraTools === 'function' ? extraTools({
|
|
117
|
+
placement: 'drawer'
|
|
118
|
+
}) : extraTools;
|
|
119
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
120
|
+
className: "drawer"
|
|
121
|
+
}, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
122
|
+
className: "drawer__icon",
|
|
123
|
+
"aria-label": getIntl().formatMessage({
|
|
124
|
+
id: 'aria.header.menuOpen'
|
|
125
|
+
}),
|
|
126
|
+
"aria-haspopup": "dialog",
|
|
127
|
+
"aria-expanded": open,
|
|
128
|
+
onClick: function onClick() {
|
|
129
|
+
return setOpen(true);
|
|
130
|
+
}
|
|
131
|
+
}, /*#__PURE__*/React__default.createElement(DehazeRounded, {
|
|
132
|
+
fontSize: "large",
|
|
133
|
+
"aria-hidden": "true"
|
|
134
|
+
})), /*#__PURE__*/React__default.createElement(Drawer$1, {
|
|
135
|
+
anchor: "right",
|
|
136
|
+
open: open,
|
|
137
|
+
onClose: function onClose() {
|
|
138
|
+
return setOpen(false);
|
|
139
|
+
},
|
|
140
|
+
onKeyDown: function onKeyDown(event) {
|
|
141
|
+
if (event.key === 'Escape') setOpen(false);
|
|
142
|
+
}
|
|
143
|
+
/* 抽屜是強制回應的浮層(背景不可操作),以 dialog 語意讓讀屏在開啟時唸出名稱(WCAG 4.1.2) */,
|
|
144
|
+
PaperProps: {
|
|
145
|
+
className: 'drawer__paper',
|
|
146
|
+
role: 'dialog',
|
|
147
|
+
'aria-modal': true,
|
|
148
|
+
'aria-label': getIntl().formatMessage({
|
|
149
|
+
id: 'aria.header.navigation'
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
153
|
+
className: "drawer__header"
|
|
154
|
+
}, (logo || title) && /*#__PURE__*/React__default.createElement("div", {
|
|
155
|
+
className: "drawer__header-brand"
|
|
156
|
+
}, logo && /*#__PURE__*/React__default.createElement("div", {
|
|
157
|
+
className: "drawer__header-logo"
|
|
158
|
+
}, logo), title && /*#__PURE__*/React__default.createElement("div", {
|
|
159
|
+
className: "drawer__header-title"
|
|
160
|
+
}, title)), /*#__PURE__*/React__default.createElement(IconButton, {
|
|
161
|
+
className: "drawer__close",
|
|
162
|
+
"aria-label": getIntl().formatMessage({
|
|
163
|
+
id: 'aria.header.menuClose'
|
|
164
|
+
}),
|
|
165
|
+
onClick: function onClick() {
|
|
166
|
+
return setOpen(false);
|
|
167
|
+
}
|
|
168
|
+
}, /*#__PURE__*/React__default.createElement(CloseRounded, {
|
|
169
|
+
"aria-hidden": "true"
|
|
170
|
+
}))), /*#__PURE__*/React__default.createElement(Divider, null), /*#__PURE__*/React__default.createElement(DrawerList, {
|
|
171
|
+
drawerList: (Array.isArray(drawerList) ? drawerList : []).filter(function (_ref2) {
|
|
172
|
+
var showInHeader = _ref2.showInHeader;
|
|
173
|
+
return showInHeader;
|
|
174
|
+
}),
|
|
175
|
+
setOpen: setOpen
|
|
176
|
+
}), (languages.length > 0 || tools) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Divider, null), /*#__PURE__*/React__default.createElement("div", {
|
|
177
|
+
className: "drawer__tools"
|
|
178
|
+
}, languages.length > 0 && languages.length <= MAX_SEGMENTED_LANGUAGES && /*#__PURE__*/React__default.createElement(SegmentedControl, {
|
|
179
|
+
className: "drawer__lang",
|
|
180
|
+
label: getIntl().formatMessage({
|
|
181
|
+
id: 'header.language'
|
|
182
|
+
}),
|
|
183
|
+
options: languages.map(function (_ref3) {
|
|
184
|
+
var value = _ref3.value,
|
|
185
|
+
label = _ref3.label,
|
|
186
|
+
lang = _ref3.lang;
|
|
187
|
+
return {
|
|
188
|
+
value: value,
|
|
189
|
+
label: label,
|
|
190
|
+
lang: lang
|
|
191
|
+
};
|
|
192
|
+
}),
|
|
193
|
+
value: currentLanguage,
|
|
194
|
+
onChange: function onChange(value) {
|
|
195
|
+
return onLanguageChange(value);
|
|
196
|
+
}
|
|
197
|
+
}), languages.length > MAX_SEGMENTED_LANGUAGES && /*#__PURE__*/React__default.createElement(Select, {
|
|
198
|
+
className: "drawer__lang",
|
|
199
|
+
ariaLabel: languageSelectLabel || getIntl().formatMessage({
|
|
200
|
+
id: 'aria.header.languageSelect'
|
|
201
|
+
}),
|
|
202
|
+
defaultValue: currentLanguage,
|
|
203
|
+
onChange: function onChange(value) {
|
|
204
|
+
return onLanguageChange(value);
|
|
205
|
+
},
|
|
206
|
+
options: languages
|
|
207
|
+
}), tools && /*#__PURE__*/React__default.createElement("div", {
|
|
208
|
+
className: "drawer__extraTools"
|
|
209
|
+
}, tools)))));
|
|
210
|
+
};
|
|
211
|
+
Drawer.defaultProps = {
|
|
212
|
+
title: undefined,
|
|
213
|
+
logo: undefined,
|
|
214
|
+
locale: undefined,
|
|
215
|
+
supportLanguages: [
|
|
216
|
+
// { value: 'en', label: 'English' },
|
|
217
|
+
{
|
|
218
|
+
value: 'zh-tw',
|
|
219
|
+
label: '繁體中文'
|
|
220
|
+
}
|
|
221
|
+
// { value: 'zh-cn', label: '簡體中文' },
|
|
222
|
+
],
|
|
223
|
+
|
|
224
|
+
drawerList: undefined,
|
|
225
|
+
onLanguageChange: function onLanguageChange() {},
|
|
226
|
+
languageSelectLabel: undefined,
|
|
227
|
+
extraTools: undefined
|
|
228
|
+
};
|
|
229
|
+
Drawer.propTypes = {
|
|
230
|
+
title: PropTypes.string,
|
|
231
|
+
logo: PropTypes.node,
|
|
232
|
+
/** 目前語系(決定語言切換鈕的選中狀態) */
|
|
233
|
+
locale: PropTypes.string,
|
|
234
|
+
/** 支援的語系;3 種以內並排成分段按鈕,超過改用下拉 */
|
|
235
|
+
supportLanguages: PropTypes.arrayOf(PropTypes.any),
|
|
236
|
+
drawerList: PropTypes.arrayOf(PropTypes.any),
|
|
237
|
+
onLanguageChange: PropTypes.func,
|
|
238
|
+
/** 語言下拉的無障礙名稱(WCAG 3.3.2);未提供時使用套件內 aria.header.languageSelect */
|
|
239
|
+
languageSelectLabel: PropTypes.string,
|
|
240
|
+
/** 呼叫端自訂的工具區(如字級縮放);由 Header 一併傳入,窄畫面時顯示於抽屜內。
|
|
241
|
+
傳函式時以 ({ placement: 'drawer' }) 呼叫,可給抽屜專用的版面 */
|
|
242
|
+
extraTools: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export { Drawer as D, checkLanguageSupport as c, defaultSupportLanguage as d };
|
package/lib/components/Drawer.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
export { D as default } from './Drawer-
|
|
1
|
+
export { D as default } from './Drawer-a5be9257.js';
|
|
2
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-
|
|
7
|
+
import './Select-89841c71.js';
|
|
8
8
|
import './index-b76a85f4.js';
|
|
9
|
-
import './defaultTheme-
|
|
9
|
+
import './defaultTheme-c5dd0f64.js';
|
|
10
10
|
import 'react-is';
|
|
11
11
|
import '@material-ui/styles';
|
|
12
|
-
import './useTheme-
|
|
13
|
-
import './withTheme-
|
|
12
|
+
import './useTheme-98b6cf17.js';
|
|
13
|
+
import './withTheme-3486f38b.js';
|
|
14
14
|
import './Empty-c6a44967.js';
|
|
15
15
|
import './style-inject.es-1f59c1d0.js';
|
|
16
16
|
import './globalConfig';
|
|
17
|
+
import './SegmentedControl-81f63afc.js';
|
|
17
18
|
import 'react-router-dom';
|
package/lib/components/Footer.js
CHANGED
|
@@ -3,24 +3,24 @@ import React__default, { useState, useEffect } from 'react';
|
|
|
3
3
|
import { c as classNames } from './index-b76a85f4.js';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import axios from 'axios';
|
|
6
|
-
import { C as ContactModal } from './ContactModal-
|
|
6
|
+
import { C as ContactModal } from './ContactModal-159de99c.js';
|
|
7
7
|
import { S as Spin } from './Spin-8f87eadc.js';
|
|
8
8
|
import { getIntl } from './globalConfig';
|
|
9
9
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
10
10
|
import './hoist-non-react-statics.cjs-3f408ad2.js';
|
|
11
11
|
import 'react-is';
|
|
12
|
+
import './defaultTheme-c5dd0f64.js';
|
|
13
|
+
import '@material-ui/styles';
|
|
14
|
+
import './useTheme-98b6cf17.js';
|
|
15
|
+
import './withTheme-3486f38b.js';
|
|
12
16
|
import './Modal-e04532fa.js';
|
|
13
17
|
import '@material-ui/core';
|
|
14
18
|
import '@material-ui/icons';
|
|
15
19
|
import './Button-7bd5aa09.js';
|
|
16
20
|
import './_commonjsHelpers-70de2c37.js';
|
|
17
|
-
import './
|
|
18
|
-
import '@material-ui/styles';
|
|
19
|
-
import './useTheme-d16d02d9.js';
|
|
20
|
-
import './withTheme-2d778133.js';
|
|
21
|
-
import './Select-cb3e1ba1.js';
|
|
21
|
+
import './Select-89841c71.js';
|
|
22
22
|
import './Empty-c6a44967.js';
|
|
23
|
-
import './createSvgIcon-
|
|
23
|
+
import './createSvgIcon-dc603596.js';
|
|
24
24
|
import 'react-dom';
|
|
25
25
|
|
|
26
26
|
/* eslint-disable max-len */
|
package/lib/components/Header.js
CHANGED
|
@@ -6,25 +6,26 @@ 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-
|
|
10
|
-
import { S as Select } from './Select-
|
|
11
|
-
import { c as checkLanguageSupport, D as Drawer, d as defaultSupportLanguage } from './Drawer-
|
|
9
|
+
import { K as KeywordSearch } from './KeywordSearch-db9c45d9.js';
|
|
10
|
+
import { S as Select } from './Select-89841c71.js';
|
|
11
|
+
import { c as checkLanguageSupport, D as Drawer, d as defaultSupportLanguage } from './Drawer-a5be9257.js';
|
|
12
12
|
import { getIntl } from './globalConfig';
|
|
13
13
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
14
14
|
import './isObjectLike-e111475d.js';
|
|
15
15
|
import './_commonjsHelpers-70de2c37.js';
|
|
16
16
|
import 'axios';
|
|
17
|
-
import './Autocomplete-
|
|
17
|
+
import './Autocomplete-0ea4a31c.js';
|
|
18
18
|
import '@material-ui/lab';
|
|
19
|
-
import './createSvgIcon-
|
|
20
|
-
import './defaultTheme-
|
|
19
|
+
import './createSvgIcon-dc603596.js';
|
|
20
|
+
import './defaultTheme-c5dd0f64.js';
|
|
21
21
|
import 'react-is';
|
|
22
22
|
import '@material-ui/styles';
|
|
23
23
|
import 'react-dom';
|
|
24
|
-
import './toConsumableArray-
|
|
24
|
+
import './toConsumableArray-c268c112.js';
|
|
25
25
|
import './Empty-c6a44967.js';
|
|
26
|
-
import './useTheme-
|
|
27
|
-
import './withTheme-
|
|
26
|
+
import './useTheme-98b6cf17.js';
|
|
27
|
+
import './withTheme-3486f38b.js';
|
|
28
|
+
import './SegmentedControl-81f63afc.js';
|
|
28
29
|
|
|
29
30
|
var css_248z = "@charset \"UTF-8\";\n.header {\n display: flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.6);\n background-color: rgba(255, 255, 255, 0.6);\n padding: 12px 36px !important;\n position: fixed;\n top: 0;\n z-index: 10;\n width: 100% !important;\n transition: top 0.3s ease-in-out;\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);\n /* 呼叫端自訂工具區(如字級縮放):與語系選單同屬右側工具列 */\n}\n.header__logo {\n display: flex;\n width: -moz-fit-content !important;\n width: fit-content !important;\n margin-right: 30px !important;\n cursor: pointer;\n text-decoration: none;\n}\n.header__logo__img {\n display: flex;\n align-items: center;\n}\n.header__logo__title {\n white-space: nowrap;\n margin-left: 1rem !important;\n font-size: 1.5rem !important;\n font-weight: 700 !important;\n font-family: \"Noto Sans TC\" !important;\n}\n.header__links {\n display: flex;\n justify-content: flex-end;\n padding-right: 14px;\n}\n.header__links a {\n text-decoration: none;\n}\n.header__links--full {\n flex: 1;\n}\n.header__links__item {\n color: rgba(0, 0, 0, 0.85);\n font-size: 1.125rem !important;\n font-weight: 500 !important;\n white-space: nowrap;\n padding: 6px 14px;\n font-family: \"Noto Sans TC\" !important;\n}\n.header__links__item--active .header__links__item {\n font-weight: 800 !important;\n background: transparent;\n border-radius: 45px;\n}\n.header__links__item:hover {\n font-weight: 800 !important;\n}\n.header__language {\n min-width: 100px !important;\n}\n.header__extraTools {\n display: flex;\n align-items: center;\n margin-right: 8px;\n}\n.header__searchIcon {\n display: none !important;\n}\n@media screen and (max-width: 768px) {\n .header--smallUseSearchIcon .header__searchIcon {\n display: flex !important;\n margin-right: 10px !important;\n }\n .header--smallUseSearchIcon .keywordSearch {\n visibility: hidden;\n flex: 1;\n width: 0;\n }\n}\n.header--hide {\n top: -100px;\n}\n.header--focus .header__links {\n display: none;\n}\n.header .MuiTypography-root {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.header .autocomplete {\n float: right;\n}\n.header .autocomplete .MuiAutocomplete-inputRoot[class*=MuiOutlinedInput-root] {\n padding: 1px 8px !important;\n}\n.header .keywordSearch {\n margin-right: 8px;\n}\n.header .keywordSearch--focus .autocomplete {\n width: 100% !important;\n}\n.header .keywordSearch--animation .autocomplete {\n width: 240px;\n transition: width 0.3s ease-in-out;\n}\n\n/* 避免寬度460以下炸版 */\n@media screen and (max-width: 460px) {\n .header .keywordSearch--animation .autocomplete {\n width: 100%;\n }\n}\n@media screen and (max-width: 768px) {\n .header {\n padding: 12px 15px !important;\n /* 窄畫面比照語系選單收進抽屜,避免擠壓搜尋框 */\n }\n .header__logo {\n margin-right: 16px !important;\n }\n .header__logo__title {\n display: none !important;\n }\n .header__links {\n display: none;\n }\n .header__links__item {\n font-size: 1rem !important;\n }\n .header__language {\n display: none !important;\n }\n .header__extraTools {\n display: none !important;\n }\n .header--focus .header__logo {\n display: none !important;\n }\n\n .autocomplete__icon {\n display: none !important;\n }\n}";
|
|
30
31
|
styleInject(css_248z);
|
|
@@ -152,7 +153,9 @@ var Header = function Header(props) {
|
|
|
152
153
|
"aria-hidden": "true"
|
|
153
154
|
})), showDarkModeSwitch , extraTools && /*#__PURE__*/React__default.createElement("div", {
|
|
154
155
|
className: "header__extraTools"
|
|
155
|
-
}, extraTools
|
|
156
|
+
}, typeof extraTools === 'function' ? extraTools({
|
|
157
|
+
placement: 'header'
|
|
158
|
+
}) : extraTools), Array.isArray(supportLanguages) && supportLanguages.length > 0 && /*#__PURE__*/React__default.createElement(Select, {
|
|
156
159
|
className: "header__language",
|
|
157
160
|
ariaLabel: languageSelectLabel || getIntl().formatMessage({
|
|
158
161
|
id: 'aria.header.languageSelect'
|
|
@@ -168,6 +171,7 @@ var Header = function Header(props) {
|
|
|
168
171
|
}), /*#__PURE__*/React__default.createElement(Drawer, {
|
|
169
172
|
title: title,
|
|
170
173
|
logo: logo,
|
|
174
|
+
locale: locale,
|
|
171
175
|
drawerList: pages,
|
|
172
176
|
supportLanguages: supportLanguages,
|
|
173
177
|
onLanguageChange: onLanguageChange,
|
|
@@ -226,8 +230,9 @@ Header.propTypes = {
|
|
|
226
230
|
onSearchIconClick: PropTypes.func,
|
|
227
231
|
/** 語言下拉的無障礙名稱(WCAG 3.3.2);未提供時使用套件內 aria.header.languageSelect */
|
|
228
232
|
languageSelectLabel: PropTypes.string,
|
|
229
|
-
/**
|
|
230
|
-
|
|
233
|
+
/** 呼叫端自訂的工具區(如字級縮放):寬畫面顯示於語系選單之前,窄畫面隨語系一起收進抽屜。
|
|
234
|
+
傳函式時以 ({ placement: 'header' | 'drawer' }) 呼叫,可依位置給不同版面 */
|
|
235
|
+
extraTools: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
|
|
231
236
|
};
|
|
232
237
|
|
|
233
238
|
export { Header as default };
|
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { c as classNames } from './index-b76a85f4.js';
|
|
5
5
|
import axios from 'axios';
|
|
6
6
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
7
|
-
import { A as Autocomplete } from './Autocomplete-
|
|
7
|
+
import { A as Autocomplete } from './Autocomplete-0ea4a31c.js';
|
|
8
8
|
|
|
9
9
|
var css_248z = ".keywordSearch {\n border-radius: 4px;\n width: 100%;\n margin-right: 14px;\n}\n.keywordSearch--animation .autocomplete {\n transition: max-width 0.3s ease-out;\n max-width: 240px;\n}\n.keywordSearch--focus {\n flex: 1;\n}\n.keywordSearch--focus .autocomplete {\n max-width: 100%;\n}\n.keywordSearch .MuiAutocomplete-hasPopupIcon.MuiAutocomplete-hasClearIcon .MuiAutocomplete-inputRoot[class*=MuiOutlinedInput-root] {\n border-radius: 10px;\n background-color: #ffffff66;\n}";
|
|
10
10
|
styleInject(css_248z);
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export { K as default } from './KeywordSearch-
|
|
1
|
+
export { K as default } from './KeywordSearch-db9c45d9.js';
|
|
2
2
|
import './_rollupPluginBabelHelpers-a52356f6.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'prop-types';
|
|
5
5
|
import './index-b76a85f4.js';
|
|
6
6
|
import 'axios';
|
|
7
7
|
import './style-inject.es-1f59c1d0.js';
|
|
8
|
-
import './Autocomplete-
|
|
8
|
+
import './Autocomplete-0ea4a31c.js';
|
|
9
9
|
import './debounce-127da66c.js';
|
|
10
10
|
import './isObjectLike-e111475d.js';
|
|
11
11
|
import './_commonjsHelpers-70de2c37.js';
|
|
12
12
|
import '@material-ui/lab';
|
|
13
13
|
import '@material-ui/core';
|
|
14
14
|
import '@material-ui/icons';
|
|
15
|
-
import './createSvgIcon-
|
|
16
|
-
import './defaultTheme-
|
|
15
|
+
import './createSvgIcon-dc603596.js';
|
|
16
|
+
import './defaultTheme-c5dd0f64.js';
|
|
17
17
|
import 'react-is';
|
|
18
18
|
import '@material-ui/styles';
|
|
19
19
|
import 'react-dom';
|
|
20
|
-
import './toConsumableArray-
|
|
20
|
+
import './toConsumableArray-c268c112.js';
|
|
21
21
|
import './globalConfig';
|
|
22
22
|
import './Empty-c6a44967.js';
|
|
@@ -4,14 +4,14 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { c as classNames } from './index-b76a85f4.js';
|
|
5
5
|
import { M as Modal } from './Modal-e04532fa.js';
|
|
6
6
|
import { Typography } from '@material-ui/core';
|
|
7
|
-
import { r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-
|
|
7
|
+
import { r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-dc603596.js';
|
|
8
8
|
import { getIntl } from './globalConfig';
|
|
9
9
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
10
10
|
import '@material-ui/icons';
|
|
11
11
|
import './Button-7bd5aa09.js';
|
|
12
12
|
import './Spin-8f87eadc.js';
|
|
13
13
|
import './_commonjsHelpers-70de2c37.js';
|
|
14
|
-
import './defaultTheme-
|
|
14
|
+
import './defaultTheme-c5dd0f64.js';
|
|
15
15
|
import 'react-is';
|
|
16
16
|
import '@material-ui/styles';
|
|
17
17
|
import 'react-dom';
|
|
@@ -2,10 +2,10 @@ import React__default from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { a as _baseGetTag, b as isObject_1, _ as _root, i as isObjectLike_1, c as _freeGlobal } from './isObjectLike-e111475d.js';
|
|
4
4
|
import { CssBaseline } from '@material-ui/core';
|
|
5
|
-
import {
|
|
5
|
+
import { v as createTheme } from './defaultTheme-c5dd0f64.js';
|
|
6
6
|
import 'react-is';
|
|
7
7
|
import { ThemeProvider } from '@material-ui/styles';
|
|
8
|
-
import './withTheme-
|
|
8
|
+
import './withTheme-3486f38b.js';
|
|
9
9
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
10
10
|
import './_commonjsHelpers-70de2c37.js';
|
|
11
11
|
|
|
@@ -2,13 +2,13 @@ import { c as _objectWithoutProperties$1, a as _slicedToArray$1 } from './_rollu
|
|
|
2
2
|
import * as React$2 from 'react';
|
|
3
3
|
import React__default, { Children, isValidElement, cloneElement, useState, useRef, useEffect } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { k as _objectWithoutProperties,
|
|
6
|
-
import { u as useControlled, c as clsx, b as useEventCallback, w as withStyles, d as useIsFocusVisible, e as useForkRef, f as createSvgIcon, g as capitalize, h as debounce, r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-
|
|
5
|
+
import { k as _objectWithoutProperties, q as _slicedToArray, _ as _extends, r as _objectWithoutPropertiesLoose, u as alpha, j as formatMuiErrorMessage } from './defaultTheme-c5dd0f64.js';
|
|
6
|
+
import { u as useControlled, c as clsx, b as useEventCallback, w as withStyles, d as useIsFocusVisible, e as useForkRef, f as createSvgIcon, g as capitalize, h as debounce, r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-dc603596.js';
|
|
7
7
|
import 'react-is';
|
|
8
8
|
import '@material-ui/styles';
|
|
9
|
-
import './withTheme-
|
|
10
|
-
import { _ as _toConsumableArray } from './toConsumableArray-
|
|
11
|
-
import { u as useTheme } from './useTheme-
|
|
9
|
+
import './withTheme-3486f38b.js';
|
|
10
|
+
import { _ as _toConsumableArray } from './toConsumableArray-c268c112.js';
|
|
11
|
+
import { u as useTheme } from './useTheme-98b6cf17.js';
|
|
12
12
|
import * as ReactDOM from 'react-dom';
|
|
13
13
|
import ReactDOM__default from 'react-dom';
|
|
14
14
|
import { c as classNames } from './index-b76a85f4.js';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { b as _objectSpread2 } from './_rollupPluginBabelHelpers-a52356f6.js';
|
|
2
|
+
import React__default, { useRef } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classNames } from './index-b76a85f4.js';
|
|
5
|
+
import { o as getContrastRatio } from './defaultTheme-c5dd0f64.js';
|
|
6
|
+
import 'react-is';
|
|
7
|
+
import '@material-ui/styles';
|
|
8
|
+
import { u as useTheme } from './useTheme-98b6cf17.js';
|
|
9
|
+
import './withTheme-3486f38b.js';
|
|
10
|
+
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
11
|
+
|
|
12
|
+
var css_248z = "@charset \"UTF-8\";\n.segmentedControl__label {\n display: block;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n font-weight: 700;\n}\n.segmentedControl__group {\n display: flex;\n}\n.segmentedControl__btn {\n flex: 1 1 0;\n min-width: 0;\n /* 觸控目標 44px(WCAG 2.5.5) */\n min-height: 2.75rem;\n padding: 0.25rem 0.5rem;\n border: 1px solid;\n background: transparent;\n color: inherit;\n font-family: inherit;\n font-size: 1rem;\n line-height: 1.25;\n cursor: pointer;\n /* 相鄰框線疊成一條 */\n /* 焦點框顏色由元件以 outlineColor 給主題文字色;拉到上層避免被相鄰按鈕蓋住 */\n}\n.segmentedControl__btn + .segmentedControl__btn {\n margin-left: -1px;\n}\n.segmentedControl__btn:first-child {\n border-radius: 4px 0 0 4px;\n}\n.segmentedControl__btn:last-child {\n border-radius: 0 4px 4px 0;\n}\n.segmentedControl__btn:hover {\n background: rgba(0, 0, 0, 0.04);\n}\n.segmentedControl__btn:focus-visible {\n position: relative;\n z-index: 1;\n outline-width: 2px;\n outline-style: solid;\n outline-offset: 2px;\n}\n.segmentedControl__btn--active {\n font-weight: 700;\n}";
|
|
13
|
+
styleInject(css_248z);
|
|
14
|
+
|
|
15
|
+
/* 每個實例需要唯一 id 才能做 aria-labelledby 串接 */
|
|
16
|
+
var segmentedSeq = 0;
|
|
17
|
+
|
|
18
|
+
/* 選中底色優先用主題主色(與站台色調一致);主色配字對比不足 4.5:1(WCAG 1.4.3)
|
|
19
|
+
或主色框線對紙張不足 3:1(WCAG 1.4.11)時,退回「文字色/紙張色」反白,對比必然足夠 */
|
|
20
|
+
var pickColors = function pickColors(_ref) {
|
|
21
|
+
var primary = _ref.primary,
|
|
22
|
+
text = _ref.text,
|
|
23
|
+
background = _ref.background;
|
|
24
|
+
var primaryOk = getContrastRatio(primary.main, primary.contrastText) >= 4.5 && getContrastRatio(primary.main, background.paper) >= 3;
|
|
25
|
+
return primaryOk ? {
|
|
26
|
+
fill: primary.main,
|
|
27
|
+
onFill: primary.contrastText
|
|
28
|
+
} : {
|
|
29
|
+
fill: text.primary,
|
|
30
|
+
onFill: background.paper
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/* 分段按鈕(少量互斥選項並排,點一下即切換,如抽屜內的語言、字級)。
|
|
35
|
+
* - 可見標籤即群組名稱:role="group" + aria-labelledby 指向標籤(WCAG 1.3.1/2.5.3)
|
|
36
|
+
* - 每個選項是切換鈕,以 aria-pressed 表達目前選中者(WCAG 4.1.2)
|
|
37
|
+
* - 選中態反白(配色見 pickColors),另加粗體,不只靠顏色區分(WCAG 1.4.1) */
|
|
38
|
+
var SegmentedControl = function SegmentedControl(_ref2) {
|
|
39
|
+
var className = _ref2.className,
|
|
40
|
+
label = _ref2.label,
|
|
41
|
+
options = _ref2.options,
|
|
42
|
+
value = _ref2.value,
|
|
43
|
+
onChange = _ref2.onChange;
|
|
44
|
+
var theme = useTheme();
|
|
45
|
+
var _pickColors = pickColors(theme.palette),
|
|
46
|
+
fill = _pickColors.fill,
|
|
47
|
+
onFill = _pickColors.onFill;
|
|
48
|
+
var labelIdRef = useRef(null);
|
|
49
|
+
if (!labelIdRef.current) {
|
|
50
|
+
segmentedSeq += 1;
|
|
51
|
+
labelIdRef.current = "nmtl-segmented-".concat(segmentedSeq, "-label");
|
|
52
|
+
}
|
|
53
|
+
var labelId = labelIdRef.current;
|
|
54
|
+
/* 框線、焦點框與選中底色同色(站台若有全域焦點樣式會以 !important 蓋過焦點框色,屬預期) */
|
|
55
|
+
var baseStyle = {
|
|
56
|
+
borderColor: fill,
|
|
57
|
+
outlineColor: fill
|
|
58
|
+
};
|
|
59
|
+
var activeStyle = _objectSpread2(_objectSpread2({}, baseStyle), {}, {
|
|
60
|
+
backgroundColor: fill,
|
|
61
|
+
color: onFill
|
|
62
|
+
});
|
|
63
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
64
|
+
className: classNames('segmentedControl', className)
|
|
65
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
66
|
+
id: labelId,
|
|
67
|
+
className: "segmentedControl__label"
|
|
68
|
+
}, label), /*#__PURE__*/React__default.createElement("div", {
|
|
69
|
+
className: "segmentedControl__group",
|
|
70
|
+
role: "group",
|
|
71
|
+
"aria-labelledby": labelId
|
|
72
|
+
}, options.map(function (option) {
|
|
73
|
+
var active = option.value === value;
|
|
74
|
+
return /*#__PURE__*/React__default.createElement("button", {
|
|
75
|
+
key: option.value,
|
|
76
|
+
type: "button",
|
|
77
|
+
className: classNames('segmentedControl__btn', {
|
|
78
|
+
'segmentedControl__btn--active': active
|
|
79
|
+
}),
|
|
80
|
+
"aria-pressed": active,
|
|
81
|
+
"aria-label": option.ariaLabel,
|
|
82
|
+
lang: option.lang,
|
|
83
|
+
style: active ? activeStyle : baseStyle,
|
|
84
|
+
onClick: function onClick() {
|
|
85
|
+
if (!active) onChange(option.value);
|
|
86
|
+
}
|
|
87
|
+
}, option.label);
|
|
88
|
+
})));
|
|
89
|
+
};
|
|
90
|
+
SegmentedControl.defaultProps = {
|
|
91
|
+
className: undefined,
|
|
92
|
+
value: undefined,
|
|
93
|
+
onChange: function onChange() {}
|
|
94
|
+
};
|
|
95
|
+
SegmentedControl.propTypes = {
|
|
96
|
+
/** Css Name */
|
|
97
|
+
className: PropTypes.string,
|
|
98
|
+
/** 可見標籤,同時作為群組的可及名稱 */
|
|
99
|
+
label: PropTypes.string.isRequired,
|
|
100
|
+
/** 選項:label 為可見文字;ariaLabel 在可見文字對讀屏沒有意義時提供(如 A+);lang 標示與頁面不同的語言 */
|
|
101
|
+
options: PropTypes.arrayOf(PropTypes.shape({
|
|
102
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
103
|
+
label: PropTypes.string.isRequired,
|
|
104
|
+
ariaLabel: PropTypes.string,
|
|
105
|
+
lang: PropTypes.string
|
|
106
|
+
})).isRequired,
|
|
107
|
+
/** 目前選中的值 */
|
|
108
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
109
|
+
/** 選擇其他選項時的 callback(點選已選中的選項不會觸發) */
|
|
110
|
+
onChange: PropTypes.func
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export { SegmentedControl as S };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { S as default } from './SegmentedControl-81f63afc.js';
|
|
2
|
+
import './_rollupPluginBabelHelpers-a52356f6.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'prop-types';
|
|
5
|
+
import './index-b76a85f4.js';
|
|
6
|
+
import './defaultTheme-c5dd0f64.js';
|
|
7
|
+
import 'react-is';
|
|
8
|
+
import '@material-ui/styles';
|
|
9
|
+
import './useTheme-98b6cf17.js';
|
|
10
|
+
import './withTheme-3486f38b.js';
|
|
11
|
+
import './style-inject.es-1f59c1d0.js';
|
|
@@ -3,11 +3,11 @@ import React__default, { useRef } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { c as classNames } from './index-b76a85f4.js';
|
|
5
5
|
import { FormControl, Select as Select$1, CircularProgress, MenuItem } from '@material-ui/core';
|
|
6
|
-
import './defaultTheme-
|
|
6
|
+
import './defaultTheme-c5dd0f64.js';
|
|
7
7
|
import 'react-is';
|
|
8
8
|
import '@material-ui/styles';
|
|
9
|
-
import { u as useTheme } from './useTheme-
|
|
10
|
-
import './withTheme-
|
|
9
|
+
import { u as useTheme } from './useTheme-98b6cf17.js';
|
|
10
|
+
import './withTheme-3486f38b.js';
|
|
11
11
|
import { E as Empty } from './Empty-c6a44967.js';
|
|
12
12
|
import { getIntl } from './globalConfig';
|
|
13
13
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|