aprog 1.6.7 → 1.6.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.
- package/package.json +1 -1
- package/src/paginate.js +21 -11
package/package.json
CHANGED
package/src/paginate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {storage} from "./storage.js";
|
|
2
2
|
import {button, div} from "./aprog.js";
|
|
3
3
|
|
|
4
|
-
export const paginate = ({ count = 0, currentPage = 1, onPageChange = () => {}, colors = {} } = {}) => {
|
|
4
|
+
export const paginate = ({ count = 0, currentPage = 1, onPageChange = () => {}, colors = {}, customStyles = {} } = {}) => {
|
|
5
5
|
const defaultColors = {
|
|
6
6
|
defaultColor: "#043458",
|
|
7
7
|
backgroundColor: "#ffffff",
|
|
@@ -9,21 +9,31 @@ export const paginate = ({ count = 0, currentPage = 1, onPageChange = () => {},
|
|
|
9
9
|
borderRadius: "0.5rem",
|
|
10
10
|
fontSize: "16px",
|
|
11
11
|
borderWidth: "0.0313rem",
|
|
12
|
-
border: "border: ${theme.borderWidth} solid ${theme.defaultColor}
|
|
12
|
+
border: "border: ${theme.borderWidth} solid ${theme.defaultColor}",
|
|
13
|
+
|
|
14
|
+
paginateBlock: {
|
|
15
|
+
width: "width: 100vw",
|
|
16
|
+
margin: "margin: 20px 0",
|
|
17
|
+
padding: "padding: 0 20px",
|
|
18
|
+
display: "display: flex",
|
|
19
|
+
alignItems: "align-items: center",
|
|
20
|
+
justifyContent: "justify-content: center",
|
|
21
|
+
gap: "gap: 5px"
|
|
22
|
+
}
|
|
13
23
|
};
|
|
14
24
|
|
|
15
|
-
const theme = { ...defaultColors, ...colors };
|
|
25
|
+
const theme = { ...defaultColors, ...colors, ...customStyles };
|
|
16
26
|
|
|
17
27
|
const styles = `
|
|
18
28
|
<style>
|
|
19
29
|
.paginate-block {
|
|
20
|
-
width
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
display
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
gap
|
|
30
|
+
${theme.paginateBlock.width};
|
|
31
|
+
${theme.paginateBlock.margin};
|
|
32
|
+
${theme.paginateBlock.padding};
|
|
33
|
+
${theme.paginateBlock.display};
|
|
34
|
+
${theme.paginateBlock.alignItems};
|
|
35
|
+
${theme.paginateBlock.justifyContent};
|
|
36
|
+
${theme.paginateBlock.gap};
|
|
27
37
|
}
|
|
28
38
|
.paginate-btn,
|
|
29
39
|
.paginate-dots,
|
|
@@ -34,7 +44,7 @@ export const paginate = ({ count = 0, currentPage = 1, onPageChange = () => {},
|
|
|
34
44
|
font-weight: 600;
|
|
35
45
|
color: ${theme.defaultColor};
|
|
36
46
|
background: ${theme.backgroundColor};
|
|
37
|
-
${theme.border}
|
|
47
|
+
${theme.border};
|
|
38
48
|
border-radius: ${theme.borderRadius};
|
|
39
49
|
cursor: pointer;
|
|
40
50
|
box-shadow: ${theme.boxShadow};
|