@junyiacademy/ui-test 1.5.16 → 1.6.2
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 → dist}/index.d.ts +0 -0
- package/dist/index.js +7 -0
- package/{declarations/libs/ui/src → dist}/interfaces/index.d.ts +4 -1
- package/dist/interfaces/index.js +1 -0
- package/{declarations/libs/ui/src → dist}/lib/button/Button.d.ts +0 -0
- package/dist/lib/button/Button.js +50 -0
- package/{declarations/libs/ui/src → dist}/lib/button-group/ButtonGroup.d.ts +0 -0
- package/dist/lib/button-group/ButtonGroup.js +29 -0
- package/{declarations/libs/ui/src → dist}/lib/menu-item/SelectMenuItem.d.ts +0 -0
- package/dist/lib/menu-item/SelectMenuItem.js +32 -0
- package/dist/lib/radio/Radio.d.ts +11 -0
- package/dist/lib/radio/Radio.js +47 -0
- package/dist/lib/select/OutlinedSelect.d.ts +3 -0
- package/dist/lib/select/OutlinedSelect.js +95 -0
- package/{declarations/libs/ui/src → dist}/lib/select/Select.d.ts +0 -0
- package/dist/lib/select/Select.js +22 -0
- package/dist/lib/select/StandardSelect.d.ts +3 -0
- package/dist/lib/select/StandardSelect.js +60 -0
- package/dist/lib/text-field/TextField.d.ts +3 -0
- package/dist/lib/text-field/TextField.js +78 -0
- package/{declarations/libs/ui/src → dist}/lib/topic-filter/TopicFilter.d.ts +0 -0
- package/dist/{libs/ui/src/lib → lib}/topic-filter/TopicFilter.js +21 -26
- package/dist/styles/theme.d.ts +24 -0
- package/dist/styles/theme.js +40 -0
- package/{declarations/libs/ui/src → dist}/utils/Capitalize.d.ts +0 -0
- package/dist/utils/Capitalize.js +3 -0
- package/dist/utils/topicTree.d.ts +2 -0
- package/dist/utils/topicTree.js +174 -0
- package/package.json +3 -3
- package/declarations/libs/ui/src/lib/TopicFilter.d.ts +0 -13
- package/declarations/libs/ui/src/lib/radio/Radio.d.ts +0 -10
- package/declarations/libs/ui/src/lib/select/OutlinedSelect.d.ts +0 -3
- package/declarations/libs/ui/src/lib/select/StandardSelect.d.ts +0 -3
- package/declarations/libs/ui/src/lib/text-field/TextField.d.ts +0 -3
- package/dist/libs/.DS_Store +0 -0
- package/dist/libs/ui/.DS_Store +0 -0
- package/dist/libs/ui/src/.DS_Store +0 -0
- package/dist/libs/ui/src/index.js +0 -20
- package/dist/libs/ui/src/interfaces/index.js +0 -2
- package/dist/libs/ui/src/lib/TopicFilter.js +0 -120
- package/dist/libs/ui/src/lib/button/Button.js +0 -44
- package/dist/libs/ui/src/lib/button-group/ButtonGroup.js +0 -23
- package/dist/libs/ui/src/lib/menu-item/SelectMenuItem.js +0 -20
- package/dist/libs/ui/src/lib/radio/Radio.js +0 -33
- package/dist/libs/ui/src/lib/select/OutlinedSelect.js +0 -82
- package/dist/libs/ui/src/lib/select/Select.js +0 -16
- package/dist/libs/ui/src/lib/select/StandardSelect.js +0 -65
- package/dist/libs/ui/src/lib/text-field/TextField.js +0 -68
- package/dist/libs/ui/src/utils/Capitalize.js +0 -6
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Select = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const OutlinedSelect_1 = require("./OutlinedSelect");
|
|
7
|
-
const StandardSelect_1 = require("./StandardSelect");
|
|
8
|
-
function Select(_a) {
|
|
9
|
-
var { variant } = _a, props = tslib_1.__rest(_a, ["variant"]);
|
|
10
|
-
if (variant === 'outlined') {
|
|
11
|
-
return react_1.default.createElement(OutlinedSelect_1.OutlinedSelect, Object.assign({}, props));
|
|
12
|
-
}
|
|
13
|
-
return react_1.default.createElement(StandardSelect_1.StandardSelect, Object.assign({}, props));
|
|
14
|
-
}
|
|
15
|
-
exports.Select = Select;
|
|
16
|
-
exports.default = Select;
|
|
@@ -1,65 +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("@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',
|
|
12
|
-
})(({ color, theme }) => ({
|
|
13
|
-
[`&.${InputLabel_1.inputLabelClasses.root}`]: {
|
|
14
|
-
color: theme.palette.text.disabled,
|
|
15
|
-
},
|
|
16
|
-
[`&.${InputLabel_1.inputLabelClasses.focused}`]: {
|
|
17
|
-
color: theme.palette[color].main,
|
|
18
|
-
},
|
|
19
|
-
[`&.${InputLabel_1.inputLabelClasses.error}`]: {
|
|
20
|
-
color: theme.palette.error.main,
|
|
21
|
-
},
|
|
22
|
-
}));
|
|
23
|
-
const StyledInput = styles_1.styled(material_1.Input, {
|
|
24
|
-
shouldForwardProp: (prop) => prop !== 'color',
|
|
25
|
-
})(({ color, theme }) => ({
|
|
26
|
-
color: theme.palette.text.primary,
|
|
27
|
-
[`& .${Input_1.inputClasses.input}`]: {
|
|
28
|
-
'&:focus': {
|
|
29
|
-
background: 'rgba(0,0,0,0)',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
[`&.${Input_1.inputClasses.underline}:not(.${Input_1.inputClasses.disabled}):not(.${Input_1.inputClasses.error})`]: {
|
|
33
|
-
'&:after,&:hover:before': {
|
|
34
|
-
borderBottomColor: theme.palette[color].main,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
[`&.${Input_1.inputClasses.underline}.${Input_1.inputClasses.error}:not(.${Input_1.inputClasses.disabled})`]: {
|
|
38
|
-
'&:after,&:hover:before': {
|
|
39
|
-
borderBottomColor: theme.palette.error.main,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
}));
|
|
43
|
-
function StandardSelect({ label, helperText, InputProps, SelectProps, className, children, color = 'primary', size = 'small', paperMaxHeight = 'auto', error = false, hasShrink = false, value = '', disabled = false, }) {
|
|
44
|
-
const hasHelperText = !!helperText;
|
|
45
|
-
return (react_1.default.createElement(material_1.FormControl, { variant: 'standard', color: color, size: size, disabled: disabled, error: error, className: className },
|
|
46
|
-
react_1.default.createElement(StyledInputLabel, { color: color, shrink: hasShrink ? true : undefined }, label),
|
|
47
|
-
react_1.default.createElement(material_1.Select, Object.assign({ label: label, value: value, MenuProps: {
|
|
48
|
-
PaperProps: {
|
|
49
|
-
sx: {
|
|
50
|
-
maxHeight: paperMaxHeight,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
anchorOrigin: {
|
|
54
|
-
vertical: 2,
|
|
55
|
-
horizontal: 'left',
|
|
56
|
-
},
|
|
57
|
-
transformOrigin: {
|
|
58
|
-
vertical: 'top',
|
|
59
|
-
horizontal: 'left',
|
|
60
|
-
},
|
|
61
|
-
}, input: react_1.default.createElement(StyledInput, Object.assign({ color: color }, InputProps)) }, SelectProps), children),
|
|
62
|
-
hasHelperText && react_1.default.createElement(material_1.FormHelperText, null, helperText)));
|
|
63
|
-
}
|
|
64
|
-
exports.StandardSelect = StandardSelect;
|
|
65
|
-
exports.default = StandardSelect;
|
|
@@ -1,68 +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("@mui/material/styles");
|
|
7
|
-
const material_1 = require("@mui/material");
|
|
8
|
-
const TextField_1 = require("@mui/material/TextField");
|
|
9
|
-
const Input_1 = require("@mui/material/Input");
|
|
10
|
-
const InputLabel_1 = require("@mui/material/InputLabel");
|
|
11
|
-
const OutlinedInput_1 = require("@mui/material/OutlinedInput");
|
|
12
|
-
const FormHelperText_1 = require("@mui/material/FormHelperText");
|
|
13
|
-
//utils
|
|
14
|
-
const Capitalize_1 = tslib_1.__importDefault(require("../../utils/Capitalize"));
|
|
15
|
-
// self-defined-components
|
|
16
|
-
const StyledTextField = styles_1.styled(material_1.TextField)(({ label, color = 'primary', theme }) => ({
|
|
17
|
-
[`& .${InputLabel_1.inputLabelClasses.error}`]: {
|
|
18
|
-
[`&:not(.${InputLabel_1.inputLabelClasses.shrink})`]: {
|
|
19
|
-
color: theme.palette.text.secondary,
|
|
20
|
-
},
|
|
21
|
-
[`&.${InputLabel_1.inputLabelClasses.disabled}`]: {
|
|
22
|
-
color: theme.palette.text.disabled,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
[`& .${InputLabel_1.inputLabelClasses.error}.${InputLabel_1.inputLabelClasses.focused}`]: {
|
|
26
|
-
color: theme.palette.error.main,
|
|
27
|
-
},
|
|
28
|
-
// For variant: standard | filled
|
|
29
|
-
[`& .${Input_1.inputClasses.underline}:not(.${Input_1.inputClasses.disabled})`]: {
|
|
30
|
-
[`&.MuiInputBase-color${Capitalize_1.default(color)}:hover:before`]: {
|
|
31
|
-
borderColor: theme.palette[color].main,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
// For variant: outlined
|
|
35
|
-
[`& .${Input_1.inputClasses.disabled} .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
36
|
-
borderStyle: 'dotted',
|
|
37
|
-
},
|
|
38
|
-
[`& .${Input_1.inputClasses.error}.${Input_1.inputClasses.focused} .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
39
|
-
borderColor: theme.palette.error.main,
|
|
40
|
-
},
|
|
41
|
-
[`&.${TextField_1.textFieldClasses.root} :not(.${Input_1.inputClasses.disabled}):not(.${Input_1.inputClasses.error})`]: {
|
|
42
|
-
[`&.MuiInputBase-color${Capitalize_1.default(color)}:hover .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
43
|
-
borderColor: theme.palette[color].main,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
[`& .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
47
|
-
'& > legend': {
|
|
48
|
-
maxWidth: label === '' && 0,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
}));
|
|
52
|
-
const TextField = (props) => {
|
|
53
|
-
var _a;
|
|
54
|
-
const hasEndAdornment = !!((_a = props === null || props === void 0 ? void 0 : props.InputProps) === null || _a === void 0 ? void 0 : _a.endAdornment);
|
|
55
|
-
const { InputLabelProps, InputProps } = props, otherProps = tslib_1.__rest(props, ["InputLabelProps", "InputProps"]);
|
|
56
|
-
return (react_1.default.createElement(StyledTextField, Object.assign({ InputLabelProps: Object.assign(Object.assign({}, InputLabelProps), { shrink: hasEndAdornment ? true : undefined }), FormHelperTextProps: {
|
|
57
|
-
sx: (theme) => ({
|
|
58
|
-
[`&.${FormHelperText_1.formHelperTextClasses.root}`]: {
|
|
59
|
-
marginLeft: 0,
|
|
60
|
-
[`&.${Input_1.inputClasses.error}`]: {
|
|
61
|
-
color: theme.palette.error.main,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
}),
|
|
65
|
-
}, InputProps: Object.assign({}, InputProps) }, otherProps)));
|
|
66
|
-
};
|
|
67
|
-
exports.TextField = TextField;
|
|
68
|
-
exports.default = exports.TextField;
|