@lunit/oui 2.4.0 → 2.4.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/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Pagination/Pagination.js +2 -4
- package/dist/components/Pagination/Pagination.styled.js +1 -1
- package/dist/components/Pagination/Pagination.types.d.ts +0 -1
- package/dist/components/TextField/components/Buttons.js +2 -12
- package/dist/components/TextField/components/NormalTextInput.js +1 -1
- package/dist/components/TextField/components/PasswordInput.js +13 -2
- package/dist/presentations/AnalysisBar/AnalysisBar.styled.js +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PaginationProps } from './Pagination.types';
|
|
2
|
-
declare function Pagination({
|
|
2
|
+
declare function Pagination({ page: selectedPage, perPage: selectedPerPage, totalPage, onPageChange, onPerPageChange, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Pagination;
|
|
@@ -4,14 +4,12 @@ import { ArrowDown } from '../../icons';
|
|
|
4
4
|
import { Divider } from '../Divider';
|
|
5
5
|
import { MenuItem, Menu } from '../Menu';
|
|
6
6
|
import { PaperProps, PaginationBox, SidePageBox, SelectButton, ArrowButton, PAGE_SIZE_LIST, divider, } from './Pagination.styled';
|
|
7
|
-
function Pagination({
|
|
7
|
+
function Pagination({ page: selectedPage = 1, perPage: selectedPerPage, totalPage, onPageChange, onPerPageChange, }) {
|
|
8
8
|
const [perPageAnchorEl, setPerPageAnchorEl] = useState(null);
|
|
9
9
|
const [pageAnchorEl, setPageAnchorEl] = useState(null);
|
|
10
10
|
const perPageOpen = Boolean(perPageAnchorEl);
|
|
11
11
|
const pageOpen = Boolean(pageAnchorEl);
|
|
12
12
|
const pages = useMemo(() => Array.from({ length: totalPage }, (_, index) => index + 1), [totalPage]);
|
|
13
|
-
const startItemNumber = selectedPerPage * (selectedPage - 1) + 1;
|
|
14
|
-
const endItemNumber = Math.min(startItemNumber + selectedPerPage - 1, itemCount);
|
|
15
13
|
const handlePerPageClick = (event) => {
|
|
16
14
|
setPerPageAnchorEl(event.currentTarget);
|
|
17
15
|
};
|
|
@@ -41,7 +39,7 @@ function Pagination({ count: itemCount, page: selectedPage = 1, perPage: selecte
|
|
|
41
39
|
event.preventDefault();
|
|
42
40
|
onPerPageChange?.(event, perPage);
|
|
43
41
|
handlePerPageClose();
|
|
44
|
-
}, label: perPage }, perPage))) }), _jsx(Divider, { orientation: "vertical", sx: divider })
|
|
42
|
+
}, label: perPage }, perPage))) }), _jsx(Divider, { orientation: "vertical", sx: divider })] }), _jsxs(SidePageBox, { children: ["This page", _jsx(SelectButton, { id: "selected-page", endIcon: _jsx(ArrowDown, { style: {
|
|
45
43
|
transform: pageOpen ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
46
44
|
} }), onClick: handlePageClick, children: selectedPage }), _jsx(Menu, { showCheck: true, anchorEl: pageAnchorEl, anchorOrigin: {
|
|
47
45
|
vertical: 'top',
|
|
@@ -5,7 +5,7 @@ export const PAGE_SIZE_LIST = [25, 50, 75, 100];
|
|
|
5
5
|
export const PaginationBox = styled(Box)(({ theme }) => ({
|
|
6
6
|
...theme.typography.body5,
|
|
7
7
|
display: 'flex',
|
|
8
|
-
justifyContent: '
|
|
8
|
+
justifyContent: 'flex-end',
|
|
9
9
|
alignItems: 'center',
|
|
10
10
|
borderTop: `1px solid ${theme.palette.neutralGrey[90]}`,
|
|
11
11
|
height: '48px',
|
|
@@ -2,20 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { CloseSmall, HideSmall, ShowSmall } from '../../../icons';
|
|
3
3
|
import { ButtonWrapper } from '../TextInput.styled';
|
|
4
4
|
function ClearButton({ onClick }) {
|
|
5
|
-
return (_jsx(ButtonWrapper, { onClick: onClick,
|
|
6
|
-
if (event.key === 'Enter') {
|
|
7
|
-
event.preventDefault();
|
|
8
|
-
event.stopPropagation();
|
|
9
|
-
}
|
|
10
|
-
}, children: _jsx(CloseSmall, { fontSize: "small" }) }));
|
|
5
|
+
return (_jsx(ButtonWrapper, { onClick: onClick, children: _jsx(CloseSmall, { fontSize: "small" }) }));
|
|
11
6
|
}
|
|
12
7
|
function ShowHidePasswordButton({ onClick, isHidden, }) {
|
|
13
|
-
return (_jsx(ButtonWrapper, { onClick: onClick,
|
|
14
|
-
if (event.key === 'Enter') {
|
|
15
|
-
event.preventDefault();
|
|
16
|
-
event.stopPropagation();
|
|
17
|
-
}
|
|
18
|
-
}, children: isHidden ? _jsx(HideSmall, {}) : _jsx(ShowSmall, {}) }));
|
|
8
|
+
return (_jsx(ButtonWrapper, { onClick: onClick, children: isHidden ? _jsx(HideSmall, {}) : _jsx(ShowSmall, {}) }));
|
|
19
9
|
}
|
|
20
10
|
function FileInputWrapperButton({ children, onClick, width, }) {
|
|
21
11
|
return (_jsx("button", { onClick: onClick, style: {
|
|
@@ -5,7 +5,7 @@ import { BaseTextInput, LeftIconContainer, RightIconContainer } from '../TextInp
|
|
|
5
5
|
import { ClearButton } from './Buttons';
|
|
6
6
|
const NormalTextInput = forwardRef((props, ref) => {
|
|
7
7
|
const { error, helperMsg, leftIcon, rightIcon, onClearButtonClick, inputSX, ...inputProps } = props;
|
|
8
|
-
const [showClear, setShowClear] = useState(!!props.defaultValue
|
|
8
|
+
const [showClear, setShowClear] = useState(!!props.defaultValue);
|
|
9
9
|
const showRightIcon = useMemo(() => {
|
|
10
10
|
return (rightIcon ?? // if rightIcon is passed, use it, else use clear button
|
|
11
11
|
(!props.disabled && // hide if disabled
|
|
@@ -11,11 +11,22 @@ function PasswordInputContainer(props) {
|
|
|
11
11
|
}, isHidden: hidePassword })) }), error ? (_jsx(InputMsg, { variant: "body5", error: true, children: error })) : (helperMsg && _jsx(InputMsg, { variant: "body5", children: helperMsg }))] }));
|
|
12
12
|
}
|
|
13
13
|
const PasswordInput = forwardRef((props, ref) => {
|
|
14
|
-
const { error, helperMsg, leftIcon, type, inputSX, ...otherInputProps } = props;
|
|
14
|
+
const { error, helperMsg, leftIcon, type, inputSX, onKeyDown, ...otherInputProps } = props;
|
|
15
15
|
const [hidePassword, setHidePassword] = useState(true);
|
|
16
16
|
function handlePasswordShowHide() {
|
|
17
17
|
setHidePassword(!hidePassword);
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
const handleKeyDown = (event) => {
|
|
20
|
+
// Call the original onKeyDown if provided
|
|
21
|
+
if (onKeyDown) {
|
|
22
|
+
onKeyDown(event);
|
|
23
|
+
}
|
|
24
|
+
// Prevent Enter key from changing password visibility
|
|
25
|
+
if (event.key === 'Enter') {
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
event.stopPropagation();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return (_jsx(PasswordInputContainer, { ...props, hidePassword: hidePassword, handlePasswordShowHide: () => handlePasswordShowHide(), children: _jsx(BaseTextInput, { type: hidePassword ? 'password' : 'text', ref: ref, ...otherInputProps, onKeyDown: handleKeyDown, leftIcon: leftIcon, sx: inputSX }) }));
|
|
20
31
|
});
|
|
21
32
|
export default PasswordInput;
|
|
@@ -19,7 +19,7 @@ export const AnalysisBarSegmentContainer = styled(Box)(() => ({
|
|
|
19
19
|
width: '100%',
|
|
20
20
|
gap: '1px',
|
|
21
21
|
}));
|
|
22
|
-
const GraphScoreIndicatorContainer = styled(
|
|
22
|
+
const GraphScoreIndicatorContainer = styled(Box, {
|
|
23
23
|
shouldForwardProp: (prop) => prop !== 'isJet',
|
|
24
24
|
})(({ isJet }) => {
|
|
25
25
|
return {
|
package/package.json
CHANGED