best-react-pagination 0.1.1 → 0.1.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/.idea/best-react-pagination.iml +9 -0
- package/.idea/codeStyles/Project.xml +58 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/discord.xml +7 -0
- package/.idea/git_toolbox_prj.xml +15 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/package.json +1 -1
- package/demo/.babelrc +0 -14
- package/demo/public/index.html +0 -17
- package/demo/src/App.tsx +0 -24
- package/demo/src/Pagination/components/Item/Item.tsx +0 -19
- package/demo/src/Pagination/components/Item/index.ts +0 -1
- package/demo/src/Pagination/components/ItemList/ItemList.tsx +0 -17
- package/demo/src/Pagination/components/ItemList/index.ts +0 -1
- package/demo/src/Pagination/components/Wrapper/Wrapper.tsx +0 -17
- package/demo/src/Pagination/components/Wrapper/index.ts +0 -1
- package/demo/src/Pagination/components/constants.ts +0 -49
- package/demo/src/Pagination/components/index.ts +0 -3
- package/demo/src/Pagination/components/utils.ts +0 -3
- package/demo/src/Pagination/index.tsx +0 -356
- package/demo/src/index.html +0 -11
- package/demo/src/index.tsx +0 -7
- package/demo/tsconfig.json +0 -18
- package/demo/webpack.config.js +0 -50
- package/dist/components/Item/Item.d.ts +0 -10
- package/dist/components/Item/index.d.ts +0 -1
- package/dist/components/ItemList/ItemList.d.ts +0 -7
- package/dist/components/ItemList/index.d.ts +0 -1
- package/dist/components/Wrapper/Wrapper.d.ts +0 -7
- package/dist/components/Wrapper/index.d.ts +0 -1
- package/dist/components/constants.d.ts +0 -9
- package/dist/components/index.d.ts +0 -3
- package/dist/components/utils.d.ts +0 -1
- package/lib/components/Item/Item.tsx +0 -19
- package/lib/components/Item/index.ts +0 -1
- package/lib/components/ItemList/ItemList.tsx +0 -17
- package/lib/components/ItemList/index.ts +0 -1
- package/lib/components/Wrapper/Wrapper.tsx +0 -17
- package/lib/components/Wrapper/index.ts +0 -1
- package/lib/components/constants.ts +0 -49
- package/lib/components/index.ts +0 -3
- package/lib/components/utils.ts +0 -3
- package/lib/index.tsx +0 -356
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="JAVA_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
+
<exclude-output />
|
|
5
|
+
<content url="file://$MODULE_DIR$" />
|
|
6
|
+
<orderEntry type="inheritedJdk" />
|
|
7
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
+
</component>
|
|
9
|
+
</module>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<HTMLCodeStyleSettings>
|
|
4
|
+
<option name="HTML_UNIFORM_INDENT" value="true" />
|
|
5
|
+
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
6
|
+
<option name="HTML_DO_NOT_INDENT_CHILDREN_OF" value="html" />
|
|
7
|
+
<option name="HTML_ENFORCE_QUOTES" value="true" />
|
|
8
|
+
</HTMLCodeStyleSettings>
|
|
9
|
+
<JSCodeStyleSettings version="0">
|
|
10
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
11
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
12
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
13
|
+
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
14
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
15
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
16
|
+
</JSCodeStyleSettings>
|
|
17
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
18
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
19
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
20
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
21
|
+
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
22
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
23
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
24
|
+
<option name="SPACE_WITHIN_TYPE_ASSERTION" value="true" />
|
|
25
|
+
<option name="BLACKLIST_IMPORTS" value="rxjs/Rx" />
|
|
26
|
+
</TypeScriptCodeStyleSettings>
|
|
27
|
+
<codeStyleSettings language="HTML">
|
|
28
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
29
|
+
<indentOptions>
|
|
30
|
+
<option name="INDENT_SIZE" value="2" />
|
|
31
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
32
|
+
<option name="TAB_SIZE" value="2" />
|
|
33
|
+
<option name="SMART_TABS" value="true" />
|
|
34
|
+
</indentOptions>
|
|
35
|
+
</codeStyleSettings>
|
|
36
|
+
<codeStyleSettings language="JavaScript">
|
|
37
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
+
<indentOptions>
|
|
39
|
+
<option name="INDENT_SIZE" value="2" />
|
|
40
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
+
<option name="TAB_SIZE" value="2" />
|
|
42
|
+
</indentOptions>
|
|
43
|
+
</codeStyleSettings>
|
|
44
|
+
<codeStyleSettings language="TypeScript">
|
|
45
|
+
<option name="RIGHT_MARGIN" value="100" />
|
|
46
|
+
<option name="IF_BRACE_FORCE" value="3" />
|
|
47
|
+
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
|
48
|
+
<option name="WHILE_BRACE_FORCE" value="3" />
|
|
49
|
+
<option name="FOR_BRACE_FORCE" value="3" />
|
|
50
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
51
|
+
<indentOptions>
|
|
52
|
+
<option name="INDENT_SIZE" value="2" />
|
|
53
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
54
|
+
<option name="TAB_SIZE" value="2" />
|
|
55
|
+
</indentOptions>
|
|
56
|
+
</codeStyleSettings>
|
|
57
|
+
</code_scheme>
|
|
58
|
+
</component>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="GitToolBoxProjectSettings">
|
|
4
|
+
<option name="commitMessageIssueKeyValidationOverride">
|
|
5
|
+
<BoolValueOverride>
|
|
6
|
+
<option name="enabled" value="true" />
|
|
7
|
+
</BoolValueOverride>
|
|
8
|
+
</option>
|
|
9
|
+
<option name="commitMessageValidationConfigOverride">
|
|
10
|
+
<CommitMessageValidationOverride>
|
|
11
|
+
<option name="enabled" value="true" />
|
|
12
|
+
</CommitMessageValidationOverride>
|
|
13
|
+
</option>
|
|
14
|
+
</component>
|
|
15
|
+
</project>
|
package/.idea/misc.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/best-react-pagination.iml" filepath="$PROJECT_DIR$/.idea/best-react-pagination.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
package/package.json
CHANGED
package/demo/.babelrc
DELETED
package/demo/public/index.html
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<meta name="theme-color" content="#000000" />
|
|
7
|
-
<meta
|
|
8
|
-
name="description"
|
|
9
|
-
content="Web site created using create-react-app"
|
|
10
|
-
/>
|
|
11
|
-
<title>React App</title>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
15
|
-
<div id="root"></div>
|
|
16
|
-
</body>
|
|
17
|
-
</html>
|
package/demo/src/App.tsx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { FC, useState } from "react";
|
|
2
|
-
import { hot } from "react-hot-loader/root";
|
|
3
|
-
import Pagination from "./Pagination";
|
|
4
|
-
|
|
5
|
-
const App: FC = () => {
|
|
6
|
-
const [index, setIndex] = useState(1);
|
|
7
|
-
const totalPages = 10;
|
|
8
|
-
|
|
9
|
-
console.log(`Current: ${index}. Total: ${totalPages}`);
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<>
|
|
13
|
-
<Pagination
|
|
14
|
-
paginationStart={1}
|
|
15
|
-
currentIndex={index}
|
|
16
|
-
setIndex={setIndex}
|
|
17
|
-
totalPages={totalPages}
|
|
18
|
-
isDefaultStyles={true}
|
|
19
|
-
/>
|
|
20
|
-
</>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default hot(App);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { FC } from "react";
|
|
2
|
-
import { defaultStyles, defaultStylesEnum } from "../constants";
|
|
3
|
-
|
|
4
|
-
interface ItemProps {
|
|
5
|
-
isDefaultStyles: boolean | undefined;
|
|
6
|
-
itemClass: string;
|
|
7
|
-
itemStyle: defaultStylesEnum;
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const Item: FC<ItemProps> = ({ isDefaultStyles, itemClass, itemStyle, onClick, children }) => {
|
|
12
|
-
return (
|
|
13
|
-
<li className={itemClass} style={isDefaultStyles ? defaultStyles[itemStyle] : undefined} onClick={onClick}>
|
|
14
|
-
{children}
|
|
15
|
-
</li>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default Item;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Item";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { FC } from "react";
|
|
2
|
-
import { defaultStyles } from "../constants";
|
|
3
|
-
|
|
4
|
-
interface ItemListProps {
|
|
5
|
-
isDefaultStyles: boolean | undefined;
|
|
6
|
-
itemListClass: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const ItemList: FC<ItemListProps> = ({ isDefaultStyles, itemListClass, children }) => {
|
|
10
|
-
return (
|
|
11
|
-
<ul className={itemListClass} style={isDefaultStyles ? defaultStyles.itemListClass : undefined}>
|
|
12
|
-
{children}
|
|
13
|
-
</ul>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default ItemList;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./ItemList";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { FC } from "react";
|
|
2
|
-
import { defaultStyles } from "../constants";
|
|
3
|
-
|
|
4
|
-
interface WrapperProps {
|
|
5
|
-
isDefaultStyles: boolean | undefined;
|
|
6
|
-
wrapperClass: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const Wrapper: FC<WrapperProps> = ({ isDefaultStyles, wrapperClass, children }) => {
|
|
10
|
-
return (
|
|
11
|
-
<div className={wrapperClass} style={isDefaultStyles ? defaultStyles.wrapperClass : undefined}>
|
|
12
|
-
{children}
|
|
13
|
-
</div>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default Wrapper;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Wrapper";
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
export enum defaultStylesEnum {
|
|
4
|
-
wrapperClass = "wrapperClass",
|
|
5
|
-
itemListClass = "itemListClass",
|
|
6
|
-
itemClass = "itemClass",
|
|
7
|
-
selectedItemClass = "selectedItemClass",
|
|
8
|
-
disableItemClass = "disableItemClass",
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const defaultStyles: Record<defaultStylesEnum, React.CSSProperties> = {
|
|
12
|
-
wrapperClass: {
|
|
13
|
-
position: "sticky",
|
|
14
|
-
display: "flex",
|
|
15
|
-
justifyContent: "center",
|
|
16
|
-
alignItems: "center",
|
|
17
|
-
width: "100%",
|
|
18
|
-
bottom: 0,
|
|
19
|
-
},
|
|
20
|
-
itemListClass: {
|
|
21
|
-
padding: "10px 0",
|
|
22
|
-
},
|
|
23
|
-
itemClass: {
|
|
24
|
-
display: "inline",
|
|
25
|
-
cursor: "pointer",
|
|
26
|
-
padding: "6px 12px",
|
|
27
|
-
borderRadius: "4px",
|
|
28
|
-
margin: "0 2px",
|
|
29
|
-
backgroundColor: "#45c954",
|
|
30
|
-
userSelect: "none",
|
|
31
|
-
},
|
|
32
|
-
selectedItemClass: {
|
|
33
|
-
display: "inline",
|
|
34
|
-
cursor: "pointer",
|
|
35
|
-
padding: "6px 12px",
|
|
36
|
-
borderRadius: "4px",
|
|
37
|
-
margin: "0 2px",
|
|
38
|
-
backgroundColor: "#48bbff",
|
|
39
|
-
userSelect: "none",
|
|
40
|
-
},
|
|
41
|
-
disableItemClass: {
|
|
42
|
-
display: "inline",
|
|
43
|
-
cursor: "not-allowed",
|
|
44
|
-
padding: "6px 12px",
|
|
45
|
-
borderRadius: "4px",
|
|
46
|
-
margin: "0 2px",
|
|
47
|
-
userSelect: "none",
|
|
48
|
-
},
|
|
49
|
-
};
|