@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
package/lib/components/Select.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { S as default } from './Select-
|
|
1
|
+
export { S as default } from './Select-89841c71.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 '@material-ui/core';
|
|
7
|
-
import './defaultTheme-
|
|
7
|
+
import './defaultTheme-c5dd0f64.js';
|
|
8
8
|
import 'react-is';
|
|
9
9
|
import '@material-ui/styles';
|
|
10
|
-
import './useTheme-
|
|
11
|
-
import './withTheme-
|
|
10
|
+
import './useTheme-98b6cf17.js';
|
|
11
|
+
import './withTheme-3486f38b.js';
|
|
12
12
|
import './Empty-c6a44967.js';
|
|
13
13
|
import './style-inject.es-1f59c1d0.js';
|
|
14
14
|
import './globalConfig';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getAugmentedNamespace } from './_commonjsHelpers-70de2c37.js';
|
|
2
|
-
import { j as formatMuiErrorMessage, _ as _extends, d as defaultTheme, k as _objectWithoutProperties } from './defaultTheme-
|
|
2
|
+
import { j as formatMuiErrorMessage, _ as _extends, d as defaultTheme, k as _objectWithoutProperties } from './defaultTheme-c5dd0f64.js';
|
|
3
3
|
import 'prop-types';
|
|
4
4
|
import 'react-is';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -1658,4 +1658,4 @@ function createTheme() {
|
|
|
1658
1658
|
|
|
1659
1659
|
var defaultTheme = createTheme();
|
|
1660
1660
|
|
|
1661
|
-
export { _extends as _, display as a, borders as b, compose as c, defaultTheme as d, palette as e, flexbox as f, grid as g, boxShadow as h, spacing as i, formatMuiErrorMessage as j, _objectWithoutProperties as k, _arrayLikeToArray as l, merge as m, _unsupportedIterableToArray as n,
|
|
1661
|
+
export { _extends as _, display as a, borders as b, compose as c, defaultTheme as d, palette as e, flexbox as f, grid as g, boxShadow as h, spacing as i, formatMuiErrorMessage as j, _objectWithoutProperties as k, _arrayLikeToArray as l, merge as m, _unsupportedIterableToArray as n, getContrastRatio as o, positions as p, _slicedToArray as q, _objectWithoutPropertiesLoose as r, sizing as s, typography as t, alpha as u, createTheme as v };
|
|
@@ -55,9 +55,12 @@ var zhtw = {
|
|
|
55
55
|
"common.form.attachment.hint2": "2.若有多個檔案請先集中至同一資料夾並以壓縮檔上傳",
|
|
56
56
|
"common.form.contactUs": "聯繫我們",
|
|
57
57
|
"common.form.error": "表單尚未完成 請檢察必填項目",
|
|
58
|
+
"common.form.errorSummary": "表單有 {count} 個欄位需要修正,點選下列項目可前往該欄位:",
|
|
58
59
|
"common.sna.reset": "回到原來位置與大小",
|
|
59
60
|
"aria.header.searchOpen": "開啟搜尋",
|
|
60
61
|
"aria.header.menuOpen": "開啟主選單",
|
|
62
|
+
"aria.header.menuClose": "關閉主選單",
|
|
63
|
+
"header.language": "語言",
|
|
61
64
|
"aria.header.logoHome": "回首頁",
|
|
62
65
|
"aria.header.logoHomeWithTitle": "{title},回首頁",
|
|
63
66
|
"aria.header.navigation": "主選單",
|
|
@@ -79,6 +82,7 @@ var zhtw = {
|
|
|
79
82
|
"aria.vcode.audioIntro": "驗證碼為:",
|
|
80
83
|
"aria.vcode.audioUnsupported": "瀏覽器不支援語音合成,請刷新驗證碼或改用圖片辨識",
|
|
81
84
|
"aria.vcode.refreshed": "驗證碼已更新",
|
|
85
|
+
"aria.vcode.hint": "請輸入圖片中的 4 個字元,英文不分大小寫;看不清楚可播放語音或刷新驗證碼",
|
|
82
86
|
"aria.moreButton.loaded": "已載入更多結果",
|
|
83
87
|
"aria.moreButton.collapsed": "已收合結果",
|
|
84
88
|
"aria.filter.hint": "(篩選條件,選取後過濾下方結果)",
|
|
@@ -179,8 +183,11 @@ var zhcn = {
|
|
|
179
183
|
"common.form.attachment.hint2": "2.若有多个档案请先集中至同一资料夹并以压缩档上传",
|
|
180
184
|
"common.form.contactUs": "联系我们",
|
|
181
185
|
"common.form.error": "表单尚未完成 请检察必填项目",
|
|
186
|
+
"common.form.errorSummary": "表单有 {count} 个字段需要修正,点击下列项目可前往该字段:",
|
|
182
187
|
"aria.header.searchOpen": "开启搜寻",
|
|
183
188
|
"aria.header.menuOpen": "开启主选单",
|
|
189
|
+
"aria.header.menuClose": "关闭主选单",
|
|
190
|
+
"header.language": "语言",
|
|
184
191
|
"aria.header.logoHome": "回首页",
|
|
185
192
|
"aria.header.logoHomeWithTitle": "{title},回首页",
|
|
186
193
|
"aria.header.navigation": "主选单",
|
|
@@ -202,6 +209,7 @@ var zhcn = {
|
|
|
202
209
|
"aria.vcode.audioIntro": "验证码为:",
|
|
203
210
|
"aria.vcode.audioUnsupported": "浏览器不支持语音合成,请刷新验证码或改用图片辨识",
|
|
204
211
|
"aria.vcode.refreshed": "验证码已更新",
|
|
212
|
+
"aria.vcode.hint": "请输入图片中的 4 个字符,英文不区分大小写;看不清楚可播放语音或刷新验证码",
|
|
205
213
|
"aria.moreButton.loaded": "已载入更多结果",
|
|
206
214
|
"aria.moreButton.collapsed": "已收合结果",
|
|
207
215
|
"aria.filter.hint": "(筛选条件,选取后过滤下方结果)",
|
|
@@ -304,8 +312,11 @@ var enus = {
|
|
|
304
312
|
"common.form.attachment.hint2": "2. If there are multiple files, please gather them in the same folder and upload them as compressed files",
|
|
305
313
|
"common.form.contactUs": "Contact Us",
|
|
306
314
|
"common.form.error": "The form has not been completed, please check the required items",
|
|
315
|
+
"common.form.errorSummary": "{count} field(s) need to be corrected. Select an item below to go to that field:",
|
|
307
316
|
"aria.header.searchOpen": "Open search",
|
|
308
317
|
"aria.header.menuOpen": "Open main menu",
|
|
318
|
+
"aria.header.menuClose": "Close main menu",
|
|
319
|
+
"header.language": "Language",
|
|
309
320
|
"aria.header.logoHome": "Back to home",
|
|
310
321
|
"aria.header.logoHomeWithTitle": "{title}, back to home",
|
|
311
322
|
"aria.header.navigation": "Main menu",
|
|
@@ -327,6 +338,7 @@ var enus = {
|
|
|
327
338
|
"aria.vcode.audioIntro": "The verification code is:",
|
|
328
339
|
"aria.vcode.audioUnsupported": "Speech synthesis not supported; please refresh the code",
|
|
329
340
|
"aria.vcode.refreshed": "Verification code refreshed",
|
|
341
|
+
"aria.vcode.hint": "Enter the 4 characters shown in the image (not case-sensitive). If you cannot read them, play the audio or refresh the code.",
|
|
330
342
|
"aria.moreButton.loaded": "More results loaded",
|
|
331
343
|
"aria.moreButton.collapsed": "Results collapsed",
|
|
332
344
|
"aria.filter.hint": " (filter, updates the results below)",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as _arrayLikeToArray, n as _unsupportedIterableToArray } from './defaultTheme-
|
|
1
|
+
import { l as _arrayLikeToArray, n as _unsupportedIterableToArray } from './defaultTheme-c5dd0f64.js';
|
|
2
2
|
|
|
3
3
|
function _arrayWithoutHoles(arr) {
|
|
4
4
|
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTheme as useTheme$1 } from '@material-ui/styles';
|
|
2
2
|
import 'react';
|
|
3
|
-
import { d as defaultTheme } from './defaultTheme-
|
|
3
|
+
import { d as defaultTheme } from './defaultTheme-c5dd0f64.js';
|
|
4
4
|
|
|
5
5
|
function useTheme() {
|
|
6
6
|
var theme = useTheme$1() || defaultTheme;
|
package/lib/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { default as SNA } from './components/SNA';
|
|
|
23
23
|
export { default as BarChart } from './components/BarChart';
|
|
24
24
|
export { default as ForwardLink } from './components/ForwardLink';
|
|
25
25
|
export { default as Pagination } from './components/Pagination';
|
|
26
|
+
export { default as SegmentedControl } from './components/SegmentedControl';
|
|
26
27
|
|
|
27
28
|
export { default as ContactModal } from './components/ContactModal';
|
|
28
29
|
export { default as KeywordSearch } from './components/KeywordSearch';
|
package/lib/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export { default as SNA } from './components/SNA';
|
|
|
23
23
|
export { default as BarChart } from './components/BarChart';
|
|
24
24
|
export { default as ForwardLink } from './components/ForwardLink';
|
|
25
25
|
export { default as Pagination } from './components/Pagination';
|
|
26
|
+
export { default as SegmentedControl } from './components/SegmentedControl';
|
|
26
27
|
|
|
27
28
|
export { default as ContactModal } from './components/ContactModal';
|
|
28
29
|
export { default as KeywordSearch } from './components/KeywordSearch';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daoyi/nmtl-ui",
|
|
3
3
|
"packageManager": "pnpm@10.34.5",
|
|
4
|
-
"version": "2.0.1-beta.
|
|
4
|
+
"version": "2.0.1-beta.133",
|
|
5
5
|
"description": "This project is to be used as a starter kit for building React component using Storybook and Rollup",
|
|
6
6
|
"author": "daoyi",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -123,6 +123,12 @@
|
|
|
123
123
|
"pub-alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
124
124
|
"pub-beta": "npm version prerelease --preid=beta && npm publish --tag beta"
|
|
125
125
|
},
|
|
126
|
+
"volta": {
|
|
127
|
+
"node": "24.20.0"
|
|
128
|
+
},
|
|
129
|
+
"engines": {
|
|
130
|
+
"node": "24.x"
|
|
131
|
+
},
|
|
126
132
|
"pnpm": {
|
|
127
133
|
"onlyBuiltDependencies": [
|
|
128
134
|
"core-js",
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { 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 } from '@material-ui/icons';
|
|
6
|
-
import { S as Select } from './Select-cb3e1ba1.js';
|
|
7
|
-
import { useHistory, useRouteMatch } from 'react-router-dom';
|
|
8
|
-
import { getIntl } from './globalConfig';
|
|
9
|
-
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
10
|
-
|
|
11
|
-
var defaultSupportLanguage = [
|
|
12
|
-
// { value: 'en', label: 'English' },
|
|
13
|
-
{
|
|
14
|
-
value: 'zh-tw',
|
|
15
|
-
label: '繁體中文'
|
|
16
|
-
}
|
|
17
|
-
// { value: 'zh-cn', label: '簡體中文' },
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
/* [檢查-語系]本系統是否支援該語系 並回傳語系 */
|
|
21
|
-
var checkLanguageSupport = function checkLanguageSupport(_ref) {
|
|
22
|
-
var language = _ref.language,
|
|
23
|
-
supportLanguages = _ref.supportLanguages;
|
|
24
|
-
var isSupport = supportLanguages.some(function (_ref2) {
|
|
25
|
-
var value = _ref2.value;
|
|
26
|
-
return value === language;
|
|
27
|
-
});
|
|
28
|
-
return isSupport ? language : supportLanguages[0].value;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const DrawerList = _ref => {
|
|
32
|
-
let {
|
|
33
|
-
drawerList,
|
|
34
|
-
setOpen
|
|
35
|
-
} = _ref;
|
|
36
|
-
const history = useHistory();
|
|
37
|
-
const {
|
|
38
|
-
url
|
|
39
|
-
} = useRouteMatch();
|
|
40
|
-
return /*#__PURE__*/React__default.createElement(List, {
|
|
41
|
-
className: "drawer__list"
|
|
42
|
-
}, Array.isArray(drawerList) && drawerList.map((_ref2, index) => {
|
|
43
|
-
let {
|
|
44
|
-
name,
|
|
45
|
-
icon,
|
|
46
|
-
path
|
|
47
|
-
} = _ref2;
|
|
48
|
-
return /*#__PURE__*/React__default.createElement(ListItem, {
|
|
49
|
-
button: true,
|
|
50
|
-
key: index.toString(),
|
|
51
|
-
onClick: () => {
|
|
52
|
-
if (path.indexOf('http') > -1) {
|
|
53
|
-
window.location = path;
|
|
54
|
-
} else {
|
|
55
|
-
history.push({
|
|
56
|
-
pathname: `${url}${path}`
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
setOpen(false);
|
|
60
|
-
}
|
|
61
|
-
}, icon && /*#__PURE__*/React__default.createElement(ListItemIcon, {
|
|
62
|
-
style: {
|
|
63
|
-
marginRight: 24
|
|
64
|
-
}
|
|
65
|
-
}, icon), /*#__PURE__*/React__default.createElement(ListItemText, {
|
|
66
|
-
primary: name
|
|
67
|
-
}));
|
|
68
|
-
}));
|
|
69
|
-
};
|
|
70
|
-
DrawerList.defaultProps = {};
|
|
71
|
-
DrawerList.propTypes = {
|
|
72
|
-
drawerList: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
73
|
-
setOpen: PropTypes.func.isRequired
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
var css_248z = "@charset \"UTF-8\";\n.drawer__icon {\n display: none !important;\n}\n.drawer__header {\n display: flex;\n align-items: center;\n padding: 20px;\n}\n.drawer__header-title {\n font-size: 1.125rem;\n font-weight: bold;\n}\n.drawer__list {\n padding: 10px !important;\n}\n.drawer__list .MuiSvgIcon-root {\n margin-left: 8px;\n}\n.drawer__lang {\n margin: 24px 36px !important;\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}\n/* 呼叫端自訂工具區(如字級縮放):窄畫面時由 Header 收進抽屜 */\n.drawer__extraTools {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 8px 16px;\n}";
|
|
77
|
-
styleInject(css_248z);
|
|
78
|
-
|
|
79
|
-
var Drawer = function Drawer(_ref) {
|
|
80
|
-
var title = _ref.title,
|
|
81
|
-
logo = _ref.logo,
|
|
82
|
-
locale = _ref.locale,
|
|
83
|
-
supportLanguages = _ref.supportLanguages,
|
|
84
|
-
drawerList = _ref.drawerList,
|
|
85
|
-
onLanguageChange = _ref.onLanguageChange,
|
|
86
|
-
languageSelectLabel = _ref.languageSelectLabel,
|
|
87
|
-
extraTools = _ref.extraTools;
|
|
88
|
-
var _useState = useState(false),
|
|
89
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
90
|
-
open = _useState2[0],
|
|
91
|
-
setOpen = _useState2[1];
|
|
92
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
93
|
-
className: "drawer"
|
|
94
|
-
}, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
95
|
-
className: "drawer__icon",
|
|
96
|
-
"aria-label": getIntl().formatMessage({
|
|
97
|
-
id: 'aria.header.menuOpen'
|
|
98
|
-
}),
|
|
99
|
-
"aria-haspopup": "menu",
|
|
100
|
-
"aria-expanded": open,
|
|
101
|
-
onClick: function onClick() {
|
|
102
|
-
return setOpen(true);
|
|
103
|
-
}
|
|
104
|
-
}, /*#__PURE__*/React__default.createElement(DehazeRounded, {
|
|
105
|
-
fontSize: "large",
|
|
106
|
-
"aria-hidden": "true"
|
|
107
|
-
})), /*#__PURE__*/React__default.createElement(Drawer$1, {
|
|
108
|
-
anchor: "right",
|
|
109
|
-
open: open,
|
|
110
|
-
onClose: function onClose() {
|
|
111
|
-
return setOpen(false);
|
|
112
|
-
},
|
|
113
|
-
onKeyDown: function onKeyDown(event) {
|
|
114
|
-
if (event.key === 'Escape') setOpen(false);
|
|
115
|
-
}
|
|
116
|
-
}, (logo || title) && /*#__PURE__*/React__default.createElement("div", {
|
|
117
|
-
className: "drawer__header"
|
|
118
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
119
|
-
className: "drawer__header-logo"
|
|
120
|
-
}, logo), /*#__PURE__*/React__default.createElement("div", {
|
|
121
|
-
className: "drawer__header-title"
|
|
122
|
-
}, title)), /*#__PURE__*/React__default.createElement(Divider, null), /*#__PURE__*/React__default.createElement(DrawerList, {
|
|
123
|
-
drawerList: (Array.isArray(drawerList) ? drawerList : []).filter(function (_ref2) {
|
|
124
|
-
var showInHeader = _ref2.showInHeader;
|
|
125
|
-
return showInHeader;
|
|
126
|
-
}),
|
|
127
|
-
setOpen: setOpen
|
|
128
|
-
}), /*#__PURE__*/React__default.createElement(Divider, null), Array.isArray(supportLanguages) && supportLanguages.length > 0 && /*#__PURE__*/React__default.createElement(Select, {
|
|
129
|
-
className: "drawer__lang",
|
|
130
|
-
ariaLabel: languageSelectLabel || getIntl().formatMessage({
|
|
131
|
-
id: 'aria.header.languageSelect'
|
|
132
|
-
}),
|
|
133
|
-
defaultValue: checkLanguageSupport({
|
|
134
|
-
language: locale,
|
|
135
|
-
supportLanguages: supportLanguages
|
|
136
|
-
}),
|
|
137
|
-
onChange: function onChange(value) {
|
|
138
|
-
return onLanguageChange(value);
|
|
139
|
-
},
|
|
140
|
-
options: supportLanguages
|
|
141
|
-
}), extraTools && /*#__PURE__*/React__default.createElement("div", {
|
|
142
|
-
className: "drawer__extraTools"
|
|
143
|
-
}, extraTools)));
|
|
144
|
-
};
|
|
145
|
-
Drawer.defaultProps = {
|
|
146
|
-
title: undefined,
|
|
147
|
-
logo: undefined,
|
|
148
|
-
locale: undefined,
|
|
149
|
-
supportLanguages: [
|
|
150
|
-
// { value: 'en', label: 'English' },
|
|
151
|
-
{
|
|
152
|
-
value: 'zh-tw',
|
|
153
|
-
label: '繁體中文'
|
|
154
|
-
}
|
|
155
|
-
// { value: 'zh-cn', label: '簡體中文' },
|
|
156
|
-
],
|
|
157
|
-
|
|
158
|
-
drawerList: undefined,
|
|
159
|
-
onLanguageChange: function onLanguageChange() {},
|
|
160
|
-
languageSelectLabel: undefined,
|
|
161
|
-
extraTools: undefined
|
|
162
|
-
};
|
|
163
|
-
Drawer.propTypes = {
|
|
164
|
-
title: PropTypes.string,
|
|
165
|
-
logo: PropTypes.node,
|
|
166
|
-
locale: PropTypes.string,
|
|
167
|
-
supportLanguages: PropTypes.arrayOf(PropTypes.any),
|
|
168
|
-
drawerList: PropTypes.arrayOf(PropTypes.any),
|
|
169
|
-
onLanguageChange: PropTypes.func,
|
|
170
|
-
/** 語言下拉的無障礙名稱(WCAG 3.3.2);未提供時使用套件內 aria.header.languageSelect */
|
|
171
|
-
languageSelectLabel: PropTypes.string,
|
|
172
|
-
/** 呼叫端自訂的工具區(如字級縮放);由 Header 一併傳入,窄畫面時顯示於抽屜內 */
|
|
173
|
-
extraTools: PropTypes.node
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
export { Drawer as D, checkLanguageSupport as c, defaultSupportLanguage as d };
|