@junyiacademy/ui-test 1.5.9 → 1.5.12
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/declarations/libs/ui/src/lib/menu-item/SelectMenuItem.d.ts +1 -3
- package/dist/libs/ui/src/lib/button/Button.js +3 -8
- package/dist/libs/ui/src/lib/button-group/ButtonGroup.js +6 -8
- package/dist/libs/ui/src/lib/menu-item/SelectMenuItem.js +2 -2
- package/dist/libs/ui/src/lib/select/OutlinedSelect.js +1 -4
- package/dist/libs/ui/src/lib/text-field/TextField.js +11 -12
- package/package.json +3 -2
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { MenuItemProps } from '@mui/material';
|
|
3
2
|
export interface SelectMenuItemProps extends MenuItemProps {
|
|
4
3
|
value?: any;
|
|
5
|
-
disabled?: boolean;
|
|
6
4
|
}
|
|
7
|
-
declare const SelectMenuItem:
|
|
5
|
+
declare const SelectMenuItem: ({ children, value, ...otherProps }: SelectMenuItemProps) => JSX.Element;
|
|
8
6
|
export default SelectMenuItem;
|
|
@@ -7,12 +7,12 @@ const styles_1 = require("@mui/material/styles");
|
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const Button_1 = require("@mui/material/Button");
|
|
9
9
|
//utils
|
|
10
|
-
const
|
|
10
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
11
11
|
const StyledButton = styles_1.styled(material_1.Button, {
|
|
12
12
|
shouldForwardProp: (prop) => prop !== 'active',
|
|
13
13
|
})(({ active, color = 'primary', theme }) => ({
|
|
14
14
|
// For variant: outlined
|
|
15
|
-
[`&.${Button_1.buttonClasses.outlined}${
|
|
15
|
+
[`&.${Button_1.buttonClasses.outlined}${lodash_1.default.capitalize(color)}`]: {
|
|
16
16
|
backgroundColor: active
|
|
17
17
|
? theme.palette[color].main
|
|
18
18
|
: theme.palette.common.white,
|
|
@@ -30,12 +30,7 @@ const StyledButton = styles_1.styled(material_1.Button, {
|
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
// For variant: text
|
|
33
|
-
[`&.${Button_1.buttonClasses.text}${
|
|
34
|
-
'&:hover': {
|
|
35
|
-
backgroundColor: styles_1.alpha(theme.palette[color].main, 0.1),
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
[`&.${Button_1.buttonClasses.text}${Capitalize_1.default(color)}`]: {
|
|
33
|
+
[`&.${Button_1.buttonClasses.text}${lodash_1.default.capitalize(color)}`]: {
|
|
39
34
|
'&:hover': {
|
|
40
35
|
backgroundColor: styles_1.alpha(theme.palette[color].main, 0.1),
|
|
41
36
|
},
|
|
@@ -6,15 +6,13 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const styles_1 = require("@mui/material/styles");
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const ButtonGroup_1 = require("@mui/material/ButtonGroup");
|
|
9
|
+
//utils
|
|
10
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
9
11
|
// self-defined-components
|
|
10
|
-
const StyledButtonGroup = styles_1.styled(material_1.ButtonGroup)(({ theme }) => ({
|
|
11
|
-
[`& .${ButtonGroup_1.buttonGroupClasses.
|
|
12
|
-
borderColor: styles_1.alpha(theme.palette.
|
|
13
|
-
color: styles_1.alpha(theme.palette.
|
|
14
|
-
},
|
|
15
|
-
[`& .${ButtonGroup_1.buttonGroupClasses.groupedOutlinedSecondary}.${ButtonGroup_1.buttonGroupClasses.grouped}.${ButtonGroup_1.buttonGroupClasses.disabled}`]: {
|
|
16
|
-
borderColor: styles_1.alpha(theme.palette.secondary.main, 0.5),
|
|
17
|
-
color: styles_1.alpha(theme.palette.secondary.main, 0.5),
|
|
12
|
+
const StyledButtonGroup = styles_1.styled(material_1.ButtonGroup)(({ color = 'primary', theme }) => ({
|
|
13
|
+
[`& .${ButtonGroup_1.buttonGroupClasses.groupedOutlined}${lodash_1.default.capitalize(color)}.${ButtonGroup_1.buttonGroupClasses.grouped}.${ButtonGroup_1.buttonGroupClasses.disabled}`]: {
|
|
14
|
+
borderColor: styles_1.alpha(theme.palette[color].main, 0.5),
|
|
15
|
+
color: styles_1.alpha(theme.palette[color].main, 0.5),
|
|
18
16
|
},
|
|
19
17
|
}));
|
|
20
18
|
const ButtonGroup = (_a) => {
|
|
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const MenuItem_1 = require("@mui/material/MenuItem");
|
|
7
|
-
const SelectMenuItem =
|
|
7
|
+
const SelectMenuItem = (_a) => {
|
|
8
8
|
var { children, value = '' } = _a, otherProps = tslib_1.__rest(_a, ["children", "value"]);
|
|
9
9
|
return (react_1.default.createElement(material_1.MenuItem, Object.assign({ sx: (theme) => ({
|
|
10
10
|
whiteSpace: 'unset',
|
|
@@ -16,5 +16,5 @@ const SelectMenuItem = react_1.default.forwardRef((_a) => {
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
}), value: value }, otherProps), children));
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
exports.default = SelectMenuItem;
|
|
@@ -31,14 +31,11 @@ const StyledInputLabel = styles_1.styled(material_1.InputLabel, {
|
|
|
31
31
|
}));
|
|
32
32
|
const StyledOutlinedInput = styles_1.styled(material_1.OutlinedInput)(({ theme }) => ({
|
|
33
33
|
[`&.${OutlinedInput_1.outlinedInputClasses.root}`]: {
|
|
34
|
-
[`&.${InputBase_1.inputBaseClasses.sizeSmall}`]: {
|
|
35
|
-
height: 48,
|
|
36
|
-
},
|
|
37
34
|
[`&.${OutlinedInput_1.outlinedInputClasses.error}.${OutlinedInput_1.outlinedInputClasses.focused} .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
38
35
|
borderColor: `${theme.palette.error.main}`,
|
|
39
36
|
},
|
|
40
37
|
[`& .${InputBase_1.inputBaseClasses.inputSizeSmall}`]: {
|
|
41
|
-
padding: '
|
|
38
|
+
padding: '12.5px 15px 12.5px 12px',
|
|
42
39
|
},
|
|
43
40
|
},
|
|
44
41
|
[`& .${OutlinedInput_1.outlinedInputClasses.input}`]: {
|
|
@@ -10,9 +10,9 @@ const Input_1 = require("@mui/material/Input");
|
|
|
10
10
|
const InputLabel_1 = require("@mui/material/InputLabel");
|
|
11
11
|
const OutlinedInput_1 = require("@mui/material/OutlinedInput");
|
|
12
12
|
//utils
|
|
13
|
-
const
|
|
13
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
14
14
|
// self-defined-components
|
|
15
|
-
const StyledTextField = styles_1.styled(material_1.TextField)(({ color = 'primary', theme }) => ({
|
|
15
|
+
const StyledTextField = styles_1.styled(material_1.TextField)(({ label, color = 'primary', theme }) => ({
|
|
16
16
|
[`& .${InputLabel_1.inputLabelClasses.error}`]: {
|
|
17
17
|
[`&:not(.${InputLabel_1.inputLabelClasses.shrink})`]: {
|
|
18
18
|
color: theme.palette.text.secondary,
|
|
@@ -26,7 +26,7 @@ const StyledTextField = styles_1.styled(material_1.TextField)(({ color = 'primar
|
|
|
26
26
|
},
|
|
27
27
|
// For variant: standard | filled
|
|
28
28
|
[`& .${Input_1.inputClasses.underline}:not(.${Input_1.inputClasses.disabled})`]: {
|
|
29
|
-
[`&.MuiInputBase-color${
|
|
29
|
+
[`&.MuiInputBase-color${lodash_1.default.capitalize(color)}:hover:before`]: {
|
|
30
30
|
borderColor: theme.palette[color].main,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
@@ -38,22 +38,21 @@ const StyledTextField = styles_1.styled(material_1.TextField)(({ color = 'primar
|
|
|
38
38
|
borderColor: theme.palette.error.main,
|
|
39
39
|
},
|
|
40
40
|
[`&.${TextField_1.textFieldClasses.root} :not(.${Input_1.inputClasses.disabled}):not(.${Input_1.inputClasses.error})`]: {
|
|
41
|
-
[`&.MuiInputBase-color${
|
|
41
|
+
[`&.MuiInputBase-color${lodash_1.default.capitalize(color)}:hover .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
42
42
|
borderColor: theme.palette[color].main,
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
|
+
[`& .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
46
|
+
'& > legend': {
|
|
47
|
+
maxWidth: label === '' && 0,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
45
50
|
}));
|
|
46
51
|
const TextField = (props) => {
|
|
47
52
|
var _a;
|
|
48
53
|
const hasEndAdornment = !!((_a = props === null || props === void 0 ? void 0 : props.InputProps) === null || _a === void 0 ? void 0 : _a.endAdornment);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
disabled: InputLabel_1.inputLabelClasses.disabled,
|
|
52
|
-
shrink: InputLabel_1.inputLabelClasses.shrink,
|
|
53
|
-
focused: InputLabel_1.inputLabelClasses.focused,
|
|
54
|
-
}, shrink: hasEndAdornment ? true : undefined }), InputProps: Object.assign(Object.assign({}, props.InputProps), { classes: Object.assign({ colorSecondary: Input_1.inputClasses.colorSecondary, disabled: Input_1.inputClasses.disabled, error: Input_1.inputClasses.error, focused: Input_1.inputClasses.focused }, ((props === null || props === void 0 ? void 0 : props.variant) === 'outlined'
|
|
55
|
-
? { notchedOutline: OutlinedInput_1.outlinedInputClasses.notchedOutline }
|
|
56
|
-
: { underline: Input_1.inputClasses.underline })) }) }, props)));
|
|
54
|
+
const { InputLabelProps, InputProps } = props, otherProps = tslib_1.__rest(props, ["InputLabelProps", "InputProps"]);
|
|
55
|
+
return (react_1.default.createElement(StyledTextField, Object.assign({ InputLabelProps: Object.assign(Object.assign({}, InputLabelProps), { shrink: hasEndAdornment ? true : undefined }), InputProps: Object.assign({}, InputProps) }, otherProps)));
|
|
57
56
|
};
|
|
58
57
|
exports.TextField = TextField;
|
|
59
58
|
exports.default = exports.TextField;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junyiacademy/ui-test",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.12",
|
|
4
4
|
"description": "junyiacademy ui library",
|
|
5
5
|
"main": "./dist/libs/ui/src/index.js",
|
|
6
6
|
"typings": "./declarations/libs/ui/src/index.d.ts",
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"@emotion/styled": "11.6.0",
|
|
22
22
|
"@mui/icons-material": "5.2.5",
|
|
23
23
|
"@mui/material": "5.2.7",
|
|
24
|
-
"
|
|
24
|
+
"lodash": "^4.17.21",
|
|
25
25
|
"react": "17.0.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
+
"@types/lodash": "^4.14.179",
|
|
28
29
|
"typescript": "~4.1.4"
|
|
29
30
|
}
|
|
30
31
|
}
|