@junyiacademy/ui-test 1.4.0 → 1.5.1
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/interfaces/index.d.ts +3 -3
- package/declarations/libs/ui/src/lib/button/Button.d.ts +1 -1
- package/declarations/libs/ui/src/lib/button-group/ButtonGroup.d.ts +1 -1
- package/declarations/libs/ui/src/lib/menu-item/SelectMenuItem.d.ts +2 -3
- package/declarations/libs/ui/src/lib/radio/Radio.d.ts +1 -1
- package/declarations/libs/ui/src/lib/select/OutlinedSelect.d.ts +1 -1
- package/declarations/libs/ui/src/lib/select/StandardSelect.d.ts +1 -1
- package/declarations/libs/ui/src/lib/text-field/TextField.d.ts +1 -1
- package/dist/libs/ui/src/lib/button/Button.js +15 -24
- package/dist/libs/ui/src/lib/button-group/ButtonGroup.js +10 -19
- package/dist/libs/ui/src/lib/menu-item/SelectMenuItem.js +8 -16
- package/dist/libs/ui/src/lib/radio/Radio.js +15 -26
- package/dist/libs/ui/src/lib/select/OutlinedSelect.js +44 -84
- package/dist/libs/ui/src/lib/select/StandardSelect.js +38 -69
- package/dist/libs/ui/src/lib/text-field/TextField.js +26 -38
- package/dist/libs/ui/src/lib/topic-filter/TopicFilter.js +24 -25
- package/package.json +6 -3
- package/.eslintrc.json +0 -24
- package/.storybook/main.js +0 -9
- package/.storybook/preview.js +0 -10
- package/.storybook/tsconfig.json +0 -14
- package/.storybook/webpack.config.js +0 -84
- package/jest.config.js +0 -9
- package/src/index.ts +0 -7
- package/src/interfaces/index.tsx +0 -34
- package/src/lib/button/Button.stories.tsx +0 -50
- package/src/lib/button/Button.tsx +0 -85
- package/src/lib/button-group/ButtonGroup.stories.tsx +0 -59
- package/src/lib/button-group/ButtonGroup.tsx +0 -37
- package/src/lib/menu-item/SelectMenuItem.stories.tsx +0 -44
- package/src/lib/menu-item/SelectMenuItem.tsx +0 -48
- package/src/lib/radio/Radio.stories.tsx +0 -154
- package/src/lib/radio/Radio.tsx +0 -93
- package/src/lib/select/OutlinedSelect.tsx +0 -220
- package/src/lib/select/Select.stories.tsx +0 -306
- package/src/lib/select/Select.tsx +0 -13
- package/src/lib/select/StandardSelect.tsx +0 -178
- package/src/lib/text-field/TextField.stories.tsx +0 -160
- package/src/lib/text-field/TextField.tsx +0 -93
- package/src/lib/topic-filter/TopicFilter.stories.tsx +0 -83
- package/src/lib/topic-filter/TopicFilter.tsx +0 -209
- package/src/styles/theme.ts +0 -60
- package/src/utils/topicTree.ts +0 -197
- package/tsconfig.json +0 -16
- package/tsconfig.lib.json +0 -22
- package/tsconfig.spec.json +0 -15
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
|
-
import { SelectProps as MuiSelectProp, InputProps as MuiInputProps, OutlinedInputProps } from '@material
|
|
2
|
+
import { SelectProps as MuiSelectProp, InputProps as MuiInputProps, OutlinedInputProps } from '@mui/material';
|
|
3
3
|
export interface ITopicTreeNode {
|
|
4
4
|
childTopics: ITopicTreeNode[];
|
|
5
5
|
id: string;
|
|
@@ -17,11 +17,11 @@ export interface SelectProps extends MuiSelectProp {
|
|
|
17
17
|
SelectProps?: object | Partial<MuiSelectProp>;
|
|
18
18
|
color?: 'primary' | 'secondary';
|
|
19
19
|
size?: 'medium' | 'small';
|
|
20
|
-
width?: number | string;
|
|
21
|
-
selectMargin?: number | string;
|
|
22
20
|
paperMaxHeight?: number | string;
|
|
23
21
|
error?: boolean;
|
|
24
22
|
hasLabel?: boolean;
|
|
25
23
|
hasShrink?: boolean;
|
|
26
24
|
disabled?: boolean;
|
|
25
|
+
className?: string;
|
|
26
|
+
otherProps?: any;
|
|
27
27
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ButtonGroupProps as MuiButtonGroupProps } from '@material
|
|
1
|
+
import { ButtonGroupProps as MuiButtonGroupProps } from '@mui/material';
|
|
2
2
|
export declare const ButtonGroup: ({ children, ...otherProps }: MuiButtonGroupProps) => JSX.Element;
|
|
3
3
|
export default ButtonGroup;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MenuItemProps } from '@material
|
|
2
|
+
import { MenuItemProps } from '@mui/material';
|
|
3
3
|
export interface SelectMenuItemProps extends MenuItemProps {
|
|
4
|
-
width: number | string;
|
|
5
4
|
value?: any;
|
|
6
5
|
disabled?: boolean;
|
|
7
6
|
}
|
|
8
|
-
declare const SelectMenuItem: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<SelectMenuItemProps>, "classes" | "
|
|
7
|
+
declare const SelectMenuItem: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<SelectMenuItemProps>, "classes" | "value" | "onChange" | "children" | "onKeyUp" | "onKeyDown" | "onBlur" | "onFocus" | "defaultValue" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "disabled" | "sx" | "key" | "action" | "dense" | "selected" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "disableGutters" | "divider"> & React.RefAttributes<HTMLLIElement>>;
|
|
9
8
|
export default SelectMenuItem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RadioProps as MuiRadioProps, FormControlLabelProps } from '@material
|
|
1
|
+
import { RadioProps as MuiRadioProps, FormControlLabelProps } from '@mui/material';
|
|
2
2
|
export interface RadioProps extends FormControlLabelProps {
|
|
3
3
|
color?: 'primary' | 'secondary' | 'default';
|
|
4
4
|
size?: 'medium' | 'small';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectProps } from '../../interfaces';
|
|
2
|
-
export declare const OutlinedSelect: ({ placeholder, helperText, InputProps, SelectProps, children, color, size,
|
|
2
|
+
export declare const OutlinedSelect: ({ placeholder, helperText, InputProps, SelectProps, className, children, color, size, paperMaxHeight, error, hasLabel, hasShrink, value, disabled, }: SelectProps) => JSX.Element;
|
|
3
3
|
export default OutlinedSelect;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectProps } from '../../interfaces';
|
|
2
|
-
export declare function StandardSelect({ placeholder, helperText, InputProps, SelectProps, children, color, size,
|
|
2
|
+
export declare function StandardSelect({ placeholder, helperText, InputProps, SelectProps, className, children, color, size, paperMaxHeight, error, hasShrink, value, disabled, }: SelectProps): JSX.Element;
|
|
3
3
|
export default StandardSelect;
|
|
@@ -3,22 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Button = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const styles_1 = require("@material
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
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)));
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const Button_1 = require("@mui/material/Button");
|
|
9
|
+
const StyledButton = styles_1.styled(material_1.Button, {
|
|
10
|
+
shouldForwardProp: (prop) => prop !== 'active',
|
|
20
11
|
})(({ active, theme }) => ({
|
|
21
|
-
[`&.${
|
|
12
|
+
[`&.${Button_1.buttonClasses.outlinedPrimary}`]: {
|
|
22
13
|
backgroundColor: active
|
|
23
14
|
? theme.palette.primary.main
|
|
24
15
|
: theme.palette.common.white,
|
|
@@ -27,15 +18,15 @@ const StyledButton = styles_1.styled((_a) => {
|
|
|
27
18
|
'&:hover': {
|
|
28
19
|
backgroundColor: active
|
|
29
20
|
? theme.palette.primary.main
|
|
30
|
-
: styles_1.
|
|
21
|
+
: styles_1.alpha(theme.palette.primary.main, 0.1),
|
|
31
22
|
},
|
|
32
|
-
[`&.${
|
|
23
|
+
[`&.${Button_1.buttonClasses.disabled}`]: {
|
|
33
24
|
backgroundColor: theme.palette.common.white,
|
|
34
25
|
borderColor: theme.palette.action.disabledBackground,
|
|
35
26
|
color: theme.palette.action.disabled,
|
|
36
27
|
},
|
|
37
28
|
},
|
|
38
|
-
[`&.${
|
|
29
|
+
[`&.${Button_1.buttonClasses.outlinedSecondary}`]: {
|
|
39
30
|
backgroundColor: active
|
|
40
31
|
? theme.palette.secondary.main
|
|
41
32
|
: theme.palette.common.white,
|
|
@@ -44,22 +35,22 @@ const StyledButton = styles_1.styled((_a) => {
|
|
|
44
35
|
'&:hover': {
|
|
45
36
|
backgroundColor: active
|
|
46
37
|
? theme.palette.secondary.main
|
|
47
|
-
: styles_1.
|
|
38
|
+
: styles_1.alpha(theme.palette.secondary.main, 0.1),
|
|
48
39
|
},
|
|
49
|
-
[`&.${
|
|
40
|
+
[`&.${Button_1.buttonClasses.disabled}`]: {
|
|
50
41
|
backgroundColor: theme.palette.common.white,
|
|
51
42
|
borderColor: theme.palette.action.disabledBackground,
|
|
52
43
|
color: theme.palette.action.disabled,
|
|
53
44
|
},
|
|
54
45
|
},
|
|
55
|
-
[`&.${
|
|
46
|
+
[`&.${Button_1.buttonClasses.textPrimary}`]: {
|
|
56
47
|
'&:hover': {
|
|
57
|
-
backgroundColor: styles_1.
|
|
48
|
+
backgroundColor: styles_1.alpha(theme.palette.primary.main, 0.1),
|
|
58
49
|
},
|
|
59
50
|
},
|
|
60
|
-
[`&.${
|
|
51
|
+
[`&.${Button_1.buttonClasses.textSecondary}`]: {
|
|
61
52
|
'&:hover': {
|
|
62
|
-
backgroundColor: styles_1.
|
|
53
|
+
backgroundColor: styles_1.alpha(theme.palette.secondary.main, 0.1),
|
|
63
54
|
},
|
|
64
55
|
},
|
|
65
56
|
}));
|
|
@@ -3,26 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ButtonGroup = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const styles_1 = require("@material
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
grouped:
|
|
11
|
-
|
|
12
|
-
|
|
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),
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const ButtonGroup_1 = require("@mui/material/ButtonGroup");
|
|
9
|
+
const StyledButtonGroup = styles_1.styled(material_1.ButtonGroup)(({ theme }) => ({
|
|
10
|
+
[`& .${ButtonGroup_1.buttonGroupClasses.groupedOutlinedPrimary}.${ButtonGroup_1.buttonGroupClasses.grouped}.${ButtonGroup_1.buttonGroupClasses.disabled}`]: {
|
|
11
|
+
borderColor: styles_1.alpha(theme.palette.primary.main, 0.5),
|
|
12
|
+
color: styles_1.alpha(theme.palette.primary.main, 0.5),
|
|
22
13
|
},
|
|
23
|
-
[`& .${
|
|
24
|
-
borderColor: styles_1.
|
|
25
|
-
color: styles_1.
|
|
14
|
+
[`& .${ButtonGroup_1.buttonGroupClasses.groupedOutlinedSecondary}.${ButtonGroup_1.buttonGroupClasses.grouped}.${ButtonGroup_1.buttonGroupClasses.disabled}`]: {
|
|
15
|
+
borderColor: styles_1.alpha(theme.palette.secondary.main, 0.5),
|
|
16
|
+
color: styles_1.alpha(theme.palette.secondary.main, 0.5),
|
|
26
17
|
},
|
|
27
18
|
}));
|
|
28
19
|
const ButtonGroup = (_a) => {
|
|
@@ -2,29 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
-
const styles_1 = require("@material
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const classes = {
|
|
10
|
-
menuItemSelected: `${PREFIX}-menuItemSelected`,
|
|
11
|
-
};
|
|
12
|
-
const StyledMenuItem = styles_1.styled((_a) => {
|
|
13
|
-
var { width: _width } = _a, props = tslib_1.__rest(_a, ["width"]);
|
|
14
|
-
return (react_1.default.createElement(core_1.MenuItem, Object.assign({ classes: { selected: classes.menuItemSelected } }, props)));
|
|
15
|
-
})(({ width, theme }) => ({
|
|
16
|
-
width: width,
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const MenuItem_1 = require("@mui/material/MenuItem");
|
|
8
|
+
const StyledMenuItem = styles_1.styled(material_1.MenuItem)(({ theme }) => ({
|
|
17
9
|
whiteSpace: 'unset',
|
|
18
10
|
color: theme.palette.text.primary,
|
|
19
|
-
[`&.${
|
|
11
|
+
[`&.${MenuItem_1.menuItemClasses.selected}`]: {
|
|
20
12
|
backgroundColor: theme.palette.grey[300],
|
|
21
|
-
|
|
13
|
+
'&:hover': {
|
|
22
14
|
backgroundColor: theme.palette.grey[200],
|
|
23
15
|
},
|
|
24
16
|
},
|
|
25
17
|
}));
|
|
26
18
|
const SelectMenuItem = react_1.default.forwardRef((_a, ref) => {
|
|
27
|
-
var {
|
|
28
|
-
return (react_1.default.createElement(StyledMenuItem, Object.assign({
|
|
19
|
+
var { children, value = '' } = _a, otherProps = tslib_1.__rest(_a, ["children", "value"]);
|
|
20
|
+
return (react_1.default.createElement(StyledMenuItem, Object.assign({ value: value }, otherProps), children));
|
|
29
21
|
});
|
|
30
22
|
exports.default = SelectMenuItem;
|
|
@@ -3,41 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Radio = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const styles_1 = require("@material
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
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}`]: {
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const FormControlLabel_1 = require("@mui/material/FormControlLabel");
|
|
9
|
+
const Radio_1 = require("@mui/material/Radio");
|
|
10
|
+
const StyledFormControlLabel = styles_1.styled(material_1.FormControlLabel)(({ theme }) => ({
|
|
11
|
+
[`& .${FormControlLabel_1.formControlLabelClasses.label}`]: {
|
|
19
12
|
color: theme.palette.text.secondary,
|
|
20
|
-
[`&.${
|
|
13
|
+
[`&.${FormControlLabel_1.formControlLabelClasses.disabled}`]: {
|
|
21
14
|
color: theme.palette.text.disabled,
|
|
22
15
|
},
|
|
23
16
|
},
|
|
24
|
-
[`& .${
|
|
17
|
+
[`& .${Radio_1.radioClasses.checked} + .${FormControlLabel_1.formControlLabelClasses.label}`]: {
|
|
25
18
|
color: theme.palette.text.primary,
|
|
26
19
|
},
|
|
27
20
|
}));
|
|
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
21
|
const Radio = ({ checked, disabled, label, labelPlacement, value, formControlLabelProps, radioProps, color = 'secondary', size = 'medium', caption = '', }) => {
|
|
38
22
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
39
|
-
react_1.default.createElement(StyledFormControlLabel, Object.assign({ control: react_1.default.createElement(
|
|
40
|
-
|
|
23
|
+
react_1.default.createElement(StyledFormControlLabel, Object.assign({ control: react_1.default.createElement(material_1.Radio, Object.assign({ sx: (theme) => ({
|
|
24
|
+
color: theme.palette.text.primary,
|
|
25
|
+
}), color: color, size: size }, radioProps)), checked: checked, disabled: disabled, label: label, labelPlacement: labelPlacement, value: value }, formControlLabelProps)),
|
|
26
|
+
caption && (react_1.default.createElement(material_1.Typography, { sx: (theme) => ({
|
|
27
|
+
color: theme.palette.text.disabled,
|
|
28
|
+
margin: '0 0 0 30px',
|
|
29
|
+
}), variant: 'body2' }, caption))));
|
|
41
30
|
};
|
|
42
31
|
exports.Radio = Radio;
|
|
43
32
|
exports.default = exports.Radio;
|
|
@@ -3,121 +3,81 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OutlinedSelect = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const styles_1 = require("@material
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
inputLabelShrink: `${PREFIX}-inputLabelShrink`,
|
|
15
|
-
inputLabelError: `${PREFIX}-inputLabelError`,
|
|
16
|
-
inputLabelDisabled: `${PREFIX}-inputLabelDisabled`,
|
|
17
|
-
outlineInputInput: `${PREFIX}-input`,
|
|
18
|
-
outlineInputRoot: `${PREFIX}-inputRoot`,
|
|
19
|
-
outlineInputInputMarginDense: `${PREFIX}-inputMarginDense`,
|
|
20
|
-
outlineInputNotchedOutline: `${PREFIX}-notchedOutline`,
|
|
21
|
-
outlineInputDisabled: `${PREFIX}-inputDisabled`,
|
|
22
|
-
outlineInputError: `${PREFIX}-outlinedInputError`,
|
|
23
|
-
outlineInputFocused: `${PREFIX}-focused`,
|
|
24
|
-
selectPaper: `${PREFIX}-menuPaper`,
|
|
25
|
-
};
|
|
26
|
-
const StyledFormControl = styles_1.styled((_a) => {
|
|
27
|
-
var { color: _color, width: _width, selectMargin: _selectMargin } = _a, props = tslib_1.__rest(_a, ["color", "width", "selectMargin"]);
|
|
28
|
-
return (react_1.default.createElement(core_1.FormControl, Object.assign({}, props)));
|
|
29
|
-
})(({ color, width, selectMargin, theme }) => ({
|
|
30
|
-
width,
|
|
31
|
-
margin: selectMargin,
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const InputLabel_1 = require("@mui/material/InputLabel");
|
|
9
|
+
const OutlinedInput_1 = require("@mui/material/OutlinedInput");
|
|
10
|
+
const InputBase_1 = require("@mui/material/InputBase");
|
|
11
|
+
const StyledFormControl = styles_1.styled(material_1.FormControl, {
|
|
12
|
+
shouldForwardProp: (prop) => prop !== 'color',
|
|
13
|
+
})(({ color, theme }) => ({
|
|
32
14
|
backgroundColor: 'white',
|
|
33
15
|
'&:hover': {
|
|
34
|
-
[`& :not(.${
|
|
16
|
+
[`& :not(.${OutlinedInput_1.outlinedInputClasses.disabled}):not(.${OutlinedInput_1.outlinedInputClasses.error}) .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
35
17
|
borderColor: theme.palette[color].main,
|
|
36
18
|
},
|
|
37
19
|
},
|
|
38
20
|
}));
|
|
39
|
-
const StyledInputLabel = styles_1.styled(
|
|
40
|
-
|
|
41
|
-
return (react_1.default.createElement(core_1.InputLabel, Object.assign({ classes: {
|
|
42
|
-
outlined: classes.inputLabelOutlined,
|
|
43
|
-
marginDense: classes.inputLabelMarginDense,
|
|
44
|
-
shrink: classes.inputLabelShrink,
|
|
45
|
-
focused: classes.inputLabelFocused,
|
|
46
|
-
disabled: classes.inputLabelDisabled,
|
|
47
|
-
error: classes.inputLabelError,
|
|
48
|
-
} }, props)));
|
|
21
|
+
const StyledInputLabel = styles_1.styled(material_1.InputLabel, {
|
|
22
|
+
shouldForwardProp: (prop) => prop !== 'color',
|
|
49
23
|
})(({ color, theme }) => ({
|
|
50
24
|
color: theme.palette.text.secondary,
|
|
51
|
-
[`&.${
|
|
52
|
-
[`&:not(.${
|
|
25
|
+
[`&.${InputLabel_1.inputLabelClasses.outlined}`]: {
|
|
26
|
+
[`&:not(.${InputLabel_1.inputLabelClasses.disabled}) .${InputLabel_1.inputLabelClasses.focused}`]: {
|
|
53
27
|
color: theme.palette.action.active,
|
|
54
28
|
},
|
|
55
|
-
[`&.${
|
|
56
|
-
transform: 'translate(12px,
|
|
29
|
+
[`&.${InputLabel_1.inputLabelClasses.sizeSmall}:not(.${InputLabel_1.inputLabelClasses.shrink})`]: {
|
|
30
|
+
transform: 'translate(12px, 12px) scale(1)',
|
|
57
31
|
},
|
|
58
32
|
},
|
|
59
|
-
[`&.${
|
|
33
|
+
[`&.${InputLabel_1.inputLabelClasses.shrink}:not(.${InputLabel_1.inputLabelClasses.error}):not(.${InputLabel_1.inputLabelClasses.disabled}).${InputLabel_1.inputLabelClasses.focused}`]: {
|
|
60
34
|
color: theme.palette[color].main,
|
|
61
35
|
},
|
|
62
|
-
[`&.${
|
|
36
|
+
[`&.${InputLabel_1.inputLabelClasses.shrink}`]: {
|
|
63
37
|
backgroundColor: '#ffffff',
|
|
64
38
|
padding: '0 2px',
|
|
65
39
|
},
|
|
66
40
|
}));
|
|
67
|
-
const StyledOutlinedInput = styles_1.styled((
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
notchedOutline:
|
|
73
|
-
disabled: classes.outlineInputDisabled,
|
|
74
|
-
error: classes.outlineInputError,
|
|
75
|
-
} }, props))))(({ theme }) => ({
|
|
76
|
-
[`&.${classes.outlineInputRoot}`]: {
|
|
77
|
-
[`&.${classes.outlineInputError}.${classes.outlineInputFocused} .${classes.outlineInputNotchedOutline}`]: {
|
|
41
|
+
const StyledOutlinedInput = styles_1.styled(material_1.OutlinedInput)(({ theme }) => ({
|
|
42
|
+
[`&.${OutlinedInput_1.outlinedInputClasses.root}`]: {
|
|
43
|
+
[`&.${InputBase_1.inputBaseClasses.sizeSmall}`]: {
|
|
44
|
+
height: 48,
|
|
45
|
+
},
|
|
46
|
+
[`&.${OutlinedInput_1.outlinedInputClasses.error}.${OutlinedInput_1.outlinedInputClasses.focused} .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
78
47
|
borderColor: `${theme.palette.error.main}`,
|
|
79
48
|
},
|
|
80
|
-
[`& .${
|
|
49
|
+
[`& .${InputBase_1.inputBaseClasses.inputSizeSmall}`]: {
|
|
81
50
|
padding: '14.5px 15px 14.5px 12px',
|
|
82
51
|
},
|
|
83
52
|
},
|
|
84
|
-
[`& .${
|
|
53
|
+
[`& .${OutlinedInput_1.outlinedInputClasses.input}`]: {
|
|
85
54
|
color: theme.palette.text.primary,
|
|
86
55
|
['&:focus']: {
|
|
87
56
|
background: 'rgba(0,0,0,0)',
|
|
88
57
|
},
|
|
89
58
|
},
|
|
90
59
|
}));
|
|
91
|
-
const
|
|
92
|
-
var { paperMaxHeight: _paperMaxHeight, hasAdornment: _hasAdornment, className } = _a, props = tslib_1.__rest(_a, ["paperMaxHeight", "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: {
|
|
105
|
-
paper: className,
|
|
106
|
-
},
|
|
107
|
-
} }, props)));
|
|
108
|
-
})(({ hasAdornment, paperMaxHeight }) => ({
|
|
109
|
-
'&': {
|
|
110
|
-
maxHeight: paperMaxHeight,
|
|
111
|
-
left: hasAdornment ? '24px !important' : '70px',
|
|
112
|
-
},
|
|
113
|
-
}));
|
|
114
|
-
const OutlinedSelect = ({ placeholder, helperText, InputProps, SelectProps, children, color = 'primary', size = 'small', width = 'auto', selectMargin = 0, paperMaxHeight = 'auto', error = false, hasLabel = true, hasShrink = false, value = '', disabled = false, }) => {
|
|
115
|
-
const hasAdornment = !!(InputProps === null || InputProps === void 0 ? void 0 : InputProps.startAdornment);
|
|
60
|
+
const OutlinedSelect = ({ placeholder, helperText, InputProps, SelectProps, className, children, color = 'primary', size = 'small', paperMaxHeight = 'auto', error = false, hasLabel = true, hasShrink = false, value = '', disabled = false, }) => {
|
|
116
61
|
const hasHelperText = !!helperText;
|
|
117
|
-
return (react_1.default.createElement(StyledFormControl, { size: size,
|
|
62
|
+
return (react_1.default.createElement(StyledFormControl, { size: size, disabled: disabled, error: error, color: color, className: className },
|
|
118
63
|
hasLabel && (react_1.default.createElement(StyledInputLabel, { color: color, variant: 'outlined', shrink: hasShrink ? true : undefined }, placeholder)),
|
|
119
|
-
react_1.default.createElement(
|
|
120
|
-
|
|
64
|
+
react_1.default.createElement(material_1.Select, Object.assign({ value: value, MenuProps: {
|
|
65
|
+
PaperProps: {
|
|
66
|
+
sx: {
|
|
67
|
+
maxHeight: paperMaxHeight,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
disableAutoFocusItem: true,
|
|
71
|
+
anchorOrigin: {
|
|
72
|
+
vertical: 2,
|
|
73
|
+
horizontal: 'left',
|
|
74
|
+
},
|
|
75
|
+
transformOrigin: {
|
|
76
|
+
vertical: 'top',
|
|
77
|
+
horizontal: 'left',
|
|
78
|
+
},
|
|
79
|
+
}, input: react_1.default.createElement(StyledOutlinedInput, Object.assign({ color: color, label: hasLabel ? placeholder : undefined, disabled: disabled }, InputProps)) }, SelectProps), children),
|
|
80
|
+
hasHelperText && react_1.default.createElement(material_1.FormHelperText, null, helperText)));
|
|
121
81
|
};
|
|
122
82
|
exports.OutlinedSelect = OutlinedSelect;
|
|
123
83
|
exports.default = exports.OutlinedSelect;
|
|
@@ -3,95 +3,64 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.StandardSelect = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const styles_1 = require("@material
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
inputLabelMarginDense: `${PREFIX}-inputLabelMarginDense`,
|
|
13
|
-
inputLabelError: `${PREFIX}-inputLabelError`,
|
|
14
|
-
inputFocused: `${PREFIX}-inputFocused`,
|
|
15
|
-
inputInput: `${PREFIX}-input`,
|
|
16
|
-
inputUnderline: `${PREFIX}-inputUnderline`,
|
|
17
|
-
inputError: `${PREFIX}-inputError`,
|
|
18
|
-
inputDisabled: `${PREFIX}-inputDisabled`,
|
|
19
|
-
inputAdornmentRoot: `${PREFIX}-inputAdornmentRoot`,
|
|
20
|
-
selectPaper: `${PREFIX}-menuPaper`,
|
|
21
|
-
selectDisabled: `${PREFIX}-selectDisabled`,
|
|
22
|
-
};
|
|
23
|
-
const StyledFormControl = styles_1.styled((_a) => {
|
|
24
|
-
var { width: _width, selectMargin: _selectMargin } = _a, props = tslib_1.__rest(_a, ["width", "selectMargin"]);
|
|
25
|
-
return (react_1.default.createElement(core_1.FormControl, Object.assign({}, props)));
|
|
26
|
-
})(({ width, selectMargin, theme }) => ({
|
|
27
|
-
width,
|
|
28
|
-
margin: selectMargin,
|
|
29
|
-
}));
|
|
30
|
-
const StyledInputLabel = styles_1.styled((_a) => {
|
|
31
|
-
var { color: _color } = _a, props = tslib_1.__rest(_a, ["color"]);
|
|
32
|
-
return (react_1.default.createElement(core_1.InputLabel, Object.assign({ classes: {
|
|
33
|
-
focused: classes.inputLabelFocused,
|
|
34
|
-
error: classes.inputLabelError,
|
|
35
|
-
} }, props)));
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const InputLabel_1 = require("@mui/material/InputLabel");
|
|
9
|
+
const Input_1 = require("@mui/material/Input");
|
|
10
|
+
const StyledInputLabel = styles_1.styled(material_1.InputLabel, {
|
|
11
|
+
shouldForwardProp: (prop) => prop !== 'color',
|
|
36
12
|
})(({ color, theme }) => ({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
13
|
+
[`&.${InputLabel_1.inputLabelClasses.root}`]: {
|
|
14
|
+
color: theme.palette.text.disabled,
|
|
15
|
+
},
|
|
16
|
+
[`&.${InputLabel_1.inputLabelClasses.focused}`]: {
|
|
40
17
|
color: theme.palette[color].main,
|
|
41
18
|
},
|
|
42
|
-
[`&.${
|
|
19
|
+
[`&.${InputLabel_1.inputLabelClasses.error}`]: {
|
|
43
20
|
color: theme.palette.error.main,
|
|
44
21
|
},
|
|
45
22
|
}));
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
return (react_1.default.createElement(core_1.Select, Object.assign({ MenuProps: {
|
|
49
|
-
classes: { paper: className },
|
|
50
|
-
transformOrigin: {
|
|
51
|
-
vertical: 'top',
|
|
52
|
-
horizontal: 'left',
|
|
53
|
-
},
|
|
54
|
-
getContentAnchorEl: null,
|
|
55
|
-
} }, props)));
|
|
56
|
-
})(({ hasAdornment, paperMaxHeight }) => ({
|
|
57
|
-
'&&': {
|
|
58
|
-
maxHeight: paperMaxHeight,
|
|
59
|
-
left: hasAdornment ? '48px !important' : '70px',
|
|
60
|
-
},
|
|
61
|
-
}));
|
|
62
|
-
const StyledInput = styles_1.styled((_a) => {
|
|
63
|
-
var { color: _color } = _a, props = tslib_1.__rest(_a, ["color"]);
|
|
64
|
-
return (react_1.default.createElement(core_1.Input, Object.assign({ classes: {
|
|
65
|
-
input: classes.inputInput,
|
|
66
|
-
disabled: classes.inputDisabled,
|
|
67
|
-
underline: classes.inputUnderline,
|
|
68
|
-
error: classes.inputError,
|
|
69
|
-
} }, props)));
|
|
23
|
+
const StyledInput = styles_1.styled(material_1.Input, {
|
|
24
|
+
shouldForwardProp: (prop) => prop !== 'color',
|
|
70
25
|
})(({ color, theme }) => ({
|
|
71
26
|
color: theme.palette.text.primary,
|
|
72
|
-
[`& .${
|
|
73
|
-
|
|
27
|
+
[`& .${Input_1.inputClasses.input}`]: {
|
|
28
|
+
'&:focus': {
|
|
74
29
|
background: 'rgba(0,0,0,0)',
|
|
75
30
|
},
|
|
76
31
|
},
|
|
77
|
-
[`&.${
|
|
78
|
-
|
|
32
|
+
[`&.${Input_1.inputClasses.underline}:not(.${Input_1.inputClasses.disabled}):not(.${Input_1.inputClasses.error})`]: {
|
|
33
|
+
'&:after,&:hover:before': {
|
|
79
34
|
borderBottomColor: theme.palette[color].main,
|
|
80
35
|
},
|
|
81
36
|
},
|
|
82
|
-
[`&.${
|
|
83
|
-
|
|
37
|
+
[`&.${Input_1.inputClasses.underline}.${Input_1.inputClasses.error}:not(.${Input_1.inputClasses.disabled})`]: {
|
|
38
|
+
'&:after,&:hover:before': {
|
|
84
39
|
borderBottomColor: theme.palette.error.main,
|
|
85
40
|
},
|
|
86
41
|
},
|
|
87
42
|
}));
|
|
88
|
-
function StandardSelect({ placeholder, helperText, InputProps, SelectProps, children, color = 'primary', size = 'small',
|
|
89
|
-
const hasAdornment = !!(InputProps === null || InputProps === void 0 ? void 0 : InputProps.startAdornment);
|
|
43
|
+
function StandardSelect({ placeholder, helperText, InputProps, SelectProps, className, children, color = 'primary', size = 'small', paperMaxHeight = 'auto', error = false, hasShrink = false, value = '', disabled = false, }) {
|
|
90
44
|
const hasHelperText = !!helperText;
|
|
91
|
-
return (react_1.default.createElement(
|
|
45
|
+
return (react_1.default.createElement(material_1.FormControl, { variant: 'standard', color: color, size: size, disabled: disabled, error: error, className: className },
|
|
92
46
|
react_1.default.createElement(StyledInputLabel, { color: color, shrink: hasShrink ? true : undefined }, placeholder),
|
|
93
|
-
react_1.default.createElement(
|
|
94
|
-
|
|
47
|
+
react_1.default.createElement(material_1.Select, Object.assign({ value: value, MenuProps: {
|
|
48
|
+
PaperProps: {
|
|
49
|
+
sx: {
|
|
50
|
+
maxHeight: paperMaxHeight,
|
|
51
|
+
top: '30px !important',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
anchorOrigin: {
|
|
55
|
+
vertical: 2,
|
|
56
|
+
horizontal: 'left',
|
|
57
|
+
},
|
|
58
|
+
transformOrigin: {
|
|
59
|
+
vertical: 'top',
|
|
60
|
+
horizontal: 'left',
|
|
61
|
+
},
|
|
62
|
+
}, input: react_1.default.createElement(StyledInput, Object.assign({ color: color }, InputProps)) }, SelectProps), children),
|
|
63
|
+
hasHelperText && react_1.default.createElement(material_1.FormHelperText, null, helperText)));
|
|
95
64
|
}
|
|
96
65
|
exports.StandardSelect = StandardSelect;
|
|
97
66
|
exports.default = StandardSelect;
|