best-react-pagination 0.0.1-alpha.1 → 0.0.1

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/.editorconfig ADDED
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ insert_final_newline = true
9
+ max_line_length = 120
package/.eslintrc.js CHANGED
@@ -23,8 +23,10 @@ module.exports = {
23
23
  ecmaVersion: 2021,
24
24
  sourceType: "module",
25
25
  },
26
+ ignorePatterns: [".eslintrc.js"],
26
27
  rules: {
27
- "@typescript-eslint/no-var-requires": "off"
28
+ "@typescript-eslint/no-var-requires": "off",
29
+ "@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }]
28
30
  },
29
31
  settings: {
30
32
  react: {
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx --no-install commitlint --edit "$1"
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ "./node_modules/.bin/lint-staged"
@@ -0,0 +1,3 @@
1
+ {
2
+ "demo/src/**/*.(ts|tsx)": ["npm run lint:write", "npm run prettier", "git add"]
3
+ }
package/README.md CHANGED
@@ -1,48 +1,45 @@
1
- # best-react-pagination
2
-
3
- [![NPM](https://nodei.co/npm/best-react-pagination.png?downloads=true)](https://nodei.co/npm/best-react-pagination/)
4
-
5
- **React component to render a pagination.**
6
-
7
- # WARNING
8
- Now correct works only with ```paginationStart={1} ```
9
-
10
- ## Installation
11
-
12
- ```
13
- npm install best-react-pagination --save
14
- ```
15
-
16
- ```javascript
17
- import Index from "best-react-pagination";
18
-
19
- const YourComponent: FC = () => {
20
- const [index, setIndex] = useState(0);
21
-
22
- return (
23
- // Your code
24
- <Index
25
- paginationStart={0}
26
- currentIndex={index}
27
- setIndex={setIndex}
28
- totalPages={10}
29
- />
30
- );
31
- };
32
- ```
33
-
34
- ## Props
35
-
36
- | Name | Type | Description |
37
- | ------------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
38
- | `paginationStart` | `Number` | **Required.** The number of start pages on your logic (0 or 1). |
39
- | `currentIndex` | `Number` | **Required.** The current index from hook useState of pages displayed. |
40
- | `totalPages` | `Number` | **Required.** The range of pages displayed. |
41
- | `setIndex` | `React.Dispatch<React.SetStateAction<number>>` | **Required.** The dispatch from hook useState |
42
- | `isDefaultStyles` | `Boolean` | **Default true** |
43
- | `wrapperClass` | `String` | Css class |
44
- | `itemListClass` | `String` | Css class |
45
- | `itemClass` | `String` | Css class |
46
- | `selectedItemClass` | `String` | Css class |
47
- | `disableItemClass` | `String` | Css class |
48
- | `className` | `String` | **Field for styled-component** |
1
+ # best-react-pagination
2
+
3
+ [![NPM](https://nodei.co/npm/best-react-pagination.png?downloads=true)](https://nodei.co/npm/best-react-pagination/)
4
+
5
+ **Simple and stylized react component to render a pagination.**
6
+
7
+ ## Installation
8
+
9
+ ```
10
+ npm install best-react-pagination --save
11
+ ```
12
+
13
+ ```javascript
14
+ import Pagination from "best-react-pagination";
15
+
16
+ const YourComponent: FC = () => {
17
+ const [index, setIndex] = useState(0);
18
+
19
+ return (
20
+ // Your code
21
+ <Pagination
22
+ paginationStart={0}
23
+ currentIndex={index}
24
+ setIndex={setIndex}
25
+ totalPages={10}
26
+ />
27
+ );
28
+ };
29
+ ```
30
+
31
+ ## Props
32
+
33
+ | Name | Type | Description |
34
+ | ------------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
35
+ | `paginationStart` | `Number` | **Required.** The number of start pages on your logic (0 or 1). |
36
+ | `currentIndex` | `Number` | **Required.** The current index from hook useState of pages displayed. |
37
+ | `totalPages` | `Number` | **Required.** The range of pages displayed. |
38
+ | `setIndex` | `React.Dispatch<React.SetStateAction<number>>` | **Required.** The dispatch from hook useState |
39
+ | `isDefaultStyles` | `Boolean` | **Default true** |
40
+ | `wrapperClass` | `String` | Css class |
41
+ | `itemListClass` | `String` | Css class |
42
+ | `itemClass` | `String` | Css class |
43
+ | `selectedItemClass` | `String` | Css class |
44
+ | `disableItemClass` | `String` | Css class |
45
+ | `className` | `String` | **Field for styled-component** |
@@ -0,0 +1 @@
1
+ module.exports = {extends: ['@commitlint/config-conventional']}
package/demo/src/App.tsx CHANGED
@@ -1,15 +1,15 @@
1
- import React, {FC, useState} from "react";
1
+ import React, { FC, useState } from "react";
2
2
  import { hot } from "react-hot-loader/root";
3
- import Pagination from "./pagination";
3
+ import Pagination from "./Pagination";
4
4
 
5
- const App: FC = () => {
6
- const [index, setIndex] = useState(1)
5
+ const App: FC = () => {
6
+ const [index, setIndex] = useState(1);
7
7
 
8
- return (
9
- <>
10
- <Pagination paginationStart={1} currentIndex={index} setIndex={setIndex} totalPages={10} isDefaultStyles={true}/>
11
- </>
12
- );
13
- }
8
+ return (
9
+ <>
10
+ <Pagination paginationStart={0} currentIndex={index} setIndex={setIndex} totalPages={10} isDefaultStyles={true} />
11
+ </>
12
+ );
13
+ };
14
14
 
15
15
  export default hot(App);