@junyiacademy/ui-test 0.0.4 → 0.0.8

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.
Files changed (31) hide show
  1. package/declarations/libs/ui/src/lib/selection-item/SelectionItem.d.ts +10 -0
  2. package/dist/libs/ui/src/lib/selection-item/SelectionItem.js +16 -0
  3. package/package.json +1 -1
  4. package/src/lib/TopicFilter.tsx +5 -14
  5. package/src/lib/menu-item/SelectMenuItem.tsx +5 -11
  6. package/src/lib/radio/Radio.stories.tsx +3 -2
  7. package/src/lib/select/OutlinedSelect.stories.tsx +79 -58
  8. package/src/lib/select/OutlinedSelect.tsx +34 -79
  9. package/src/lib/select/StandardSelect.stories.tsx +45 -29
  10. package/src/lib/select/StandardSelect.tsx +14 -50
  11. package/src/lib/text-field/TextField.stories.tsx +35 -1
  12. package/declarations/libs/ui/src/index.d.ts +0 -8
  13. package/declarations/libs/ui/src/interfaces/index.d.ts +0 -8
  14. package/declarations/libs/ui/src/lib/TopicFilter.d.ts +0 -13
  15. package/declarations/libs/ui/src/lib/button/Button.d.ts +0 -6
  16. package/declarations/libs/ui/src/lib/button-group/ButtonGroup.d.ts +0 -3
  17. package/declarations/libs/ui/src/lib/menu-item/SelectMenuItem.d.ts +0 -9
  18. package/declarations/libs/ui/src/lib/radio/Radio.d.ts +0 -10
  19. package/declarations/libs/ui/src/lib/select/OutlinedSelect.d.ts +0 -24
  20. package/declarations/libs/ui/src/lib/select/StandardSelect.d.ts +0 -20
  21. package/declarations/libs/ui/src/lib/text-field/TextField.d.ts +0 -3
  22. package/dist/libs/ui/src/index.js +0 -22
  23. package/dist/libs/ui/src/interfaces/index.js +0 -2
  24. package/dist/libs/ui/src/lib/TopicFilter.js +0 -123
  25. package/dist/libs/ui/src/lib/button/Button.js +0 -71
  26. package/dist/libs/ui/src/lib/button-group/ButtonGroup.js +0 -33
  27. package/dist/libs/ui/src/lib/menu-item/SelectMenuItem.js +0 -30
  28. package/dist/libs/ui/src/lib/radio/Radio.js +0 -43
  29. package/dist/libs/ui/src/lib/select/OutlinedSelect.js +0 -132
  30. package/dist/libs/ui/src/lib/select/StandardSelect.js +0 -105
  31. package/dist/libs/ui/src/lib/text-field/TextField.js +0 -75
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Button = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const styles_1 = require("@material-ui/core/styles");
7
- const core_1 = require("@material-ui/core");
8
- // self-defined-components
9
- const PREFIX = 'JuiButton';
10
- const classes = {
11
- outlinedPrimary: `${PREFIX}-outlinedPrimary`,
12
- outlinedSecondary: `${PREFIX}-outlinedSecondary`,
13
- textPrimary: `${PREFIX}-textPrimary`,
14
- textSecondary: `${PREFIX}-textSecondary`,
15
- disabled: `${PREFIX}-disabled`,
16
- };
17
- const StyledButton = styles_1.styled((_a) => {
18
- var { active: _active } = _a, other = tslib_1.__rest(_a, ["active"]);
19
- return (react_1.default.createElement(core_1.Button, Object.assign({ classes: classes }, other)));
20
- })(({ active, theme }) => ({
21
- [`&.${classes.outlinedPrimary}`]: {
22
- backgroundColor: active
23
- ? theme.palette.primary.main
24
- : theme.palette.common.white,
25
- color: active ? theme.palette.common.white : theme.palette.primary.main,
26
- borderColor: theme.palette.primary.main,
27
- '&:hover': {
28
- backgroundColor: active
29
- ? theme.palette.primary.main
30
- : styles_1.fade(theme.palette.primary.main, 0.1),
31
- },
32
- [`&.${classes.disabled}`]: {
33
- backgroundColor: theme.palette.common.white,
34
- borderColor: theme.palette.action.disabledBackground,
35
- color: theme.palette.action.disabled,
36
- },
37
- },
38
- [`&.${classes.outlinedSecondary}`]: {
39
- backgroundColor: active
40
- ? theme.palette.secondary.main
41
- : theme.palette.common.white,
42
- color: active ? theme.palette.common.white : theme.palette.secondary.main,
43
- borderColor: theme.palette.secondary.main,
44
- '&:hover': {
45
- backgroundColor: active
46
- ? theme.palette.secondary.main
47
- : styles_1.fade(theme.palette.secondary.main, 0.1),
48
- },
49
- [`&.${classes.disabled}`]: {
50
- backgroundColor: theme.palette.common.white,
51
- borderColor: theme.palette.action.disabledBackground,
52
- color: theme.palette.action.disabled,
53
- },
54
- },
55
- [`&.${classes.textPrimary}`]: {
56
- '&:hover': {
57
- backgroundColor: styles_1.fade(theme.palette.primary.main, 0.1),
58
- },
59
- },
60
- [`&.${classes.textSecondary}`]: {
61
- '&:hover': {
62
- backgroundColor: styles_1.fade(theme.palette.secondary.main, 0.1),
63
- },
64
- },
65
- }));
66
- const Button = (_a) => {
67
- var { active, children } = _a, otherProps = tslib_1.__rest(_a, ["active", "children"]);
68
- return (react_1.default.createElement(StyledButton, Object.assign({ active: active }, otherProps), children));
69
- };
70
- exports.Button = Button;
71
- exports.default = exports.Button;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ButtonGroup = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const styles_1 = require("@material-ui/core/styles");
7
- const core_1 = require("@material-ui/core");
8
- const PREFIX = 'JuiButtonGroup';
9
- const classes = {
10
- grouped: `${PREFIX}-grouped`,
11
- groupedOutlinedPrimary: `${PREFIX}-groupedOutlinedPrimary`,
12
- groupedOutlinedSecondary: `${PREFIX}-groupedOutlinedSecondary`,
13
- disabled: `${PREFIX}-disabled`,
14
- };
15
- const StyledButtonGroup = styles_1.styled((_a) => {
16
- var props = tslib_1.__rest(_a, []);
17
- return (react_1.default.createElement(core_1.ButtonGroup, Object.assign({ classes: classes }, props)));
18
- })(({ theme }) => ({
19
- [`& .${classes.groupedOutlinedPrimary}.${classes.grouped}.${classes.disabled}`]: {
20
- borderColor: styles_1.fade(theme.palette.primary.main, 0.5),
21
- color: styles_1.fade(theme.palette.primary.main, 0.5),
22
- },
23
- [`& .${classes.groupedOutlinedSecondary}.${classes.grouped}.${classes.disabled}`]: {
24
- borderColor: styles_1.fade(theme.palette.secondary.main, 0.5),
25
- color: styles_1.fade(theme.palette.secondary.main, 0.5),
26
- },
27
- }));
28
- const ButtonGroup = (_a) => {
29
- var { children } = _a, otherProps = tslib_1.__rest(_a, ["children"]);
30
- return (react_1.default.createElement(StyledButtonGroup, Object.assign({}, otherProps), children));
31
- };
32
- exports.ButtonGroup = ButtonGroup;
33
- exports.default = exports.ButtonGroup;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importDefault(require("react"));
5
- const styles_1 = require("@material-ui/core/styles");
6
- const core_1 = require("@material-ui/core");
7
- // self-defined-components
8
- const PREFIX = 'JuiSelectMenuItem';
9
- const classes = {
10
- menuItemRoot: `${PREFIX}-menuItem`,
11
- menuItemSelected: `${PREFIX}-menuItemSelected`,
12
- };
13
- const StyledMenuItem = styles_1.styled((_a) => {
14
- var { width: _width } = _a, props = tslib_1.__rest(_a, ["width"]);
15
- return (react_1.default.createElement(core_1.MenuItem, Object.assign({ classes: { root: classes.menuItemRoot, selected: classes.menuItemSelected } }, props)));
16
- })(({ width, theme }) => ({
17
- [`&.${classes.menuItemRoot}`]: {
18
- width: width,
19
- whiteSpace: 'unset',
20
- color: theme.palette.text.primary,
21
- },
22
- [`& .${classes.menuItemSelected}`]: {
23
- backgroundColor: '#E0E0E0',
24
- },
25
- }));
26
- const SelectMenuItem = react_1.default.forwardRef((_a, ref) => {
27
- var { width, children, value = '' } = _a, otherProps = tslib_1.__rest(_a, ["width", "children", "value"]);
28
- return (react_1.default.createElement(StyledMenuItem, Object.assign({ width: width, innerRef: ref, value: value }, otherProps), children));
29
- });
30
- exports.default = SelectMenuItem;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Radio = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const styles_1 = require("@material-ui/core/styles");
7
- const core_1 = require("@material-ui/core");
8
- const PREFIX = 'JuiRadio';
9
- const classes = {
10
- formControlLabel: `${PREFIX}-formControl-label`,
11
- formControlDisabled: `${PREFIX}-formControl-disabled`,
12
- radioChecked: `${PREFIX}-radio-checked`,
13
- };
14
- const StyledFormControlLabel = styles_1.styled((props) => (react_1.default.createElement(core_1.FormControlLabel, Object.assign({ classes: {
15
- label: classes.formControlLabel,
16
- disabled: classes.formControlDisabled,
17
- } }, props))))(({ theme }) => ({
18
- [`& .${classes.formControlLabel}`]: {
19
- color: theme.palette.text.secondary,
20
- [`&.${classes.formControlDisabled}`]: {
21
- color: theme.palette.text.disabled,
22
- },
23
- },
24
- [`& .${classes.radioChecked} + .${classes.formControlLabel}`]: {
25
- color: theme.palette.text.primary,
26
- },
27
- }));
28
- const StyledRadio = styles_1.styled((props) => (react_1.default.createElement(core_1.Radio, Object.assign({ classes: {
29
- checked: classes.radioChecked,
30
- } }, props))))(({ theme }) => ({
31
- color: theme.palette.text.primary,
32
- }));
33
- const StyledTypography = styles_1.styled(core_1.Typography)(({ theme }) => ({
34
- color: theme.palette.text.disabled,
35
- margin: '0 0 0 30px',
36
- }));
37
- const Radio = ({ checked, disabled, label, labelPlacement, value, formControlLabelProps, radioProps, color = 'secondary', size = 'medium', caption = '', }) => {
38
- return (react_1.default.createElement(react_1.default.Fragment, null,
39
- react_1.default.createElement(StyledFormControlLabel, Object.assign({ control: react_1.default.createElement(StyledRadio, Object.assign({ color: color, size: size }, radioProps)), checked: checked, disabled: disabled, label: label, labelPlacement: labelPlacement, value: value }, formControlLabelProps)),
40
- caption && (react_1.default.createElement(StyledTypography, { variant: 'body2' }, caption))));
41
- };
42
- exports.Radio = Radio;
43
- exports.default = exports.Radio;
@@ -1,132 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importDefault(require("react"));
5
- const styles_1 = require("@material-ui/core/styles");
6
- const core_1 = require("@material-ui/core");
7
- const Visibility_1 = tslib_1.__importDefault(require("@material-ui/icons/Visibility"));
8
- // self-defined-components
9
- const PREFIX = 'JuiOutlinedSelect';
10
- const classes = {
11
- inputLabelRoot: `${PREFIX}-inputLabel`,
12
- inputLabelFocused: `${PREFIX}-inputLabelFocused`,
13
- inputLabelOutlined: `${PREFIX}-inputLabelOutlined`,
14
- inputLabelMarginDense: `${PREFIX}-inputLabelMarginDense`,
15
- inputLabelShrink: `${PREFIX}-inputLabelShrink`,
16
- inputLabelError: `${PREFIX}-inputLabelError`,
17
- inputLabelDisabled: `${PREFIX}-inputLabelDisabled`,
18
- outlineInputRoot: `${PREFIX}-outlineInput`,
19
- outlineInputInput: `${PREFIX}-input`,
20
- outlineInputInputMarginDense: `${PREFIX}-inputMarginDense`,
21
- outlineInputNotchedOutline: `${PREFIX}-notchedOutline`,
22
- outlineInputDisabled: `${PREFIX}-inputDisabled`,
23
- outlineInputError: `${PREFIX}-outlinedInputError`,
24
- outlineInputAdornmentRoot: `${PREFIX}-outlineInputAdornmentRoot`,
25
- selectPaper: `${PREFIX}-menuPaper`,
26
- };
27
- const StyledFormControl = styles_1.styled((_a) => {
28
- var { color: _color, width: _width } = _a, props = tslib_1.__rest(_a, ["color", "width"]);
29
- return react_1.default.createElement(core_1.FormControl, Object.assign({}, props));
30
- })(({ color, width, theme }) => ({
31
- margin: theme.spacing(1),
32
- width: width,
33
- backgroundColor: 'white',
34
- '&:hover': {
35
- [`& :not(.${classes.outlineInputDisabled}):not(.${classes.outlineInputError}) .${classes.outlineInputNotchedOutline}`]: {
36
- borderColor: theme.palette[color].main,
37
- },
38
- },
39
- }));
40
- const StyledInputLabel = styles_1.styled((_a) => {
41
- var { color: _color } = _a, props = tslib_1.__rest(_a, ["color"]);
42
- return (react_1.default.createElement(core_1.InputLabel, Object.assign({ classes: {
43
- root: classes.inputLabelRoot,
44
- outlined: classes.inputLabelOutlined,
45
- marginDense: classes.inputLabelMarginDense,
46
- shrink: classes.inputLabelShrink,
47
- focused: classes.inputLabelFocused,
48
- disabled: classes.inputLabelDisabled,
49
- error: classes.inputLabelError,
50
- } }, props)));
51
- })(({ color, theme }) => ({
52
- [`& .${classes.inputLabelRoot}`]: {
53
- color: theme.palette.text.secondary,
54
- },
55
- [`&.${classes.inputLabelOutlined}`]: {
56
- [`&:not(.${classes.inputLabelDisabled}) .${classes.inputLabelFocused}`]: {
57
- color: theme.palette.action.active,
58
- },
59
- [`&.${classes.inputLabelMarginDense}:not(.${classes.inputLabelShrink})`]: {
60
- transform: 'translate(12px, 16px) scale(1)',
61
- },
62
- },
63
- [`&.${classes.inputLabelShrink}:not(.${classes.inputLabelError}):not(.${classes.inputLabelDisabled}).${classes.inputLabelFocused}`]: {
64
- color: theme.palette[color].main,
65
- },
66
- [`&.${classes.inputLabelShrink}.${classes.inputLabelError}:not(.${classes.inputLabelDisabled})`]: {
67
- color: theme.palette.error.main,
68
- },
69
- [`&.${classes.inputLabelMarginDense}`]: {},
70
- [`&.${classes.inputLabelShrink}`]: {
71
- backgroundColor: '#ffffff',
72
- padding: '0 2px',
73
- },
74
- }));
75
- const StyledOutlinedInput = styles_1.styled((props) => (react_1.default.createElement(core_1.OutlinedInput, Object.assign({ classes: {
76
- input: classes.outlineInputInput,
77
- inputMarginDense: classes.outlineInputInputMarginDense,
78
- notchedOutline: classes.outlineInputNotchedOutline,
79
- disabled: classes.outlineInputDisabled,
80
- error: classes.outlineInputError,
81
- } }, props))))({
82
- [`& .${classes.outlineInputInput}`]: {
83
- color: 'rgba(0, 0, 0, 0.87)',
84
- },
85
- [`& .${classes.outlineInputInputMarginDense}`]: {
86
- padding: '14.5px 15px 14.5px 12px',
87
- },
88
- [`&.${classes.outlineInputNotchedOutline}`]: {},
89
- [`&.${classes.outlineInputDisabled}`]: {},
90
- });
91
- const StyledSelect = styles_1.styled((_a) => {
92
- var { selectPaperMaxHeight: _selectPaperMaxHeight, hasAdornment: _hasAdornment, className } = _a, props = tslib_1.__rest(_a, ["selectPaperMaxHeight", "hasAdornment", "className"]);
93
- return (react_1.default.createElement(core_1.Select, Object.assign({ MenuProps: {
94
- disableAutoFocusItem: true,
95
- anchorOrigin: {
96
- vertical: 2,
97
- horizontal: 'left',
98
- },
99
- transformOrigin: {
100
- vertical: 'top',
101
- horizontal: 'left',
102
- },
103
- getContentAnchorEl: null,
104
- classes: { paper: className },
105
- } }, props)));
106
- })(({ hasAdornment, selectPaperMaxHeight }) => ({
107
- '&&': {
108
- maxHeight: selectPaperMaxHeight,
109
- left: hasAdornment ? '24px !important' : '70px',
110
- },
111
- }));
112
- const StyledInputAdornment = styles_1.styled((_a) => {
113
- var { disabled: _disabled } = _a, props = tslib_1.__rest(_a, ["disabled"]);
114
- return (react_1.default.createElement(core_1.InputAdornment, Object.assign({ classes: {
115
- root: classes.outlineInputAdornmentRoot,
116
- } }, props)));
117
- })(({ disabled, theme }) => ({
118
- [`&.${classes.outlineInputAdornmentRoot}`]: {
119
- color: disabled
120
- ? theme.palette.action.disabled
121
- : theme.palette.action.active,
122
- },
123
- }));
124
- const OutlinedSelect = ({ color = 'primary', size = 'medium', width = 'auto', selectPaperMaxHeight = 'auto', error = false, hasLabel = true, hasShrink = false, placeholder, hasHelperText = false, helperText = '', hasAdornment = false, value = '', disabled = false, SelectProps, OutlinedInputProps, children, }) => {
125
- return (react_1.default.createElement(StyledFormControl, { size: size, width: width, disabled: disabled, error: error, color: color },
126
- hasShrink && (react_1.default.createElement(StyledInputLabel, { color: color, variant: 'outlined', shrink: true }, placeholder)),
127
- hasLabel && !hasShrink && (react_1.default.createElement(StyledInputLabel, { color: color, variant: 'outlined' }, placeholder)),
128
- react_1.default.createElement(StyledSelect, Object.assign({ value: value, selectPaperMaxHeight: selectPaperMaxHeight, hasAdornment: hasAdornment, input: hasAdornment ? (react_1.default.createElement(StyledOutlinedInput, Object.assign({ color: color, label: hasLabel ? placeholder : undefined, disabled: disabled, startAdornment: react_1.default.createElement(StyledInputAdornment, { position: 'start', disabled: disabled },
129
- react_1.default.createElement(Visibility_1.default, null)) }, OutlinedInputProps))) : (react_1.default.createElement(StyledOutlinedInput, Object.assign({ color: color, label: hasLabel ? placeholder : undefined, disabled: disabled }, OutlinedInputProps))) }, SelectProps), children),
130
- hasHelperText && react_1.default.createElement(core_1.FormHelperText, null, helperText)));
131
- };
132
- exports.default = OutlinedSelect;
@@ -1,105 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StandardSelect = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const styles_1 = require("@material-ui/core/styles");
7
- const core_1 = require("@material-ui/core");
8
- const Visibility_1 = tslib_1.__importDefault(require("@material-ui/icons/Visibility"));
9
- // self-defined-components
10
- const PREFIX = 'JuiStandardSelect';
11
- const classes = {
12
- inputLabelRoot: `${PREFIX}-inputLabel`,
13
- inputLabelFocused: `${PREFIX}-inputLabelFocused`,
14
- inputLabelMarginDense: `${PREFIX}-inputLabelMarginDense`,
15
- inputLabelError: `${PREFIX}-inputLabelError`,
16
- inputRoot: `${PREFIX}-inputRoot`,
17
- inputUnderline: `${PREFIX}-inputUnderline`,
18
- inputError: `${PREFIX}-inputError`,
19
- inputDisabled: `${PREFIX}-inputDisabled`,
20
- inputAdornmentRoot: `${PREFIX}-inputAdornmentRoot`,
21
- selectPaper: `${PREFIX}-menuPaper`,
22
- selectDisabled: `${PREFIX}-selectDisabled`,
23
- };
24
- const StyledFormControl = styles_1.styled((_a) => {
25
- var { width: _width } = _a, props = tslib_1.__rest(_a, ["width"]);
26
- return (react_1.default.createElement(core_1.FormControl, Object.assign({}, props)));
27
- })(({ width, theme }) => ({
28
- width,
29
- margin: theme.spacing(0, 4, 4, 4),
30
- }));
31
- const StyledInputLabel = styles_1.styled((_a) => {
32
- var { color: _color } = _a, props = tslib_1.__rest(_a, ["color"]);
33
- return (react_1.default.createElement(core_1.InputLabel, Object.assign({ classes: {
34
- root: classes.inputLabelRoot,
35
- focused: classes.inputLabelFocused,
36
- error: classes.inputLabelError,
37
- } }, props)));
38
- })(({ color, theme }) => ({
39
- [`&.${classes.inputLabelRoot}`]: {
40
- color: theme.palette.text.disabled,
41
- margin: theme.spacing(0, 10, 1.5, 0),
42
- [`&.${classes.inputLabelFocused}`]: {
43
- color: theme.palette[color].main,
44
- },
45
- [`&.${classes.inputLabelError}`]: {
46
- color: theme.palette.error.main,
47
- },
48
- },
49
- }));
50
- const StyledSelect = styles_1.styled((_a) => {
51
- var { paperMaxHeight: _selectPaperHeight, hasAdornment: _hasAdornment, className } = _a, props = tslib_1.__rest(_a, ["paperMaxHeight", "hasAdornment", "className"]);
52
- return (react_1.default.createElement(core_1.Select, Object.assign({ MenuProps: {
53
- classes: { paper: className },
54
- transformOrigin: {
55
- vertical: 'top',
56
- horizontal: 'left',
57
- },
58
- getContentAnchorEl: null,
59
- } }, props)));
60
- })(({ hasAdornment, paperMaxHeight }) => ({
61
- '&&': {
62
- maxHeight: paperMaxHeight,
63
- left: hasAdornment ? '48px !important' : '70px',
64
- },
65
- [`&.${classes.selectDisabled}`]: {},
66
- }));
67
- const StyledInput = styles_1.styled((_a) => {
68
- var { color: _color } = _a, props = tslib_1.__rest(_a, ["color"]);
69
- return (react_1.default.createElement(core_1.Input, Object.assign({ classes: {
70
- disabled: classes.inputDisabled,
71
- root: classes.inputRoot,
72
- underline: classes.inputUnderline,
73
- error: classes.inputError,
74
- } }, props)));
75
- })(({ color, theme }) => ({
76
- [`&.${classes.inputRoot}`]: {
77
- color: theme.palette.text.primary,
78
- },
79
- [`&.${classes.inputUnderline}:not(.${classes.inputDisabled}):not(.${classes.inputError})`]: {
80
- [`&:after,&:hover:before`]: {
81
- borderBottomColor: theme.palette[color].main,
82
- },
83
- },
84
- [`&.${classes.inputUnderline}.${classes.inputError}:not(.${classes.inputDisabled})`]: {
85
- [`&:after,&:hover:before`]: {
86
- borderBottomColor: theme.palette.error.main,
87
- },
88
- },
89
- }));
90
- const StyledInputAdornment = styles_1.styled((props) => (react_1.default.createElement(core_1.InputAdornment, Object.assign({ classes: {
91
- root: classes.inputAdornmentRoot,
92
- } }, props))))(({ theme }) => ({
93
- [`&.${classes.inputAdornmentRoot}`]: {
94
- color: theme.palette.action.active,
95
- },
96
- }));
97
- function StandardSelect({ color = 'primary', size = 'medium', width = 'auto', paperMaxHeight = 'auto', error = false, hasShrink = false, placeholder, hasHelperText = false, helperText, hasAdornment = false, value = '', SelectProps, disabled = false, children, }) {
98
- return (react_1.default.createElement(StyledFormControl, { color: color, size: size, width: width, disabled: disabled, error: error },
99
- hasShrink ? (react_1.default.createElement(StyledInputLabel, { color: color, shrink: true }, placeholder)) : (react_1.default.createElement(StyledInputLabel, { color: color }, placeholder)),
100
- react_1.default.createElement(StyledSelect, Object.assign({ value: value, paperMaxHeight: paperMaxHeight, hasAdornment: hasAdornment, input: react_1.default.createElement(StyledInput, { color: color, startAdornment: hasAdornment && (react_1.default.createElement(StyledInputAdornment, { position: 'start' },
101
- react_1.default.createElement(Visibility_1.default, null))) }) }, SelectProps), children),
102
- hasHelperText && react_1.default.createElement(core_1.FormHelperText, null, helperText)));
103
- }
104
- exports.StandardSelect = StandardSelect;
105
- exports.default = StandardSelect;
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextField = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const styles_1 = require("@material-ui/core/styles");
7
- const core_1 = require("@material-ui/core");
8
- // self-defined-components
9
- const PREFIX = 'JuiTextField';
10
- const classes = {
11
- inputLabelError: `${PREFIX}-inputLabel-error`,
12
- inputLabelDisabled: `${PREFIX}-inputLabel-disabled`,
13
- inputLabelShrink: `${PREFIX}-inputLabel-shrink`,
14
- inputLabelFocused: `${PREFIX}-inputLabel-focused`,
15
- inputNotchedOutline: `${PREFIX}-input-notchedOutline`,
16
- inputUnderline: `${PREFIX}-input-underline`,
17
- inputColorSecondary: `${PREFIX}-input-colorSecondary`,
18
- inputDisabled: `${PREFIX}-input-disabled`,
19
- inputError: `${PREFIX}-input-error`,
20
- inputFocused: `${PREFIX}-input-focused`,
21
- };
22
- const StyledTextField = styles_1.styled((_a) => {
23
- var { hasEndAdornment, InputLabelProps, InputProps } = _a, otherProps = tslib_1.__rest(_a, ["hasEndAdornment", "InputLabelProps", "InputProps"]);
24
- return (react_1.default.createElement(core_1.TextField, Object.assign({ InputLabelProps: Object.assign(Object.assign({}, InputLabelProps), { classes: {
25
- error: classes.inputLabelError,
26
- disabled: classes.inputLabelDisabled,
27
- shrink: classes.inputLabelShrink,
28
- focused: classes.inputLabelFocused,
29
- }, shrink: hasEndAdornment ? true : undefined }), InputProps: Object.assign(Object.assign({}, InputProps), { classes: Object.assign({ colorSecondary: classes.inputColorSecondary, disabled: classes.inputDisabled, error: classes.inputError, focused: classes.inputFocused }, ((otherProps === null || otherProps === void 0 ? void 0 : otherProps.variant) === 'outlined'
30
- ? { notchedOutline: classes.inputNotchedOutline }
31
- : { underline: classes.inputUnderline })) }) }, otherProps)));
32
- })(({ theme }) => ({
33
- [`& .${classes.inputLabelError}`]: {
34
- [`&:not(.${classes.inputLabelShrink})`]: {
35
- color: theme.palette.text.secondary,
36
- },
37
- [`&.${classes.inputLabelDisabled}`]: {
38
- color: theme.palette.text.disabled,
39
- },
40
- },
41
- [`& .${classes.inputLabelError}.${classes.inputLabelFocused}`]: {
42
- color: theme.palette.error.main,
43
- },
44
- // For variant: standard | filled
45
- [`& .${classes.inputUnderline}:not(.${classes.inputDisabled})`]: {
46
- [`&:hover:before`]: {
47
- borderColor: theme.palette.primary.main,
48
- },
49
- [`&.${classes.inputColorSecondary}:hover:before`]: {
50
- borderColor: theme.palette.secondary.main,
51
- },
52
- },
53
- // For variant: outlined
54
- [`& .${classes.inputDisabled} .${classes.inputNotchedOutline}`]: {
55
- borderStyle: 'dotted',
56
- },
57
- [`& .${classes.inputError}.${classes.inputFocused} .${classes.inputNotchedOutline}`]: {
58
- borderColor: theme.palette.error.main,
59
- },
60
- [`& :not(.${classes.inputDisabled}):not(.${classes.inputError})`]: {
61
- [`&:hover .${classes.inputNotchedOutline}`]: {
62
- borderColor: theme.palette.primary.main,
63
- },
64
- [`&.${classes.inputColorSecondary}:hover .${classes.inputNotchedOutline}`]: {
65
- borderColor: theme.palette.secondary.main,
66
- },
67
- },
68
- }));
69
- const TextField = (props) => {
70
- var _a;
71
- const hasEndAdornment = !!((_a = props === null || props === void 0 ? void 0 : props.InputProps) === null || _a === void 0 ? void 0 : _a.endAdornment);
72
- return react_1.default.createElement(StyledTextField, Object.assign({ hasEndAdornment: hasEndAdornment }, props));
73
- };
74
- exports.TextField = TextField;
75
- exports.default = exports.TextField;