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 CHANGED
@@ -1,7 +1,25 @@
1
1
  # jb-grid
2
2
 
3
- > currently this component only available in react and does not support web-component but it will in the future.
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
- console.log("not implemented yet");
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.1.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.3.1"
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 {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import JBGridViewModel from './JBGridViewModel.js';
2
+ import type JBGridViewModel from './JBGridViewModel.js';
3
3
  type FooterProps = {
4
4
  vm: JBGridViewModel<any>;
5
5
  isFullscreen: boolean;