l-min-components 1.0.523 → 1.0.525
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "l-min-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.525",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src/assets",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"moment": "^2.29.4",
|
|
26
26
|
"npm": "^10.2.5",
|
|
27
27
|
"prop-types": "^15.8.1",
|
|
28
|
+
"rc-pagination": "^4.0.4",
|
|
28
29
|
"rc-progress": "^3.5.1",
|
|
29
30
|
"rc-slider": "^10.1.1",
|
|
30
31
|
"rc-tooltip": "^6.0.1",
|
package/src/components/index.js
CHANGED
|
@@ -35,5 +35,6 @@ export { default as InstructorAccountSwitcher } from "./instructorAccountSwitche
|
|
|
35
35
|
export { default as InstructorRightBar } from "./fileRightBar/instructorRightBar";
|
|
36
36
|
|
|
37
37
|
export { default as EnterpriseRightBar } from "./fileRightBar/enterpriseRightBar";
|
|
38
|
-
export { default as FullPageLoader } from "./fullPageLoader"
|
|
39
|
-
export { default as AdminAppMainLayout } from "./AdminAppMainLayout"
|
|
38
|
+
export { default as FullPageLoader } from "./fullPageLoader";
|
|
39
|
+
export { default as AdminAppMainLayout } from "./AdminAppMainLayout";
|
|
40
|
+
export { default as PaginationComponent } from "./paginate";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { styled } from "styled-components";
|
|
2
|
+
import Pagination from "rc-pagination";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {number} props.current - Current page
|
|
8
|
+
* @param {number} props.totalPage - The number of items rendered in a page
|
|
9
|
+
* @param {number} props.totalItem -The complete total number of item
|
|
10
|
+
* @param {Function} props.onChange - A function that set the current page
|
|
11
|
+
* @param {React.CSSProperties} props.style
|
|
12
|
+
* @returns {JSX.Element}
|
|
13
|
+
*/
|
|
14
|
+
const Paginate = ({ current, totalPage, totalItem, onChange, style }) => {
|
|
15
|
+
return (
|
|
16
|
+
<Container style={style}>
|
|
17
|
+
<Pagination
|
|
18
|
+
onChange={onChange}
|
|
19
|
+
current={current}
|
|
20
|
+
total={totalItem}
|
|
21
|
+
pageSize={totalPage || 1}
|
|
22
|
+
nextIcon={() => "Next"}
|
|
23
|
+
prevIcon={() => "Prev"}
|
|
24
|
+
jumpNextIcon={() => <More />}
|
|
25
|
+
showLessItems
|
|
26
|
+
jumpPrevIcon={() => <More />}
|
|
27
|
+
/>
|
|
28
|
+
</Container>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const More = () => {
|
|
33
|
+
return (
|
|
34
|
+
<svg
|
|
35
|
+
width="11"
|
|
36
|
+
height="4"
|
|
37
|
+
viewBox="0 0 11 4"
|
|
38
|
+
fill="none"
|
|
39
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
+
>
|
|
41
|
+
<path
|
|
42
|
+
d="M1.86 3.09C1.54 3.09 1.275 2.985 1.065 2.775C0.855 2.555 0.75 2.285 0.75 1.965C0.75 1.645 0.855 1.38 1.065 1.17C1.275 0.95 1.54 0.84 1.86 0.84C2.18 0.84 2.445 0.95 2.655 1.17C2.865 1.38 2.97 1.645 2.97 1.965C2.97 2.285 2.865 2.555 2.655 2.775C2.445 2.985 2.18 3.09 1.86 3.09ZM5.5807 3.09C5.2607 3.09 4.9957 2.985 4.7857 2.775C4.5757 2.555 4.4707 2.285 4.4707 1.965C4.4707 1.645 4.5757 1.38 4.7857 1.17C4.9957 0.95 5.2607 0.84 5.5807 0.84C5.9007 0.84 6.1657 0.95 6.3757 1.17C6.5857 1.38 6.6907 1.645 6.6907 1.965C6.6907 2.285 6.5857 2.555 6.3757 2.775C6.1657 2.985 5.9007 3.09 5.5807 3.09ZM9.30141 3.09C8.98141 3.09 8.71641 2.985 8.50641 2.775C8.29641 2.555 8.19141 2.285 8.19141 1.965C8.19141 1.645 8.29641 1.38 8.50641 1.17C8.71641 0.95 8.98141 0.84 9.30141 0.84C9.62141 0.84 9.88641 0.95 10.0964 1.17C10.3064 1.38 10.4114 1.645 10.4114 1.965C10.4114 2.285 10.3064 2.555 10.0964 2.775C9.88641 2.985 9.62141 3.09 9.30141 3.09Z"
|
|
43
|
+
fill="black"
|
|
44
|
+
/>
|
|
45
|
+
</svg>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default Paginate;
|
|
50
|
+
|
|
51
|
+
export const Container = styled.div`
|
|
52
|
+
width: 100%;
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
ul {
|
|
56
|
+
display: flex;
|
|
57
|
+
list-style: none;
|
|
58
|
+
gap: 17px;
|
|
59
|
+
li {
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
display: flex;
|
|
62
|
+
width: 40px;
|
|
63
|
+
height: 40px;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
align-items: center;
|
|
66
|
+
border-radius: 50px;
|
|
67
|
+
border: 1px solid #dfe5e5;
|
|
68
|
+
background: #f5f7f7;
|
|
69
|
+
font-size: 15px;
|
|
70
|
+
font-weight: 700;
|
|
71
|
+
color: #4a4d4d;
|
|
72
|
+
|
|
73
|
+
&.rc-pagination-prev,
|
|
74
|
+
&.rc-pagination-next {
|
|
75
|
+
width: 76px;
|
|
76
|
+
}
|
|
77
|
+
&.rc-pagination-item-active {
|
|
78
|
+
background: #febf10;
|
|
79
|
+
a {
|
|
80
|
+
color: #fff;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
&.rc-pagination-jump-next,
|
|
84
|
+
&.rc-pagination-jump-prev {
|
|
85
|
+
background: transparent;
|
|
86
|
+
width: 12px;
|
|
87
|
+
border: none;
|
|
88
|
+
font-size: 15px;
|
|
89
|
+
font-weight: 700;
|
|
90
|
+
}
|
|
91
|
+
&.rc-pagination-disabled {
|
|
92
|
+
opacity: 0.5;
|
|
93
|
+
cursor: not-allowed;
|
|
94
|
+
}
|
|
95
|
+
&.rc-pagination-options {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`;
|