@junyiacademy/ui-test 1.5.10 → 1.5.11

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;
@@ -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 Capitalize_1 = tslib_1.__importDefault(require("../../utils/Capitalize"));
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}${Capitalize_1.default(color)}`]: {
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}${Capitalize_1.default(color)}`]: {
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.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}${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) => {
@@ -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}`]: {
@@ -10,7 +10,7 @@ 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 Capitalize_1 = tslib_1.__importDefault(require("../../utils/Capitalize"));
13
+ const lodash_1 = tslib_1.__importDefault(require("lodash"));
14
14
  // self-defined-components
15
15
  const StyledTextField = styles_1.styled(material_1.TextField)(({ color = 'primary', theme }) => ({
16
16
  [`& .${InputLabel_1.inputLabelClasses.error}`]: {
@@ -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${Capitalize_1.default(color)}:hover:before`]: {
29
+ [`&.MuiInputBase-color${lodash_1.default.capitalize(color)}:hover:before`]: {
30
30
  borderColor: theme.palette[color].main,
31
31
  },
32
32
  },
@@ -38,7 +38,7 @@ 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${Capitalize_1.default(color)}:hover .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
41
+ [`&.MuiInputBase-color${lodash_1.default.capitalize(color)}:hover .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
42
42
  borderColor: theme.palette[color].main,
43
43
  },
44
44
  },
@@ -46,14 +46,8 @@ const StyledTextField = styles_1.styled(material_1.TextField)(({ color = 'primar
46
46
  const TextField = (props) => {
47
47
  var _a;
48
48
  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)));
49
+ const { InputLabelProps, InputProps } = props, otherProps = tslib_1.__rest(props, ["InputLabelProps", "InputProps"]);
50
+ return (react_1.default.createElement(StyledTextField, Object.assign({ InputLabelProps: Object.assign(Object.assign({}, InputLabelProps), { shrink: hasEndAdornment ? true : undefined }), InputProps: Object.assign({}, InputProps) }, otherProps)));
57
51
  };
58
52
  exports.TextField = TextField;
59
53
  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.11",
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
- "@mui/styles": "5.2.3",
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
  }