jb-grid 0.1.0 → 0.2.0
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/README.md +19 -1
- package/index.js +1 -1
- package/package.json +2 -2
- package/react/dist/Components/Pagination.d.ts +25 -0
- package/react/dist/Footer.d.ts +1 -1
- package/react/dist/JBGrid.cjs.js +1 -1
- package/react/dist/JBGrid.cjs.js.map +1 -1
- package/react/dist/JBGrid.d.ts +1 -0
- package/react/dist/JBGrid.js +1 -1
- package/react/dist/JBGrid.js.map +1 -1
- package/react/dist/JBGrid.umd.js +1 -1
- package/react/dist/JBGrid.umd.js.map +1 -1
- package/react/dist/JBGridViewModel.d.ts +2 -5
- package/react/lib/Components/Pagination.tsx +29 -0
- package/react/lib/Footer.tsx +6 -25
- package/react/lib/Header.tsx +1 -1
- package/react/lib/JBGrid.tsx +1 -0
- package/react/lib/JBGridViewModel.ts +2 -25
- package/react/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
# jb-grid
|
|
2
2
|
|
|
3
|
-
> currently this component only available in react
|
|
3
|
+
> currently this component only available in react in full mode and web-component is only support parts of the data grid like pagination.
|
|
4
4
|
|
|
5
5
|
## using with JS frameworks
|
|
6
6
|
|
|
7
7
|
to use this component in **react** see [`jb-grid/react`](https://github.com/javadbat/jb-grid/tree/main/react);
|
|
8
|
+
|
|
9
|
+
## Pagination
|
|
10
|
+
for pagination we use `jb-pagination` web-component
|
|
11
|
+
```html
|
|
12
|
+
<jb-pagination />
|
|
13
|
+
```
|
|
14
|
+
`jb-pagination` have some config into it here is how to config it:
|
|
15
|
+
|
|
16
|
+
```javascript
|
|
17
|
+
import `jb-pagination`;
|
|
18
|
+
//change current page index
|
|
19
|
+
document.querySelector(`jb-pagination`).pageIndex = 5;
|
|
20
|
+
//max page number default is infinite
|
|
21
|
+
document.querySelector(`jb-pagination`).max = 10;
|
|
22
|
+
//min page number default is 1
|
|
23
|
+
document.querySelector(`jb-pagination`).min = 0;
|
|
24
|
+
|
|
25
|
+
```
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from "./web-component/dist/index.js"
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"web component",
|
|
14
14
|
"react component"
|
|
15
15
|
],
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.2.0",
|
|
17
17
|
"bugs": "https://github.com/javadbat/jb-grid/issues",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"files": [
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"jb-core":">=0.19.0",
|
|
34
34
|
"mobx":">=6.0.0",
|
|
35
35
|
"mobx-react":">=7.0.0",
|
|
36
|
-
"jb-searchbar":">=2.
|
|
36
|
+
"jb-searchbar":">=2.6.0"
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { type DetailedHTMLProps, type FormEventHandler, type HTMLAttributes } from 'react';
|
|
2
|
+
import 'jb-grid';
|
|
3
|
+
import type { JBPaginationWebComponent } from 'jb-grid';
|
|
4
|
+
export type Props = {
|
|
5
|
+
pageIndex?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
onChange?: FormEventHandler<JBPaginationWebComponent>;
|
|
9
|
+
showPersianNumber?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function JBPagination(props: Props): React.JSX.Element;
|
|
12
|
+
type JBPaginationAttributes = DetailedHTMLProps<HTMLAttributes<JBPaginationWebComponent>, JBPaginationWebComponent> & {
|
|
13
|
+
pageIndex?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
min?: number;
|
|
16
|
+
showPersianNumber?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare module "react" {
|
|
19
|
+
namespace JSX {
|
|
20
|
+
interface IntrinsicElements {
|
|
21
|
+
'jb-pagination': JBPaginationAttributes;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {};
|
package/react/dist/Footer.d.ts
CHANGED