@dilicorp/ui 0.0.28 → 0.0.29

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.
@@ -5,6 +5,7 @@ export declare type PaginateProps = {
5
5
  perPage: number;
6
6
  currentCount: number;
7
7
  translate?: string;
8
+ onChange?: (page: number) => void;
8
9
  };
9
10
  export declare const Paginate: React.FC<PaginateProps>;
10
11
  //# sourceMappingURL=paginate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paginate.d.ts","sourceRoot":"","sources":["../../src/molecules/paginate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAuBzB,oBAAY,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAiC5C,CAAA"}
1
+ {"version":3,"file":"paginate.d.ts","sourceRoot":"","sources":["../../src/molecules/paginate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAuBzB,oBAAY,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAsC5C,CAAA"}
@@ -17,15 +17,20 @@ const config = {
17
17
  linkClassLast: 'arrow last'
18
18
  };
19
19
  export const Paginate = (props) => {
20
- const { activePage, perPage, totalItems, currentCount, translate = '%1 out of %2 records' } = props;
20
+ const { activePage, perPage, totalItems, currentCount, translate = '%1 out of %2 records', onChange } = props;
21
21
  const history = useLocation();
22
22
  const navigate = useNavigate();
23
23
  const search = uriHelper.parse(history.search);
24
24
  const handleChange = (page) => {
25
- Object.assign(search, { page });
26
- navigate({
27
- search: uriHelper.stringify(search)
28
- });
25
+ if (onChange) {
26
+ onChange(page);
27
+ }
28
+ else {
29
+ Object.assign(search, { page });
30
+ navigate({
31
+ search: uriHelper.stringify(search)
32
+ });
33
+ }
29
34
  };
30
35
  return (React.createElement("div", { className: "box-paginate" },
31
36
  React.createElement(ReactPagination, Object.assign({}, config, { activePage: activePage, itemsCountPerPage: perPage, totalItemsCount: totalItems, onChange: handleChange })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dilicorp/ui",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "A simple UI design for Dilicorp",
5
5
  "repository": {
6
6
  "type": "git",