@junyiacademy/ui-test 1.5.10 → 1.5.13

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.
@@ -1,7 +1,6 @@
1
1
  import { MenuItemProps } from '@mui/material';
2
2
  export interface SelectMenuItemProps extends MenuItemProps {
3
3
  value?: any;
4
- disabled?: boolean;
5
4
  }
6
- declare const SelectMenuItem: ({ children, value, disabled, ...otherProps }: SelectMenuItemProps) => JSX.Element;
5
+ declare const SelectMenuItem: ({ children, value, ...otherProps }: SelectMenuItemProps) => JSX.Element;
7
6
  export default SelectMenuItem;
@@ -35,11 +35,6 @@ const StyledButton = styles_1.styled(material_1.Button, {
35
35
  backgroundColor: styles_1.alpha(theme.palette[color].main, 0.1),
36
36
  },
37
37
  },
38
- [`&.${Button_1.buttonClasses.text}${Capitalize_1.default(color)}`]: {
39
- '&:hover': {
40
- backgroundColor: styles_1.alpha(theme.palette[color].main, 0.1),
41
- },
42
- },
43
38
  }));
44
39
  const Button = (_a) => {
45
40
  var { active, children } = _a, otherProps = tslib_1.__rest(_a, ["active", "children"]);
@@ -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 Capitalize_1 = tslib_1.__importDefault(require("../../utils/Capitalize"));
9
11
  // self-defined-components
10
- const StyledButtonGroup = styles_1.styled(material_1.ButtonGroup)(({ theme }) => ({
11
- [`& .${ButtonGroup_1.buttonGroupClasses.groupedOutlinedPrimary}.${ButtonGroup_1.buttonGroupClasses.grouped}.${ButtonGroup_1.buttonGroupClasses.disabled}`]: {
12
- borderColor: styles_1.alpha(theme.palette.primary.main, 0.5),
13
- color: styles_1.alpha(theme.palette.primary.main, 0.5),
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}${Capitalize_1.default(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) => {
@@ -5,7 +5,7 @@ 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
7
  const SelectMenuItem = (_a) => {
8
- var { children, value = '', disabled = false } = _a, otherProps = tslib_1.__rest(_a, ["children", "value", "disabled"]);
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',
11
11
  color: theme.palette.text.primary,
@@ -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: '14.5px 15px 14.5px 12px',
38
+ padding: '12.5px 15px 12.5px 12px',
42
39
  },
43
40
  },
44
41
  [`& .${OutlinedInput_1.outlinedInputClasses.input}`]: {
@@ -12,7 +12,7 @@ const OutlinedInput_1 = require("@mui/material/OutlinedInput");
12
12
  //utils
13
13
  const Capitalize_1 = tslib_1.__importDefault(require("../../utils/Capitalize"));
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,
@@ -42,18 +42,17 @@ const StyledTextField = styles_1.styled(material_1.TextField)(({ color = 'primar
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
- return (react_1.default.createElement(StyledTextField, Object.assign({ InputLabelProps: Object.assign(Object.assign({}, props.InputLabelProps), { classes: {
50
- error: InputLabel_1.inputLabelClasses.error,
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.10",
3
+ "version": "1.5.13",
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,10 @@
21
21
  "@emotion/styled": "11.6.0",
22
22
  "@mui/icons-material": "5.2.5",
23
23
  "@mui/material": "5.2.7",
24
- "@mui/styles": "5.2.3",
25
24
  "react": "17.0.2"
26
25
  },
27
26
  "devDependencies": {
27
+ "@types/lodash": "^4.14.179",
28
28
  "typescript": "~4.1.4"
29
29
  }
30
30
  }