@daoyi/nmtl-ui 2.0.1-beta.45 → 2.0.1-beta.47
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-5439ff22.js +333 -1
- package/lib/components/Autocomplete.js +12 -1
- package/lib/components/Avatar.js +51 -1
- package/lib/components/BackTop.js +82 -1
- package/lib/components/BarChart.js +132 -1
- package/lib/components/Breadcrumbs.js +124 -1
- package/lib/components/Button-63c7e9f3.js +91 -1
- package/lib/components/Button.js +8 -1
- package/lib/components/Carousel.js +61 -1
- package/lib/components/Checkbox.js +37 -1
- package/lib/components/CollapseContent.js +181 -1
- package/lib/components/ContactModal-a59bc808.js +924 -0
- package/lib/components/ContactModal.js +17 -1
- package/lib/components/Drawer-af3ed21a.js +157 -1
- package/lib/components/Drawer.js +13 -1
- package/lib/components/Dropdown.js +135 -1
- package/lib/components/Empty-70f040a9.js +44 -1
- package/lib/components/Empty.js +7 -1
- package/lib/components/ExportButton.js +114 -1
- package/lib/components/ExtraTools-f10a66a8.js +818 -1
- package/lib/components/ExtraTools.js +11 -1
- package/lib/components/Filter.js +90 -1
- package/lib/components/Footer.js +266 -1
- package/lib/components/ForwardLink.js +106 -1
- package/lib/components/Header.js +186 -1
- package/lib/components/Image.js +58 -1
- package/lib/components/Input.js +79 -1
- package/lib/components/InputMethod.js +23106 -1
- package/lib/components/KeywordSearch-224f84c1.js +138 -1
- package/lib/components/KeywordSearch.js +14 -1
- package/lib/components/KeywordTicker.js +182 -1
- package/lib/components/Keywords.js +292 -1
- package/lib/components/Loading.js +30 -1
- package/lib/components/MUITheme.js +255 -1
- package/lib/components/Modal-a7591b98.js +107 -1
- package/lib/components/Modal.js +11 -1
- package/lib/components/MoreButton-f15ca38e.js +109 -1
- package/lib/components/MoreButton.js +8 -1
- package/lib/components/Radio.js +81 -1
- package/lib/components/SNA.js +324 -1
- package/lib/components/Select-98a8e973.js +114 -1
- package/lib/components/Select.js +10 -1
- package/lib/components/Spin-690a3597.js +74 -1
- package/lib/components/Spin.js +8 -1
- package/lib/components/Table.js +51 -1
- package/lib/components/Tooltip-b7eb966d.js +69 -1
- package/lib/components/Tooltip.js +9 -1
- package/lib/components/_rollupPluginBabelHelpers-fde6d1c6.js +491 -1
- package/lib/components/dataExport-f418e6fe.js +56 -1
- package/lib/components/globalConfig.js +186 -1
- package/lib/components/vendor-851c6356.js +41893 -16
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -3
- package/lib/utils/_rollupPluginBabelHelpers-a6e0e6e3.js +139 -1
- package/lib/utils/arrayMerge.js +100 -1
- package/lib/utils/chunkArray.js +15 -1
- package/lib/utils/convert2HtmlEntities.js +42 -1
- package/lib/utils/domToImage.js +32 -1
- package/lib/utils/downloadGephi.js +106 -1
- package/lib/utils/exportXlsx.js +184 -1
- package/lib/utils/historyAppendSearch.js +23 -1
- package/lib/utils/isDevelopMode.js +5 -1
- package/lib/utils/parseYMD.js +36 -1
- package/lib/utils/removeDuplicateItem.js +11 -1
- package/lib/utils/sendEmail.js +39 -1
- package/lib/utils/snaDefine-6a2bcd94.js +5 -1
- package/lib/utils/snaDefine.js +1 -1
- package/lib/utils/snaPreProcess.js +84 -1
- package/lib/utils/vendor-3ec75cc9.js +1289 -1
- package/package.json +1 -1
- package/lib/components/ContactModal-d7e2f8bb.js +0 -1
- package/lib/components/globalConfig-40069b54.js +0 -1
|
@@ -1 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { s as styleInject, c as classNames } from './vendor-851c6356.js';
|
|
3
|
+
import { CircularProgress } from '@material-ui/core';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import 'react-is';
|
|
6
|
+
import '@material-ui/styles';
|
|
7
|
+
import 'react-dom';
|
|
8
|
+
|
|
9
|
+
var css_248z = ".loadingPage {\n padding: 4rem 0;\n color: #0087dc;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center; }\n";
|
|
10
|
+
styleInject(css_248z);
|
|
11
|
+
|
|
12
|
+
var Loading = function Loading(_ref) {
|
|
13
|
+
var className = _ref.className;
|
|
14
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
15
|
+
className: classNames('loadingPage', className)
|
|
16
|
+
}, /*#__PURE__*/React__default.createElement(CircularProgress, {
|
|
17
|
+
size: 80
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
Loading.defaultProps = {
|
|
21
|
+
className: undefined
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
|
|
25
|
+
Loading.propTypes = {
|
|
26
|
+
/** Css Name */
|
|
27
|
+
className: PropTypes.string
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { Loading as default };
|
|
@@ -1 +1,255 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { s as styleInject, Q as createTheme, R as merge_1 } from './vendor-851c6356.js';
|
|
4
|
+
import { CssBaseline } from '@material-ui/core';
|
|
5
|
+
import 'react-is';
|
|
6
|
+
import { ThemeProvider } from '@material-ui/styles';
|
|
7
|
+
import 'react-dom';
|
|
8
|
+
|
|
9
|
+
var fonts = ['Noto Sans TC', 'Microsoft JhengHei', 'sans-serif', '-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'];
|
|
10
|
+
|
|
11
|
+
var css_248z = "@import url(\"https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100;300;400;500;700;900&display=swap\");\n";
|
|
12
|
+
styleInject(css_248z);
|
|
13
|
+
|
|
14
|
+
const defaultColors = {
|
|
15
|
+
primaryColor: '#0087dc',
|
|
16
|
+
primaryColorFocus: '#339fe3',
|
|
17
|
+
secondaryColor: '#ffc400'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// export const commonThemeProps = ({ darkMode, colors }) => {
|
|
21
|
+
const commonTheme = _ref => {
|
|
22
|
+
let {
|
|
23
|
+
darkMode,
|
|
24
|
+
colors
|
|
25
|
+
} = _ref;
|
|
26
|
+
const {
|
|
27
|
+
primaryColor,
|
|
28
|
+
secondaryColor
|
|
29
|
+
} = colors || defaultColors;
|
|
30
|
+
const borderColor = darkMode ? '#8c8c8c' : '#d9d9d9';
|
|
31
|
+
return createTheme({
|
|
32
|
+
typography: {
|
|
33
|
+
button: {
|
|
34
|
+
textTransform: 'none'
|
|
35
|
+
},
|
|
36
|
+
fontFamily: (fonts || []).join(',')
|
|
37
|
+
},
|
|
38
|
+
palette: {
|
|
39
|
+
type: darkMode ? 'dark' : 'light',
|
|
40
|
+
primary: {
|
|
41
|
+
main: primaryColor
|
|
42
|
+
},
|
|
43
|
+
secondary: {
|
|
44
|
+
main: secondaryColor
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
shape: {
|
|
48
|
+
borderRadius: 3
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
MuiButton: {
|
|
52
|
+
variant: 'contained',
|
|
53
|
+
color: 'primary'
|
|
54
|
+
},
|
|
55
|
+
MuiSelect: {
|
|
56
|
+
// 讓下拉選單可以沿著Select下緣跳出
|
|
57
|
+
MenuProps: {
|
|
58
|
+
anchorOrigin: {
|
|
59
|
+
vertical: 'bottom',
|
|
60
|
+
horizontal: 'left'
|
|
61
|
+
},
|
|
62
|
+
transformOrigin: {
|
|
63
|
+
vertical: 'top',
|
|
64
|
+
horizontal: 'left'
|
|
65
|
+
},
|
|
66
|
+
getContentAnchorEl: null
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
MuiTypography: {
|
|
70
|
+
component: 'span'
|
|
71
|
+
} // Typography component預設為<p>,但<p>裡面放<div>會報錯,所以Typography component統一換成<span>
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
overrides: {
|
|
75
|
+
MuiPaper: {
|
|
76
|
+
root: {
|
|
77
|
+
background: 'white',
|
|
78
|
+
minWidth: 300
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
MuiSelect: {
|
|
82
|
+
root: {
|
|
83
|
+
padding: 8
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
MuiButton: {
|
|
87
|
+
root: {
|
|
88
|
+
padding: '4px 8px',
|
|
89
|
+
'&$outlined': {
|
|
90
|
+
padding: '4px 8px'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
MuiIconButton: {
|
|
95
|
+
root: {
|
|
96
|
+
padding: 8
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
// 原始12 有點太big了
|
|
100
|
+
MuiInput: {
|
|
101
|
+
root: {
|
|
102
|
+
width: '100%',
|
|
103
|
+
border: `1px solid ${borderColor}`,
|
|
104
|
+
borderRadius: 3,
|
|
105
|
+
padding: '2px 8px 0'
|
|
106
|
+
},
|
|
107
|
+
// Input 下方有一條line(MUI的) 換成border比較好看
|
|
108
|
+
underline: {
|
|
109
|
+
'&::before': {
|
|
110
|
+
display: 'none'
|
|
111
|
+
},
|
|
112
|
+
'&::after': {
|
|
113
|
+
display: 'none'
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
MuiAutocomplete: {
|
|
118
|
+
inputRoot: {
|
|
119
|
+
paddingRight: '4px !important',
|
|
120
|
+
backgroundColor: darkMode ? '#303030' : '#fff',
|
|
121
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
122
|
+
borderColor: primaryColor
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
option: {
|
|
126
|
+
textOverflow: 'ellipsis',
|
|
127
|
+
whiteSpace: 'nowrap',
|
|
128
|
+
overflow: 'hidden',
|
|
129
|
+
display: 'block',
|
|
130
|
+
minHeight: 'initial'
|
|
131
|
+
},
|
|
132
|
+
endAdornment: {
|
|
133
|
+
display: 'none'
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
MuiChip: {
|
|
137
|
+
root: {
|
|
138
|
+
height: '28px',
|
|
139
|
+
borderRadius: '2px',
|
|
140
|
+
backgroundColor: darkMode ? '#595959' : '#f5f5f5',
|
|
141
|
+
border: '1px solid',
|
|
142
|
+
borderColor
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
MuiOutlinedInput: {
|
|
146
|
+
root: {
|
|
147
|
+
borderColor,
|
|
148
|
+
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
149
|
+
borderWidth: '1px',
|
|
150
|
+
boxShadow: '0 0 0 2px rgb(24 144 255 / 20%)'
|
|
151
|
+
},
|
|
152
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
153
|
+
borderColor: '#40a9ff'
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
input: {
|
|
157
|
+
padding: '4px 11px',
|
|
158
|
+
fontSize: '14px',
|
|
159
|
+
height: '24px',
|
|
160
|
+
color: darkMode ? '#fff' : 'rgba(0, 0, 0, 0.85)'
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
// 20211011 依照MUI設計 RadioButton的顏色就是secondaryColor (若使用primaryColor有可能會造成UI不顯眼)
|
|
164
|
+
// MuiRadio: {
|
|
165
|
+
// root: {
|
|
166
|
+
// '&.MuiIconButton-colorSecondary:hover': { backgroundColor: `${primaryColor}10 !important` },
|
|
167
|
+
// '&$checked': { color: `${primaryColor} !important` },
|
|
168
|
+
// },
|
|
169
|
+
// },
|
|
170
|
+
MuiListItemIcon: {
|
|
171
|
+
root: {
|
|
172
|
+
minWidth: '32px'
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
MuiTableHead: {
|
|
176
|
+
root: {
|
|
177
|
+
background: '#fafafa'
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
MuiTableContainer: {
|
|
181
|
+
root: {
|
|
182
|
+
boxShadow: 'initial',
|
|
183
|
+
border: '1px solid #e0e0e0',
|
|
184
|
+
borderBottom: 0
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
MuiDialogTitle: {
|
|
188
|
+
root: {
|
|
189
|
+
padding: '0 4px 0 12px',
|
|
190
|
+
background: primaryColor,
|
|
191
|
+
color: 'white'
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
MuiDialogContent: {
|
|
195
|
+
root: {
|
|
196
|
+
padding: 12,
|
|
197
|
+
'&:first-child': 'initial'
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
MuiDialogActions: {
|
|
201
|
+
root: {
|
|
202
|
+
padding: 12,
|
|
203
|
+
borderTop: `1px solid ${borderColor}`
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
var MUITheme = function MUITheme(_ref) {
|
|
211
|
+
var children = _ref.children,
|
|
212
|
+
themes = _ref.themes,
|
|
213
|
+
colors = _ref.colors,
|
|
214
|
+
darkMode = _ref.darkMode;
|
|
215
|
+
// theme 外部可以自行再注入
|
|
216
|
+
// commonTheme - 共用的主題(參考antd)
|
|
217
|
+
// 兩者合一
|
|
218
|
+
// const mergeTheme = createTheme(
|
|
219
|
+
// merge(
|
|
220
|
+
// commonThemeProps({ darkMode: darkMode === undefined ? useMediaQuery('(prefers-color-scheme: light)') : darkMode, colors }),
|
|
221
|
+
// themeProps
|
|
222
|
+
// )
|
|
223
|
+
// );
|
|
224
|
+
|
|
225
|
+
var mergeTheme = merge_1(
|
|
226
|
+
// commonTheme({ darkMode: darkMode === undefined ? useMediaQuery('(prefers-color-scheme: light)') : darkMode, colors }),
|
|
227
|
+
commonTheme({
|
|
228
|
+
darkMode: darkMode,
|
|
229
|
+
colors: colors
|
|
230
|
+
}), themes);
|
|
231
|
+
return /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
232
|
+
theme: mergeTheme
|
|
233
|
+
}, /*#__PURE__*/React__default.createElement(CssBaseline, null), children);
|
|
234
|
+
};
|
|
235
|
+
MUITheme.defaultProps = {
|
|
236
|
+
children: undefined,
|
|
237
|
+
themes: undefined,
|
|
238
|
+
// themeProps: undefined,
|
|
239
|
+
colors: undefined,
|
|
240
|
+
darkMode: undefined
|
|
241
|
+
};
|
|
242
|
+
// /** 主題(請參考MUI) - Props */
|
|
243
|
+
// themeProps: PropTypes.objectOf(PropTypes.any),
|
|
244
|
+
MUITheme.propTypes = {
|
|
245
|
+
/** 內文 */
|
|
246
|
+
children: PropTypes.node,
|
|
247
|
+
/** 主題(請參考MUI) */
|
|
248
|
+
themes: PropTypes.objectOf(PropTypes.any),
|
|
249
|
+
/** 配色主色 */
|
|
250
|
+
colors: PropTypes.objectOf(PropTypes.any),
|
|
251
|
+
/** 暗黑模式是否開啟 */
|
|
252
|
+
darkMode: PropTypes.bool
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
export { MUITheme as default };
|
|
@@ -1 +1,107 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { s as styleInject, c as classNames } from './vendor-851c6356.js';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { Dialog, DialogTitle, IconButton, DialogContent, DialogActions, CircularProgress } from '@material-ui/core';
|
|
5
|
+
import { CloseSharp } from '@material-ui/icons';
|
|
6
|
+
import { B as Button } from './Button-63c7e9f3.js';
|
|
7
|
+
import { S as Spin } from './Spin-690a3597.js';
|
|
8
|
+
|
|
9
|
+
var css_248z = ".modal__title h2 {\n display: flex;\n align-items: center; }\n\n.modal__title__text {\n flex: 1;\n font-size: 16px;\n padding: 8px 0;\n color: white; }\n\n.modal__title__close {\n cursor: pointer;\n color: white; }\n\n.modal--transparent .MuiPaper-root {\n background: transparent !important;\n box-shadow: none; }\n\n.modal--transparent .modal__title {\n background: transparent !important; }\n";
|
|
10
|
+
styleInject(css_248z);
|
|
11
|
+
|
|
12
|
+
var Modal = function Modal(props) {
|
|
13
|
+
var className = props.className,
|
|
14
|
+
title = props.title,
|
|
15
|
+
children = props.children,
|
|
16
|
+
footer = props.footer,
|
|
17
|
+
cancelText = props.cancelText,
|
|
18
|
+
okText = props.okText,
|
|
19
|
+
visible = props.visible,
|
|
20
|
+
onOk = props.onOk,
|
|
21
|
+
onCancel = props.onCancel;
|
|
22
|
+
var closable = props.closable,
|
|
23
|
+
loading = props.loading,
|
|
24
|
+
fullWidth = props.fullWidth,
|
|
25
|
+
transparent = props.transparent;
|
|
26
|
+
var endIcon = loading && /*#__PURE__*/React__default.createElement(CircularProgress, {
|
|
27
|
+
size: 14
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/React__default.createElement(Dialog, {
|
|
30
|
+
className: classNames('modal', {
|
|
31
|
+
'modal--transparent': transparent
|
|
32
|
+
}, className),
|
|
33
|
+
fullWidth: fullWidth,
|
|
34
|
+
open: visible || false,
|
|
35
|
+
onClose: function onClose() {
|
|
36
|
+
return closable && onCancel();
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/React__default.createElement(DialogTitle, {
|
|
39
|
+
className: "modal__title"
|
|
40
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
41
|
+
className: "modal__title__text"
|
|
42
|
+
}, title), closable && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
43
|
+
onClick: onCancel
|
|
44
|
+
}, /*#__PURE__*/React__default.createElement(CloseSharp, {
|
|
45
|
+
className: "modal__title__close"
|
|
46
|
+
}))), /*#__PURE__*/React__default.createElement(DialogContent, null, /*#__PURE__*/React__default.createElement(Spin, {
|
|
47
|
+
spinning: loading
|
|
48
|
+
}, children)), footer !== null && /*#__PURE__*/React__default.createElement(DialogActions, null, footer === undefined && (cancelText || okText) ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, cancelText && /*#__PURE__*/React__default.createElement(Button, {
|
|
49
|
+
onClick: onCancel,
|
|
50
|
+
color: "default",
|
|
51
|
+
endIcon: endIcon,
|
|
52
|
+
disabled: loading
|
|
53
|
+
}, cancelText), okText && /*#__PURE__*/React__default.createElement(Button, {
|
|
54
|
+
onClick: onOk,
|
|
55
|
+
color: "primary",
|
|
56
|
+
endIcon: endIcon,
|
|
57
|
+
disabled: loading,
|
|
58
|
+
autoFocus: true
|
|
59
|
+
}, okText)) : footer));
|
|
60
|
+
};
|
|
61
|
+
Modal.defaultProps = {
|
|
62
|
+
className: undefined,
|
|
63
|
+
loading: undefined,
|
|
64
|
+
transparent: undefined,
|
|
65
|
+
closable: true,
|
|
66
|
+
title: undefined,
|
|
67
|
+
children: undefined,
|
|
68
|
+
fullWidth: undefined,
|
|
69
|
+
footer: undefined,
|
|
70
|
+
cancelText: 'Cancel',
|
|
71
|
+
okText: 'Ok',
|
|
72
|
+
visible: undefined,
|
|
73
|
+
onOk: function onOk() {},
|
|
74
|
+
onCancel: function onCancel() {}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
|
|
78
|
+
Modal.propTypes = {
|
|
79
|
+
/** Css Name */
|
|
80
|
+
className: PropTypes.string,
|
|
81
|
+
/** 是否正在載入中 */
|
|
82
|
+
loading: PropTypes.bool,
|
|
83
|
+
/** 是否正透明模式 */
|
|
84
|
+
transparent: PropTypes.bool,
|
|
85
|
+
/** 是否可以取消關閉(含close icon) */
|
|
86
|
+
closable: PropTypes.bool,
|
|
87
|
+
/** Modal Title */
|
|
88
|
+
title: PropTypes.node,
|
|
89
|
+
/** Modal 內容 */
|
|
90
|
+
children: PropTypes.node,
|
|
91
|
+
/** 版面是否滿版 */
|
|
92
|
+
fullWidth: PropTypes.bool,
|
|
93
|
+
/** Footer */
|
|
94
|
+
footer: PropTypes.node,
|
|
95
|
+
/** 取消文字 */
|
|
96
|
+
cancelText: PropTypes.string,
|
|
97
|
+
/** 確認文字 */
|
|
98
|
+
okText: PropTypes.string,
|
|
99
|
+
/** 是否出現 */
|
|
100
|
+
visible: PropTypes.bool,
|
|
101
|
+
/** 完成的callback */
|
|
102
|
+
onOk: PropTypes.func,
|
|
103
|
+
/** 關閉Modal */
|
|
104
|
+
onCancel: PropTypes.func
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { Modal as M };
|
package/lib/components/Modal.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
export{M as default}from
|
|
1
|
+
export { M as default } from './Modal-a7591b98.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import './vendor-851c6356.js';
|
|
4
|
+
import 'prop-types';
|
|
5
|
+
import 'react-is';
|
|
6
|
+
import '@material-ui/styles';
|
|
7
|
+
import 'react-dom';
|
|
8
|
+
import '@material-ui/core';
|
|
9
|
+
import '@material-ui/icons';
|
|
10
|
+
import './Button-63c7e9f3.js';
|
|
11
|
+
import './Spin-690a3597.js';
|
|
@@ -1 +1,109 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { s as styleInject, c as classNames } from './vendor-851c6356.js';
|
|
4
|
+
import { ExpandLess, ExpandMore } from '@material-ui/icons';
|
|
5
|
+
|
|
6
|
+
var css_248z = ".moreButton {\n width: -moz-fit-content;\n width: fit-content;\n display: flex;\n align-items: center;\n position: relative;\n margin: 1rem 0rem;\n border-radius: 8px;\n padding: 1rem 2.5rem;\n -webkit-user-select: none;\n user-select: none;\n cursor: pointer; }\n .moreButton__mask {\n transition: all 0.3s ease-in-out;\n position: absolute;\n left: 0;\n top: 0;\n border-radius: 8px;\n width: 100%;\n height: 100%;\n opacity: 0; }\n .moreButton:hover .moreButton__mask {\n opacity: 1; }\n .moreButton--shadow {\n transition: all 0.3s ease-in-out;\n border: 3px solid #ffffff;\n position: relative;\n left: 0px;\n top: 0px; }\n .moreButton--shadow:hover {\n box-shadow: initial !important;\n left: 3px;\n top: 3px; }\n .moreButton--small {\n border: 0;\n padding: 0;\n left: 0px !important;\n top: 0px !important;\n background: transparent !important;\n box-shadow: initial !important; }\n .moreButton--small .moreButton__mask {\n opacity: 0 !important; }\n .moreButton__icon {\n display: flex;\n z-index: 1; }\n .moreButton__icon--small {\n font-size: 1.5rem;\n border-radius: 45px;\n color: white !important; }\n .moreButton__text {\n z-index: 1;\n font-size: 1.5rem;\n line-height: 1.5rem;\n transition: color 0.3s ease-in-out; }\n .moreButton__text--small {\n margin-left: 0.75rem;\n font-size: 1.5rem;\n color: #0c2a4d; }\n .moreButton__text--small:hover {\n text-decoration: underline; }\n";
|
|
7
|
+
styleInject(css_248z);
|
|
8
|
+
|
|
9
|
+
var MoreButton = function MoreButton(props) {
|
|
10
|
+
var primaryColor = props.primaryColor,
|
|
11
|
+
secondaryColor = props.secondaryColor,
|
|
12
|
+
shadowColor = props.shadowColor;
|
|
13
|
+
var small = props.small,
|
|
14
|
+
enableShadow = props.enableShadow,
|
|
15
|
+
customExpandIcon = props.customExpandIcon;
|
|
16
|
+
var expand = props.expand,
|
|
17
|
+
setExpand = props.setExpand,
|
|
18
|
+
_onClick = props.onClick,
|
|
19
|
+
formatMessage = props.formatMessage;
|
|
20
|
+
var smallIcon = expand ? /*#__PURE__*/React__default.createElement(ExpandLess, {
|
|
21
|
+
className: "moreButton__icon--small",
|
|
22
|
+
style: {
|
|
23
|
+
background: shadowColor || primaryColor
|
|
24
|
+
}
|
|
25
|
+
}) : /*#__PURE__*/React__default.createElement(ExpandMore, {
|
|
26
|
+
className: "moreButton__icon--small",
|
|
27
|
+
style: {
|
|
28
|
+
background: shadowColor || primaryColor
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
var smallMessage = expand ? 'common.show.less' : 'common.show.more';
|
|
32
|
+
var message = small ? smallMessage : 'common.watch.more';
|
|
33
|
+
var largeIcon = customExpandIcon && /*#__PURE__*/React__default.createElement("img", {
|
|
34
|
+
src: customExpandIcon,
|
|
35
|
+
alt: "more"
|
|
36
|
+
});
|
|
37
|
+
var icon = small ? smallIcon : largeIcon;
|
|
38
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
39
|
+
className: classNames('moreButton', {
|
|
40
|
+
'moreButton--shadow': enableShadow
|
|
41
|
+
}, {
|
|
42
|
+
'moreButton--small': small
|
|
43
|
+
}),
|
|
44
|
+
style: {
|
|
45
|
+
color: shadowColor || 'white',
|
|
46
|
+
background: primaryColor,
|
|
47
|
+
boxShadow: enableShadow ? "3px 3px 0 0 ".concat(shadowColor) : undefined
|
|
48
|
+
},
|
|
49
|
+
onClick: function onClick() {
|
|
50
|
+
setExpand(!expand);
|
|
51
|
+
_onClick();
|
|
52
|
+
}
|
|
53
|
+
}, !enableShadow && /*#__PURE__*/React__default.createElement("div", {
|
|
54
|
+
className: "moreButton__mask",
|
|
55
|
+
style: {
|
|
56
|
+
background: secondaryColor
|
|
57
|
+
}
|
|
58
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
59
|
+
className: "moreButton__icon"
|
|
60
|
+
}, icon), /*#__PURE__*/React__default.createElement("div", {
|
|
61
|
+
className: classNames('moreButton__text', {
|
|
62
|
+
'moreButton__text--small': small
|
|
63
|
+
}),
|
|
64
|
+
style: {
|
|
65
|
+
color: small ? shadowColor || primaryColor : undefined,
|
|
66
|
+
marginLeft: icon ? '0.5rem' : undefined
|
|
67
|
+
}
|
|
68
|
+
}, formatMessage ? formatMessage({
|
|
69
|
+
id: message
|
|
70
|
+
}) : message));
|
|
71
|
+
};
|
|
72
|
+
MoreButton.defaultProps = {
|
|
73
|
+
primaryColor: '#271702',
|
|
74
|
+
// default為文學網站的主色系
|
|
75
|
+
secondaryColor: '#aa8859',
|
|
76
|
+
// default為文學網站的次色系
|
|
77
|
+
shadowColor: undefined,
|
|
78
|
+
small: false,
|
|
79
|
+
enableShadow: false,
|
|
80
|
+
expand: false,
|
|
81
|
+
customExpandIcon: undefined,
|
|
82
|
+
formatMessage: undefined,
|
|
83
|
+
setExpand: function setExpand() {},
|
|
84
|
+
onClick: function onClick() {}
|
|
85
|
+
};
|
|
86
|
+
MoreButton.propTypes = {
|
|
87
|
+
/** 按鈕主色系顏色 */
|
|
88
|
+
primaryColor: PropTypes.string,
|
|
89
|
+
/** 按鈕次色系顏色 */
|
|
90
|
+
secondaryColor: PropTypes.string,
|
|
91
|
+
/** 按鈕影子顏色 */
|
|
92
|
+
shadowColor: PropTypes.string,
|
|
93
|
+
/** 展開是否為小圖示 */
|
|
94
|
+
small: PropTypes.bool,
|
|
95
|
+
/** 是否啟動陰影模式 */
|
|
96
|
+
enableShadow: PropTypes.bool,
|
|
97
|
+
/** 客製化自己的大圖標 */
|
|
98
|
+
customExpandIcon: PropTypes.node,
|
|
99
|
+
/** 是否展開(僅有在small=true作動) */
|
|
100
|
+
expand: PropTypes.bool,
|
|
101
|
+
/** 語系翻譯的formateMessag(useIntl) */
|
|
102
|
+
formatMessage: PropTypes.func,
|
|
103
|
+
/** 設定是否展開 */
|
|
104
|
+
setExpand: PropTypes.func,
|
|
105
|
+
/** 點擊的callback */
|
|
106
|
+
onClick: PropTypes.func
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export { MoreButton as M };
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export{M as default}from
|
|
1
|
+
export { M as default } from './MoreButton-f15ca38e.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'prop-types';
|
|
4
|
+
import './vendor-851c6356.js';
|
|
5
|
+
import 'react-is';
|
|
6
|
+
import '@material-ui/styles';
|
|
7
|
+
import 'react-dom';
|
|
8
|
+
import '@material-ui/icons';
|
package/lib/components/Radio.js
CHANGED
|
@@ -1 +1,81 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { b as _objectSpread2 } from './_rollupPluginBabelHelpers-fde6d1c6.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { RadioGroup, FormControlLabel, Radio as Radio$1 } from '@material-ui/core';
|
|
5
|
+
import { s as styleInject } from './vendor-851c6356.js';
|
|
6
|
+
import 'react-is';
|
|
7
|
+
import '@material-ui/styles';
|
|
8
|
+
import 'react-dom';
|
|
9
|
+
|
|
10
|
+
var css_248z = "";
|
|
11
|
+
styleInject(css_248z);
|
|
12
|
+
|
|
13
|
+
var Radio = function Radio(props) {
|
|
14
|
+
var className = props.className,
|
|
15
|
+
name = props.name,
|
|
16
|
+
defaultValue = props.defaultValue,
|
|
17
|
+
value = props.value,
|
|
18
|
+
size = props.size,
|
|
19
|
+
style = props.style,
|
|
20
|
+
direction = props.direction; // Attributes
|
|
21
|
+
var options = props.options; // DataList
|
|
22
|
+
var _onChange = props.onChange; // Call Back functions
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/React__default.createElement(RadioGroup, {
|
|
25
|
+
className: "radioGroup",
|
|
26
|
+
style: _objectSpread2({
|
|
27
|
+
flexDirection: direction
|
|
28
|
+
}, style),
|
|
29
|
+
name: name,
|
|
30
|
+
defaultValue: defaultValue || undefined,
|
|
31
|
+
value: value || undefined,
|
|
32
|
+
onChange: function onChange(event) {
|
|
33
|
+
if (_onChange) _onChange(event.target.value);
|
|
34
|
+
}
|
|
35
|
+
}, Array.isArray(options) && options.map(function (option) {
|
|
36
|
+
return /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
37
|
+
value: option.value,
|
|
38
|
+
key: option.value,
|
|
39
|
+
control: /*#__PURE__*/React__default.createElement(Radio$1, {
|
|
40
|
+
disabled: option.disabled || false,
|
|
41
|
+
size: size,
|
|
42
|
+
className: className
|
|
43
|
+
}),
|
|
44
|
+
label: option.label
|
|
45
|
+
});
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
Radio.defaultProps = {
|
|
49
|
+
className: undefined,
|
|
50
|
+
name: undefined,
|
|
51
|
+
defaultValue: undefined,
|
|
52
|
+
value: undefined,
|
|
53
|
+
size: 'small',
|
|
54
|
+
style: undefined,
|
|
55
|
+
direction: 'row',
|
|
56
|
+
options: undefined,
|
|
57
|
+
onChange: function onChange() {}
|
|
58
|
+
};
|
|
59
|
+
Radio.propTypes = {
|
|
60
|
+
/** Css Name */
|
|
61
|
+
className: PropTypes.string,
|
|
62
|
+
/** 搭配FormControl 使用的名稱 */
|
|
63
|
+
name: PropTypes.string,
|
|
64
|
+
/** 預設內容 */
|
|
65
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
66
|
+
/** 如果你就是好想要Value */
|
|
67
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
68
|
+
/** Radio的大小 */
|
|
69
|
+
// size: PropTypes.string,
|
|
70
|
+
size: PropTypes.oneOf(['small', 'medium']),
|
|
71
|
+
/** 樣式 */
|
|
72
|
+
style: PropTypes.objectOf(PropTypes.any),
|
|
73
|
+
/** Radio的方向 */
|
|
74
|
+
direction: PropTypes.oneOf(['row', 'column']),
|
|
75
|
+
/** Radio的清單 */
|
|
76
|
+
options: PropTypes.arrayOf(PropTypes.any),
|
|
77
|
+
/** 選擇時的callback */
|
|
78
|
+
onChange: PropTypes.func
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export { Radio as default };
|