quadra-component 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,64 +1,140 @@
1
+ # quadra-component
1
2
 
2
- # seeds-client-react
3
- `seeds-client-react` is a React.js library that provides components to interact with [Seeds Finance](https://seeds.finance) platform.
3
+ `quadra-component` is a React.js library that provides components to to make it easier for quadra developers.
4
4
 
5
5
  ## Installation
6
+
6
7
  Install the package via npm:
8
+
7
9
  ```bash
8
- npm install seeds-client-react
10
+ npm install quadra-component
9
11
  ```
10
12
 
11
13
  Install the package via yarn:
14
+
12
15
  ```bash
13
- yarn add seeds-client-react
16
+ yarn add quadra-component
14
17
  ```
15
18
 
16
19
  ## Components
17
20
 
18
- ### 1. SeedsPlay component
19
- This component is used to initiate a Seeds play session using `userId` and `userName`. To use this component, you need to register on the [Seeds Dashboard](https://dashboard.seeds.finance). In addition, you must request the Seeds team to whitelist your domain. Without this whitelist, the component will not function properly.
21
+ ### 1. Tabel component
22
+
23
+ This component is used to create tables dynamically and is easy to use and already uses types for the data that appears in the table.
20
24
 
21
25
  #### Props
22
- - `userId` (string): The unique identifier for the user from your system.
23
- - `userName` (string): The name of the user from your system.
26
+
27
+ - `data` (any[]): This is props of your data.
28
+ - `columns` (Columns<T>[]): The structure of your table.
29
+ - `loading` (boolean): The loading state.
30
+ - `onRowClick` (void function): You can use this function to trigger any action while you click the table body.
31
+ - `color` (string): You can change the header table background color.
32
+ - `textColor` (string): You can change the header table text color.
33
+
34
+ #### Columns
35
+
36
+ - `fieldId` (string): The key of object in your data.
37
+ - `label` (string): The title you want to show in header table.
38
+ - `render` (React function): The render is a function that returns react element, you can use this to manipulate data and you can show the data as you want or you can enhance the look of your table body.
39
+ - `renderHeader` (React function): The renderHeader is a function that returns react element, you can use this to enhance or change the look of your table header.
24
40
 
25
41
  #### Usage
42
+
43
+ ### Columns
44
+
26
45
  ```jsx
27
- import React from 'react';
28
- import { SeedsPlay } from 'seeds-client-react';
46
+ import { type Columns } from "quadra-component";
47
+
48
+ const header: Columns<Forum>[] = [
49
+ {
50
+ fieldId: "index",
51
+ label: "No",
52
+ },
53
+ {
54
+ fieldId: "title",
55
+ label: "Title",
56
+ },
57
+ {
58
+ fieldId: "description",
59
+ label: "Description",
60
+ render: (data) => (
61
+ <p>
62
+ {data?.description !== undefined &&
63
+ (data.description.length > 25
64
+ ? data?.description.slice(0, 20) + "..."
65
+ : data?.description)}
66
+ </p>
67
+ ),
68
+ },
69
+ {
70
+ fieldId: "image",
71
+ label: "Post Image",
72
+ render: (data) => <img src={data?.image} alt="Images" />,
73
+ },
74
+ {
75
+ fieldId: "created_at",
76
+ label: "Posted At",
77
+ render: (data) => <p>{moment(data?.created_at).format("MMM Do, YYYY")}</p>,
78
+ },
79
+ {
80
+ fieldId: "likes",
81
+ label: "Total Like",
82
+ },
83
+ {
84
+ fieldId: "moderator",
85
+ label: "Moderator",
86
+ },
87
+ {
88
+ fieldId: "admin",
89
+ label: "Posted By",
90
+ render: (data) => <p>{data?.admin.email}</p>,
91
+ },
92
+ ];
93
+ ```
29
94
 
30
- const App = () => (
31
- <SeedsPlay userId="user123" userName="JohnDoe" />
32
- );
95
+ ### Table
33
96
 
34
- export default App;
97
+ ```jsx
98
+ import { Table } from "quadra-component";
99
+
100
+ <Table<Forum>
101
+ columns={header}
102
+ data={data}
103
+ loading={isLoading}
104
+ />
35
105
  ```
36
106
 
37
- ### 2. SeedsPlayWithKey component
38
- This component is used when you don't need to use our domain, you need to authenticate using an API key and secret, in addition to the `userId` and `userName`. You can obtain the `apiKey` and `apiSecret` from [Seeds Dashboard](https://dashboard.seeds.finance).
107
+ #### 2. Pagination component
108
+
109
+ This component is used when you need pagination for the table
39
110
 
40
111
  #### Props
41
- - `userId` (string): The unique identifier for the user from your system.
42
- - `userName` (string): The name of the user from your system.
43
- - `apiKey` (string): The API key obtained from the dashboard.
44
- - `apiSecret` (string): The API secret obtained from the dashboard.
112
+
113
+ - `currentPage` (number): The number of the current page.
114
+ - `totalPages` (number): The total of your data page.
115
+ - `onPageChange` (void function): The function that can be used to change your page
116
+ - `color` (string): You can change the color of pagination.
45
117
 
46
118
  #### Usage
119
+
47
120
  ```jsx
48
- import React from 'react';
49
- import { SeedsPlayWithKey } from 'seeds-client-react';
50
-
51
- const App = () => (
52
- <SeedsPlayWithKey
53
- userId="user123"
54
- userName="JohnDoe"
55
- apiKey="yourApiKey"
56
- apiSecret="yourApiSecret"
121
+ import React from "react";
122
+ import { Pagination, Table } from "quadra-component";
123
+ const App = () =>{
124
+ <Table<Forum>
125
+ columns={header}
126
+ data={data}
127
+ loading={isLoading}
57
128
  />
58
- );
59
-
129
+ <Pagination
130
+ currentPage={data!?.meta.currentPage}
131
+ totalPages={data!?.meta.totalPages}
132
+ onPageChange={handlePageChange}
133
+ />
134
+ }
60
135
  export default App;
61
136
  ```
62
137
 
63
138
  ## License
64
- This project is licensed under the ISC License.
139
+
140
+ This project is licensed under the ISC License.
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=function(){return t=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;exports.Pagination=function(i){var n=i.currentPage,d=i.totalPages,o=i.onPageChange,l=i.color,s=void 0===l?"#234764":l,a=r.useState(n),c=a[0],h=a[1];r.useEffect((function(){h(n)}),[n]);return e.jsxs("div",t({style:{display:"grid",gridTemplateColumns:"repeat(10, minmax(0, 1fr))",marginTop:"4rem",gap:"1rem"}},{children:[e.jsx("div",{style:{gridColumn:"span 2 / span 2"}}),e.jsx("div",t({style:{paddingTop:"1px",gridColumn:"span 6 / span 6"}},{children:e.jsxs("div",t({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:[e.jsx("a",t({href:"#",onClick:function(){n>1&&o(n-1)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:"0.5rem",marginRight:"0.5rem",color:"#262626",width:"1.5rem",height:"1.5rem"}},{children:e.jsx("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",style:{width:"1.5rem",height:"1.5rem"}},{children:e.jsx("path",{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})}))})),function(){var r=[],i=Math.floor(3.5),l=Math.max(1,n-i),a=Math.min(l+7-1,d);a-l<6&&(l=Math.max(1,a-7+1));for(var c=function(i){r.push(e.jsx("a",t({href:"#",style:{backgroundColor:i===n?s:"transparent",color:i===n?"#ffffff":"#262626",borderRadius:"9999px",width:"1.5rem",height:"1.5rem",marginLeft:"0.5rem",marginRight:"0.5rem",display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"0.75rem",lineHeight:"1rem"},onClick:function(){o(i)}},{children:i}),i))},h=l;h<=a;h++)c(h);return r}(),e.jsx("a",t({href:"#",onClick:function(){n<d&&o(n+1)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:"0.5rem",marginRight:"0.5rem",color:"#262626",width:"1.5rem",height:"1.5rem"}},{children:e.jsx("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",style:{width:"1.5rem",height:"1.5rem"}},{children:e.jsx("path",{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})}))}))]}))})),e.jsx("div",t({style:{gridColumn:"span 2 / span 2"}},{children:e.jsxs("div",t({style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem"}},{children:[e.jsx("div",t({style:{flex:"none"}},{children:e.jsx("div",t({style:{fontSize:"0.75rem",lineHeight:"23px",height:"23px",display:"block",color:"#bdbdbd"}},{children:"Go to page"}))})),e.jsx("div",t({style:{flex:"1 1 0%"}},{children:e.jsx("input",{onChange:function(e){h(e.target.value)},value:c,type:"text",style:{borderWidth:"1px",borderRadius:"9999px",borderColor:s,display:"block",width:"100%",paddingLeft:"0.5rem",paddingRight:"0.5rem",height:"23px",color:"#262626",fontSize:"0.875rem",lineHeight:"1.25rem",outlineWidth:"0px"}})})),e.jsx("div",t({style:{flex:"1 1 0%"}},{children:e.jsx("button",t({type:"button",onClick:function(){c>=1&&c<=d?o(c):h(n)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"0.75rem",lineHeight:"1rem",height:"23px",paddingLeft:"1rem",paddingRight:"1rem",fontWeight:600,borderRadius:"9999px",color:"#ffffff",backgroundColor:s}},{children:"Go"}))}))]}))}))]}))},exports.Table=function(r){var i=r.data,n=void 0===i?[]:i,d=r.columns,o=void 0===d?[]:d;r.ranked;var l=r.loading,s=void 0!==l&&l,a=r.error,c=void 0===a?"":a,h=r.action,p=void 0!==h&&h,f=r.currentPage,g=void 0===f?1:f,x=r.limit,m=void 0===x?0:x,u=r.onRowClick,y=r.color,b=void 0===y?"#234764":y,v=r.textColor,j=void 0===v?"#fff":v;return e.jsxs("table",t({style:{minWidth:"100%"}},{children:[e.jsx("thead",t({style:{backgroundColor:b}},{children:e.jsx("tr",{children:o.map((function(r,i){return e.jsx("th",t({scope:"col",style:{borderRightWidth:"1px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",fontSize:"0.875rem",lineHeight:"1.25rem",color:j,fontWeight:600}},{children:e.jsxs("div",t({style:{display:"flex",justifyContent:"center"}},{children:[r.label,void 0!==(null==r?void 0:r.renderHeader)&&(null==r?void 0:r.renderHeader())]}))}),i)}))})})),e.jsxs("tbody",t({style:{backgroundColor:"#ffffff"}},{children:[!0!==s&&!c&&n&&(null==n?void 0:n.map((function(r,i){return e.jsx("tr",t({onClick:function(){var e;e=r,void 0!==u&&u(e)},role:p?"button":void 0},{children:o.map((function(n,d){return e.jsxs("td",t({style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.75rem",fontSize:"0.875rem",color:"#201B1C"}},{children:["index"===n.fieldId&&i+1+(g-1)*m,void 0===(null==n?void 0:n.render)&&r[n.fieldId],e.jsx("p",t({className:"text-gray-500"},{children:void 0!==(null==n?void 0:n.fieldId2)&&r[n.fieldId2]})),void 0!==(null==n?void 0:n.render)&&n.render(r),e.jsx("span",{children:void 0!==(null==n?void 0:n.fieldId3)&&r[n.fieldId3]})]}),d)}))}),i)}))),!0!==s&&!c&&!n&&e.jsx("tr",{children:e.jsx("td",t({colSpan:o.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:e.jsx("div",t({style:{display:"flex",flexDirection:"column",alignItems:"center"}},{children:e.jsx("span",t({style:{paddingTop:"1.5rem",paddingBottom:"1.5rem",color:"#7c7c7c"}},{children:"No Data Here"}))}))}))}),!0!==s&&c&&e.jsx("tr",{children:e.jsx("td",t({colSpan:o.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:c}))}),!0===s&&e.jsx("tr",{children:e.jsx("td",t({colSpan:o.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:"Loading..."}))})]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=function(){return t=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;exports.Pagination=function(i){var n=i.currentPage,d=i.totalPages,o=i.onPageChange,l=i.color,s=void 0===l?"#234764":l,a=r.useState(n),c=a[0],h=a[1];r.useEffect((function(){h(n)}),[n]);return e.jsxs("div",t({style:{display:"grid",gridTemplateColumns:"repeat(10, minmax(0, 1fr))",marginTop:"4rem",gap:"1rem"}},{children:[e.jsx("div",{style:{gridColumn:"span 2 / span 2"}}),e.jsx("div",t({style:{paddingTop:"1px",gridColumn:"span 6 / span 6"}},{children:e.jsxs("div",t({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:[e.jsx("a",t({href:"#",onClick:function(){n>1&&o(n-1)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:"0.5rem",marginRight:"0.5rem",color:"#262626",width:"1.5rem",height:"1.5rem"}},{children:e.jsx("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",style:{width:"1.5rem",height:"1.5rem"}},{children:e.jsx("path",{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})}))})),function(){var r=[],i=Math.floor(3.5),l=Math.max(1,n-i),a=Math.min(l+7-1,d);a-l<6&&(l=Math.max(1,a-7+1));for(var c=function(i){r.push(e.jsx("a",t({href:"#",style:{backgroundColor:i===n?s:"transparent",color:i===n?"#ffffff":"#262626",borderRadius:"9999px",width:"1.5rem",height:"1.5rem",marginLeft:"0.5rem",marginRight:"0.5rem",display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"0.75rem",lineHeight:"1rem"},onClick:function(){o(i)}},{children:i}),i))},h=l;h<=a;h++)c(h);return r}(),e.jsx("a",t({href:"#",onClick:function(){n<d&&o(n+1)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:"0.5rem",marginRight:"0.5rem",color:"#262626",width:"1.5rem",height:"1.5rem"}},{children:e.jsx("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",style:{width:"1.5rem",height:"1.5rem"}},{children:e.jsx("path",{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})}))}))]}))})),e.jsx("div",t({style:{gridColumn:"span 2 / span 2"}},{children:e.jsxs("div",t({style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem"}},{children:[e.jsx("div",t({style:{flex:"none"}},{children:e.jsx("div",t({style:{fontSize:"0.75rem",lineHeight:"23px",height:"23px",display:"block",color:"#bdbdbd"}},{children:"Go to page"}))})),e.jsx("div",t({style:{flex:"1 1 0%"}},{children:e.jsx("input",{onChange:function(e){h(e.target.value)},value:c,type:"text",style:{borderWidth:"1px",borderRadius:"9999px",borderColor:s,display:"block",width:"100%",paddingLeft:"0.5rem",paddingRight:"0.5rem",height:"23px",color:"#262626",fontSize:"0.875rem",lineHeight:"1.25rem",outlineWidth:"0px"}})})),e.jsx("div",t({style:{flex:"1 1 0%"}},{children:e.jsx("button",t({type:"button",onClick:function(){c>=1&&c<=d?o(c):h(n)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"0.75rem",lineHeight:"1rem",height:"23px",paddingLeft:"1rem",paddingRight:"1rem",fontWeight:600,borderRadius:"9999px",color:"#ffffff",backgroundColor:s}},{children:"Go"}))}))]}))}))]}))},exports.Table=function(r){var i=r.data,n=void 0===i?[]:i,d=r.columns,o=void 0===d?[]:d,l=r.loading,s=void 0!==l&&l,a=r.error,c=void 0===a?"":a,h=r.action,p=void 0!==h&&h,f=r.currentPage,g=void 0===f?1:f,x=r.limit,m=void 0===x?0:x,u=r.onRowClick,y=r.color,b=void 0===y?"#234764":y,v=r.textColor,j=void 0===v?"#fff":v;return e.jsxs("table",t({style:{minWidth:"100%"}},{children:[e.jsx("thead",t({style:{backgroundColor:b}},{children:e.jsx("tr",{children:o.map((function(r,i){return e.jsx("th",t({scope:"col",style:{borderRightWidth:"1px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",fontSize:"0.875rem",lineHeight:"1.25rem",color:j,fontWeight:600}},{children:e.jsxs("div",t({style:{display:"flex",justifyContent:"center"}},{children:[r.label,void 0!==(null==r?void 0:r.renderHeader)&&(null==r?void 0:r.renderHeader())]}))}),i)}))})})),e.jsxs("tbody",t({style:{backgroundColor:"#ffffff"}},{children:[!0!==s&&!c&&n&&(null==n?void 0:n.map((function(r,i){return e.jsx("tr",t({onClick:function(){var e;e=r,void 0!==u&&u(e)},role:p?"button":void 0},{children:o.map((function(n,d){return e.jsxs("td",t({style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.75rem",fontSize:"0.875rem",color:"#201B1C"}},{children:["index"===n.fieldId&&i+1+(g-1)*m,void 0===(null==n?void 0:n.render)&&r[n.fieldId],e.jsx("p",t({className:"text-gray-500"},{children:void 0!==(null==n?void 0:n.fieldId2)&&r[n.fieldId2]})),void 0!==(null==n?void 0:n.render)&&n.render(r),e.jsx("span",{children:void 0!==(null==n?void 0:n.fieldId3)&&r[n.fieldId3]})]}),d)}))}),i)}))),!0!==s&&!c&&!n&&e.jsx("tr",{children:e.jsx("td",t({colSpan:o.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:e.jsx("div",t({style:{display:"flex",flexDirection:"column",alignItems:"center"}},{children:e.jsx("span",t({style:{paddingTop:"1.5rem",paddingBottom:"1.5rem",color:"#7c7c7c"}},{children:"No Data Here"}))}))}))}),!0!==s&&c&&e.jsx("tr",{children:e.jsx("td",t({colSpan:o.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:c}))}),!0===s&&e.jsx("tr",{children:e.jsx("td",t({colSpan:o.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:"Loading..."}))})]}))]}))};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../node_modules/tslib/tslib.es6.mjs","../../src/components/Pagination/Pagination.tsx","../../src/components/Table/Table.tsx"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { useEffect, useState } from \"react\";\ninterface PaginationProps {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n color?: string;\n}\n\nconst Pagination: React.FC<PaginationProps> = ({\n currentPage,\n totalPages,\n onPageChange,\n color = \"#234764\",\n}) => {\n const [inputPage, setInputPage] = useState<any>(currentPage);\n\n useEffect(() => {\n setInputPage(currentPage);\n }, [currentPage]);\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n setInputPage(e.target.value);\n };\n\n const handlePageChange = (): void => {\n if (inputPage >= 1 && inputPage <= totalPages) {\n onPageChange(inputPage);\n } else {\n setInputPage(currentPage);\n }\n };\n\n const handlePreviousPage = (): void => {\n if (currentPage > 1) {\n onPageChange(currentPage - 1);\n }\n };\n\n const handleNextPage = (): void => {\n if (currentPage < totalPages) {\n onPageChange(currentPage + 1);\n }\n };\n\n const handlePageButtonClick = (page: number): void => {\n onPageChange(page);\n };\n\n const generatePageButtons = (): React.ReactNode => {\n const buttons = [];\n const maxButtons = 7;\n const halfMaxButtons = Math.floor(maxButtons / 2);\n let start: number = Math.max(1, currentPage - halfMaxButtons);\n const end: number = Math.min(start + maxButtons - 1, totalPages);\n\n if (end - start < maxButtons - 1) {\n start = Math.max(1, end - maxButtons + 1);\n }\n\n for (let i = start; i <= end; i++) {\n buttons.push(\n <a\n key={i}\n href=\"#\"\n style={{\n backgroundColor: i === currentPage ? color : \"transparent\",\n color: i === currentPage ? \"#ffffff\" : \"#262626\",\n borderRadius: \"9999px\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.75rem\",\n lineHeight: \"1rem\",\n }}\n onClick={() => {\n handlePageButtonClick(i);\n }}\n >\n {i}\n </a>\n );\n }\n\n return buttons;\n };\n\n return (\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(10, minmax(0, 1fr))\",\n marginTop: \"4rem\",\n gap: \"1rem\",\n }}\n >\n <div style={{ gridColumn: \"span 2 / span 2\" }} />\n <div style={{ paddingTop: \"1px\", gridColumn: \"span 6 / span 6\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }}\n >\n <a\n href=\"#\"\n onClick={handlePreviousPage}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n color: \"#262626\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n style={{ width: \"1.5rem\", height: \"1.5rem\" }}\n >\n <path d=\"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z\" />\n </svg>\n </a>\n {generatePageButtons()}\n <a\n href=\"#\"\n onClick={handleNextPage}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n color: \"#262626\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n style={{ width: \"1.5rem\", height: \"1.5rem\" }}\n >\n <path d=\"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z\" />\n </svg>\n </a>\n </div>\n </div>\n <div style={{ gridColumn: \"span 2 / span 2\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"1rem\",\n }}\n >\n <div style={{ flex: \"none\" }}>\n <div\n style={{\n fontSize: \"0.75rem\",\n lineHeight: \"23px\",\n height: \"23px\",\n display: \"block\",\n color: \"#bdbdbd\",\n }}\n >\n Go to page\n </div>\n </div>\n <div style={{ flex: \"1 1 0%\" }}>\n <input\n onChange={handleInputChange}\n value={inputPage}\n type=\"text\"\n style={{\n borderWidth: \"1px\",\n borderRadius: \"9999px\",\n borderColor: color,\n display: \"block\",\n width: \"100%\",\n paddingLeft: \"0.5rem\",\n paddingRight: \"0.5rem\",\n height: \"23px\",\n color: \"#262626\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.25rem\",\n outlineWidth: \"0px\",\n }}\n />\n </div>\n <div style={{ flex: \"1 1 0%\" }}>\n <button\n type=\"button\"\n onClick={handlePageChange}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.75rem\",\n lineHeight: \"1rem\",\n height: \"23px\",\n paddingLeft: \"1rem\",\n paddingRight: \"1rem\",\n fontWeight: 600,\n borderRadius: \"9999px\",\n color: \"#ffffff\",\n backgroundColor: color,\n }}\n >\n Go\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default Pagination;\n","export interface Columns<T> {\n fieldId: string;\n fieldId2?: string;\n fieldId3?: string;\n label: string | React.ReactElement;\n render?: (data?: T) => React.ReactElement | string;\n renderHeader?: () => React.ReactElement | string;\n}\n\ninterface Props<T> {\n data?: any[];\n columns: Columns<T>[];\n ranked?: boolean;\n loading?: boolean | null;\n error?: string;\n action?: boolean;\n currentPage?: number;\n limit?: number;\n onRowClick?: (item: T) => void;\n color?: string;\n textColor?: string;\n}\n\nexport default function Table<T>({\n data = [],\n columns = [],\n ranked = false,\n loading = false,\n error = \"\",\n action = false,\n currentPage = 1,\n limit = 0,\n onRowClick,\n color = \"#234764\",\n textColor = \"#fff\",\n}: Props<T>): React.ReactElement {\n const handleRowClick = (item: T): void => {\n if (onRowClick !== undefined) {\n onRowClick(item);\n }\n };\n return (\n <table style={{ minWidth: \"100%\" }}>\n <thead style={{ backgroundColor: color }}>\n <tr>\n {columns.map((column, index) => (\n <th\n key={index}\n scope=\"col\"\n style={{\n borderRightWidth: \"1px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.25rem\",\n color: textColor,\n fontWeight: 600,\n }}\n >\n <div style={{ display: \"flex\", justifyContent: \"center\" }}>\n {column.label}\n {column?.renderHeader !== undefined && column?.renderHeader()}\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody style={{ backgroundColor: \"#ffffff\" }}>\n {loading !== true &&\n !error &&\n data &&\n data?.map((data, index) => (\n <tr\n key={index}\n onClick={(): void => {\n handleRowClick(data);\n }}\n role={action ? \"button\" : undefined}\n >\n {columns.map((column, row) => (\n <td\n key={row}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.75rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n {column.fieldId === \"index\" &&\n index + 1 + (currentPage - 1) * limit}\n {column?.render === undefined && data[column.fieldId]}\n <p className=\"text-gray-500\">\n {column?.fieldId2 !== undefined && data[column.fieldId2]}\n </p>\n {column?.render !== undefined && column.render(data)}\n <span>\n {column?.fieldId3 !== undefined && data[column.fieldId3]}\n </span>\n </td>\n ))}\n </tr>\n ))}\n {loading !== true && !error && !data && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n }}\n >\n <span\n style={{\n paddingTop: \"1.5rem\",\n paddingBottom: \"1.5rem\",\n color: \"#7c7c7c\",\n }}\n >\n No Data Here\n </span>\n </div>\n </td>\n </tr>\n )}\n {loading !== true && error && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n {error}\n </td>\n </tr>\n )}\n {loading === true && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n Loading...\n </td>\n </tr>\n )}\n </tbody>\n </table>\n );\n}\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","SuppressedError","_a","currentPage","totalPages","onPageChange","_b","color","_c","useState","inputPage","setInputPage","useEffect","_jsxs","style","display","gridTemplateColumns","marginTop","gap","children","_jsx","jsx","gridColumn","paddingTop","justifyContent","alignItems","href","onClick","marginLeft","marginRight","width","height","xmlns","viewBox","d","buttons","halfMaxButtons","Math","floor","maxButtons","start","max","end","min","push","backgroundColor","borderRadius","fontSize","lineHeight","generatePageButtons","flex","onChange","e","target","value","type","borderWidth","borderColor","paddingLeft","paddingRight","outlineWidth","fontWeight","data","columns","_e","loading","_f","error","_g","action","_h","_j","limit","onRowClick","_k","_l","textColor","minWidth","map","column","index","scope","borderRightWidth","borderLeftWidth","padding","textAlign","whiteSpace","label","undefined","renderHeader","jsxs","item","role","row","fieldId","render","className","fieldId2","fieldId3","colSpan","flexDirection","paddingBottom"],"mappings":"0HA+BWA,EAAW,WAQpB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAC9B,EAsRkD,mBAApBQ,iBAAiCA,mCCtTjB,SAACC,GAC7C,IAAAC,EAAWD,EAAAC,YACXC,EAAUF,EAAAE,WACVC,EAAYH,EAAAG,aACZC,EAAiBJ,EAAAK,MAAjBA,OAAK,IAAAD,EAAG,UAASA,EAEXE,EAA4BC,EAAAA,SAAcN,GAAzCO,EAASF,EAAA,GAAEG,EAAYH,EAAA,GAE9BI,EAAAA,WAAU,WACRD,EAAaR,EACf,GAAG,CAACA,IAwEJ,OACEU,OACE,MAAA3B,EAAA,CAAA4B,MAAO,CACLC,QAAS,OACTC,oBAAqB,6BACrBC,UAAW,OACXC,IAAK,SAGP,CAAAC,SAAA,CAAAC,EAAAC,IAAA,MAAA,CAAKP,MAAO,CAAEQ,WAAY,qBAC1BF,EAAAA,IAAK,MAAAlC,EAAA,CAAA4B,MAAO,CAAES,WAAY,MAAOD,WAAY,oBAAmB,CAAAH,SAC9DN,EAAAA,KACE,MAAA3B,EAAA,CAAA4B,MAAO,CACLC,QAAS,OACTS,eAAgB,SAChBC,WAAY,WAGd,CAAAN,SAAA,CAAAC,EAAAA,IAAA,IAAAlC,EAAA,CACEwC,KAAK,IACLC,QA9EiB,WACrBxB,EAAc,GAChBE,EAAaF,EAAc,EAE/B,EA2EUW,MAAO,CACLC,QAAS,cACTS,eAAgB,SAChBC,WAAY,SACZG,WAAY,SACZC,YAA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AA,2BAKF,IAAZ8C,GAAoBE,GACnB/C,EAAAA,IAAA,KAAA,CAAAD,SACEC,cACE+E,QAASpC,EAAQrE,OACjBoB,MAAO,CACLoE,iBAAkB,MAClBC,gBAAiB,MACjB1B,YAAa,UACb2B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZtC,WAAY,UACZD,SAAU,WACVxC,MAAO,YACR,CAAAY,SAEAgD,QAIM,IAAZF,GACC7C,EACEC,IAAA,KAAA,CAAAF,SAAAC,EAAAC,IAAA,KAAAnC,EAAA,CACEiH,QAASpC,EAAQrE,OACjBoB,MAAO,CACLoE,iBAAkB,MAClBC,gBAAiB,MACjB1B,YAAa,UACb2B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZtC,WAAY,UACZD,SAAU,WACVxC,MAAO,YACR,CAAAY,SAAA,yBASf"}
1
+ {"version":3,"file":"index.js","sources":["../../node_modules/tslib/tslib.es6.mjs","../../src/components/Pagination/Pagination.tsx","../../src/components/Table/Table.tsx"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { useEffect, useState } from \"react\";\ninterface PaginationProps {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n color?: string;\n}\n\nconst Pagination: React.FC<PaginationProps> = ({\n currentPage,\n totalPages,\n onPageChange,\n color = \"#234764\",\n}) => {\n const [inputPage, setInputPage] = useState<any>(currentPage);\n\n useEffect(() => {\n setInputPage(currentPage);\n }, [currentPage]);\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n setInputPage(e.target.value);\n };\n\n const handlePageChange = (): void => {\n if (inputPage >= 1 && inputPage <= totalPages) {\n onPageChange(inputPage);\n } else {\n setInputPage(currentPage);\n }\n };\n\n const handlePreviousPage = (): void => {\n if (currentPage > 1) {\n onPageChange(currentPage - 1);\n }\n };\n\n const handleNextPage = (): void => {\n if (currentPage < totalPages) {\n onPageChange(currentPage + 1);\n }\n };\n\n const handlePageButtonClick = (page: number): void => {\n onPageChange(page);\n };\n\n const generatePageButtons = (): React.ReactNode => {\n const buttons = [];\n const maxButtons = 7;\n const halfMaxButtons = Math.floor(maxButtons / 2);\n let start: number = Math.max(1, currentPage - halfMaxButtons);\n const end: number = Math.min(start + maxButtons - 1, totalPages);\n\n if (end - start < maxButtons - 1) {\n start = Math.max(1, end - maxButtons + 1);\n }\n\n for (let i = start; i <= end; i++) {\n buttons.push(\n <a\n key={i}\n href=\"#\"\n style={{\n backgroundColor: i === currentPage ? color : \"transparent\",\n color: i === currentPage ? \"#ffffff\" : \"#262626\",\n borderRadius: \"9999px\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.75rem\",\n lineHeight: \"1rem\",\n }}\n onClick={() => {\n handlePageButtonClick(i);\n }}\n >\n {i}\n </a>\n );\n }\n\n return buttons;\n };\n\n return (\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(10, minmax(0, 1fr))\",\n marginTop: \"4rem\",\n gap: \"1rem\",\n }}\n >\n <div style={{ gridColumn: \"span 2 / span 2\" }} />\n <div style={{ paddingTop: \"1px\", gridColumn: \"span 6 / span 6\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }}\n >\n <a\n href=\"#\"\n onClick={handlePreviousPage}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n color: \"#262626\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n style={{ width: \"1.5rem\", height: \"1.5rem\" }}\n >\n <path d=\"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z\" />\n </svg>\n </a>\n {generatePageButtons()}\n <a\n href=\"#\"\n onClick={handleNextPage}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n color: \"#262626\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n style={{ width: \"1.5rem\", height: \"1.5rem\" }}\n >\n <path d=\"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z\" />\n </svg>\n </a>\n </div>\n </div>\n <div style={{ gridColumn: \"span 2 / span 2\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"1rem\",\n }}\n >\n <div style={{ flex: \"none\" }}>\n <div\n style={{\n fontSize: \"0.75rem\",\n lineHeight: \"23px\",\n height: \"23px\",\n display: \"block\",\n color: \"#bdbdbd\",\n }}\n >\n Go to page\n </div>\n </div>\n <div style={{ flex: \"1 1 0%\" }}>\n <input\n onChange={handleInputChange}\n value={inputPage}\n type=\"text\"\n style={{\n borderWidth: \"1px\",\n borderRadius: \"9999px\",\n borderColor: color,\n display: \"block\",\n width: \"100%\",\n paddingLeft: \"0.5rem\",\n paddingRight: \"0.5rem\",\n height: \"23px\",\n color: \"#262626\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.25rem\",\n outlineWidth: \"0px\",\n }}\n />\n </div>\n <div style={{ flex: \"1 1 0%\" }}>\n <button\n type=\"button\"\n onClick={handlePageChange}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.75rem\",\n lineHeight: \"1rem\",\n height: \"23px\",\n paddingLeft: \"1rem\",\n paddingRight: \"1rem\",\n fontWeight: 600,\n borderRadius: \"9999px\",\n color: \"#ffffff\",\n backgroundColor: color,\n }}\n >\n Go\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default Pagination;\n","export interface Columns<T> {\n fieldId: string;\n fieldId2?: string;\n fieldId3?: string;\n label: string | React.ReactElement;\n render?: (data?: T) => React.ReactElement | string;\n renderHeader?: () => React.ReactElement | string;\n}\n\ninterface Props<T> {\n data?: any[];\n columns: Columns<T>[];\n loading?: boolean | null;\n error?: string;\n action?: boolean;\n currentPage?: number;\n limit?: number;\n onRowClick?: (item: T) => void;\n color?: string;\n textColor?: string;\n}\n\nexport default function Table<T>({\n data = [],\n columns = [],\n loading = false,\n error = \"\",\n action = false,\n currentPage = 1,\n limit = 0,\n onRowClick,\n color = \"#234764\",\n textColor = \"#fff\",\n}: Props<T>): React.ReactElement {\n const handleRowClick = (item: T): void => {\n if (onRowClick !== undefined) {\n onRowClick(item);\n }\n };\n return (\n <table style={{ minWidth: \"100%\" }}>\n <thead style={{ backgroundColor: color }}>\n <tr>\n {columns.map((column, index) => (\n <th\n key={index}\n scope=\"col\"\n style={{\n borderRightWidth: \"1px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.25rem\",\n color: textColor,\n fontWeight: 600,\n }}\n >\n <div style={{ display: \"flex\", justifyContent: \"center\" }}>\n {column.label}\n {column?.renderHeader !== undefined && column?.renderHeader()}\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody style={{ backgroundColor: \"#ffffff\" }}>\n {loading !== true &&\n !error &&\n data &&\n data?.map((data, index) => (\n <tr\n key={index}\n onClick={(): void => {\n handleRowClick(data);\n }}\n role={action ? \"button\" : undefined}\n >\n {columns.map((column, row) => (\n <td\n key={row}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.75rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n {column.fieldId === \"index\" &&\n index + 1 + (currentPage - 1) * limit}\n {column?.render === undefined && data[column.fieldId]}\n <p className=\"text-gray-500\">\n {column?.fieldId2 !== undefined && data[column.fieldId2]}\n </p>\n {column?.render !== undefined && column.render(data)}\n <span>\n {column?.fieldId3 !== undefined && data[column.fieldId3]}\n </span>\n </td>\n ))}\n </tr>\n ))}\n {loading !== true && !error && !data && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n }}\n >\n <span\n style={{\n paddingTop: \"1.5rem\",\n paddingBottom: \"1.5rem\",\n color: \"#7c7c7c\",\n }}\n >\n No Data Here\n </span>\n </div>\n </td>\n </tr>\n )}\n {loading !== true && error && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n {error}\n </td>\n </tr>\n )}\n {loading === true && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n Loading...\n </td>\n </tr>\n )}\n </tbody>\n </table>\n );\n}\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","SuppressedError","_a","currentPage","totalPages","onPageChange","_b","color","_c","useState","inputPage","setInputPage","useEffect","_jsxs","style","display","gridTemplateColumns","marginTop","gap","children","_jsx","jsx","gridColumn","paddingTop","justifyContent","alignItems","href","onClick","marginLeft","marginRight","width","height","xmlns","viewBox","d","buttons","halfMaxButtons","Math","floor","maxButtons","start","max","end","min","push","backgroundColor","borderRadius","fontSize","lineHeight","generatePageButtons","flex","onChange","e","target","value","type","borderWidth","borderColor","paddingLeft","paddingRight","outlineWidth","fontWeight","data","columns","_d","loading","_e","error","_f","action","_g","_h","limit","onRowClick","_j","_k","textColor","minWidth","map","column","index","scope","borderRightWidth","borderLeftWidth","padding","textAlign","whiteSpace","label","undefined","renderHeader","jsxs","item","role","row","fieldId","render","className","fieldId2","fieldId3","colSpan","flexDirection","paddingBottom"],"mappings":"0HA+BWA,EAAW,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EC,cACE+E,QAASpC,EAAQrE,OACjBoB,MAAO,CACLoE,iBAAkB,MAClBC,gBAAiB,MACjB1B,YAAa,UACb2B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZtC,WAAY,UACZD,SAAU,WACVxC,MAAO,YACR,CAAAY,SAEAgD,QAIM,IAAZF,GACC7C,EACEC,IAAA,KAAA,CAAAF,SAAAC,EAAAC,IAAA,KAAAnC,EAAA,CACEiH,QAASpC,EAAQrE,OACjBoB,MAAO,CACLoE,iBAAkB,MAClBC,gBAAiB,MACjB1B,YAAa,UACb2B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZtC,WAAY,UACZD,SAAU,WACVxC,MAAO,YACR,CAAAY,SAAA,yBASf"}
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as t,useEffect as i}from"react";var n=function(){return n=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},n.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var d=function(d){var o=d.currentPage,l=d.totalPages,a=d.onPageChange,c=d.color,h=void 0===c?"#234764":c,p=t(o),f=p[0],g=p[1];i((function(){g(o)}),[o]);return e("div",n({style:{display:"grid",gridTemplateColumns:"repeat(10, minmax(0, 1fr))",marginTop:"4rem",gap:"1rem"}},{children:[r("div",{style:{gridColumn:"span 2 / span 2"}}),r("div",n({style:{paddingTop:"1px",gridColumn:"span 6 / span 6"}},{children:e("div",n({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:[r("a",n({href:"#",onClick:function(){o>1&&a(o-1)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:"0.5rem",marginRight:"0.5rem",color:"#262626",width:"1.5rem",height:"1.5rem"}},{children:r("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",style:{width:"1.5rem",height:"1.5rem"}},{children:r("path",{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})}))})),function(){var e=[],t=Math.floor(3.5),i=Math.max(1,o-t),d=Math.min(i+7-1,l);d-i<6&&(i=Math.max(1,d-7+1));for(var c=function(t){e.push(r("a",n({href:"#",style:{backgroundColor:t===o?h:"transparent",color:t===o?"#ffffff":"#262626",borderRadius:"9999px",width:"1.5rem",height:"1.5rem",marginLeft:"0.5rem",marginRight:"0.5rem",display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"0.75rem",lineHeight:"1rem"},onClick:function(){a(t)}},{children:t}),t))},p=i;p<=d;p++)c(p);return e}(),r("a",n({href:"#",onClick:function(){o<l&&a(o+1)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:"0.5rem",marginRight:"0.5rem",color:"#262626",width:"1.5rem",height:"1.5rem"}},{children:r("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",style:{width:"1.5rem",height:"1.5rem"}},{children:r("path",{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})}))}))]}))})),r("div",n({style:{gridColumn:"span 2 / span 2"}},{children:e("div",n({style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem"}},{children:[r("div",n({style:{flex:"none"}},{children:r("div",n({style:{fontSize:"0.75rem",lineHeight:"23px",height:"23px",display:"block",color:"#bdbdbd"}},{children:"Go to page"}))})),r("div",n({style:{flex:"1 1 0%"}},{children:r("input",{onChange:function(e){g(e.target.value)},value:f,type:"text",style:{borderWidth:"1px",borderRadius:"9999px",borderColor:h,display:"block",width:"100%",paddingLeft:"0.5rem",paddingRight:"0.5rem",height:"23px",color:"#262626",fontSize:"0.875rem",lineHeight:"1.25rem",outlineWidth:"0px"}})})),r("div",n({style:{flex:"1 1 0%"}},{children:r("button",n({type:"button",onClick:function(){f>=1&&f<=l?a(f):g(o)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"0.75rem",lineHeight:"1rem",height:"23px",paddingLeft:"1rem",paddingRight:"1rem",fontWeight:600,borderRadius:"9999px",color:"#ffffff",backgroundColor:h}},{children:"Go"}))}))]}))}))]}))};function o(t){var i=t.data,d=void 0===i?[]:i,o=t.columns,l=void 0===o?[]:o;t.ranked;var a=t.loading,c=void 0!==a&&a,h=t.error,p=void 0===h?"":h,f=t.action,g=void 0!==f&&f,s=t.currentPage,m=void 0===s?1:s,u=t.limit,v=void 0===u?0:u,y=t.onRowClick,b=t.color,x=void 0===b?"#234764":b,C=t.textColor,w=void 0===C?"#fff":C;return e("table",n({style:{minWidth:"100%"}},{children:[r("thead",n({style:{backgroundColor:x}},{children:r("tr",{children:l.map((function(t,i){return r("th",n({scope:"col",style:{borderRightWidth:"1px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",fontSize:"0.875rem",lineHeight:"1.25rem",color:w,fontWeight:600}},{children:e("div",n({style:{display:"flex",justifyContent:"center"}},{children:[t.label,void 0!==(null==t?void 0:t.renderHeader)&&(null==t?void 0:t.renderHeader())]}))}),i)}))})})),e("tbody",n({style:{backgroundColor:"#ffffff"}},{children:[!0!==c&&!p&&d&&(null==d?void 0:d.map((function(t,i){return r("tr",n({onClick:function(){var e;e=t,void 0!==y&&y(e)},role:g?"button":void 0},{children:l.map((function(d,o){return e("td",n({style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.75rem",fontSize:"0.875rem",color:"#201B1C"}},{children:["index"===d.fieldId&&i+1+(m-1)*v,void 0===(null==d?void 0:d.render)&&t[d.fieldId],r("p",n({className:"text-gray-500"},{children:void 0!==(null==d?void 0:d.fieldId2)&&t[d.fieldId2]})),void 0!==(null==d?void 0:d.render)&&d.render(t),r("span",{children:void 0!==(null==d?void 0:d.fieldId3)&&t[d.fieldId3]})]}),o)}))}),i)}))),!0!==c&&!p&&!d&&r("tr",{children:r("td",n({colSpan:l.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:r("div",n({style:{display:"flex",flexDirection:"column",alignItems:"center"}},{children:r("span",n({style:{paddingTop:"1.5rem",paddingBottom:"1.5rem",color:"#7c7c7c"}},{children:"No Data Here"}))}))}))}),!0!==c&&p&&r("tr",{children:r("td",n({colSpan:l.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:p}))}),!0===c&&r("tr",{children:r("td",n({colSpan:l.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:"Loading..."}))})]}))]}))}export{d as Pagination,o as Table};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as t,useEffect as i}from"react";var n=function(){return n=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},n.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var d=function(d){var o=d.currentPage,l=d.totalPages,a=d.onPageChange,c=d.color,h=void 0===c?"#234764":c,p=t(o),f=p[0],g=p[1];i((function(){g(o)}),[o]);return e("div",n({style:{display:"grid",gridTemplateColumns:"repeat(10, minmax(0, 1fr))",marginTop:"4rem",gap:"1rem"}},{children:[r("div",{style:{gridColumn:"span 2 / span 2"}}),r("div",n({style:{paddingTop:"1px",gridColumn:"span 6 / span 6"}},{children:e("div",n({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:[r("a",n({href:"#",onClick:function(){o>1&&a(o-1)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:"0.5rem",marginRight:"0.5rem",color:"#262626",width:"1.5rem",height:"1.5rem"}},{children:r("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",style:{width:"1.5rem",height:"1.5rem"}},{children:r("path",{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})}))})),function(){var e=[],t=Math.floor(3.5),i=Math.max(1,o-t),d=Math.min(i+7-1,l);d-i<6&&(i=Math.max(1,d-7+1));for(var c=function(t){e.push(r("a",n({href:"#",style:{backgroundColor:t===o?h:"transparent",color:t===o?"#ffffff":"#262626",borderRadius:"9999px",width:"1.5rem",height:"1.5rem",marginLeft:"0.5rem",marginRight:"0.5rem",display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"0.75rem",lineHeight:"1rem"},onClick:function(){a(t)}},{children:t}),t))},p=i;p<=d;p++)c(p);return e}(),r("a",n({href:"#",onClick:function(){o<l&&a(o+1)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:"0.5rem",marginRight:"0.5rem",color:"#262626",width:"1.5rem",height:"1.5rem"}},{children:r("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",style:{width:"1.5rem",height:"1.5rem"}},{children:r("path",{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})}))}))]}))})),r("div",n({style:{gridColumn:"span 2 / span 2"}},{children:e("div",n({style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"1rem"}},{children:[r("div",n({style:{flex:"none"}},{children:r("div",n({style:{fontSize:"0.75rem",lineHeight:"23px",height:"23px",display:"block",color:"#bdbdbd"}},{children:"Go to page"}))})),r("div",n({style:{flex:"1 1 0%"}},{children:r("input",{onChange:function(e){g(e.target.value)},value:f,type:"text",style:{borderWidth:"1px",borderRadius:"9999px",borderColor:h,display:"block",width:"100%",paddingLeft:"0.5rem",paddingRight:"0.5rem",height:"23px",color:"#262626",fontSize:"0.875rem",lineHeight:"1.25rem",outlineWidth:"0px"}})})),r("div",n({style:{flex:"1 1 0%"}},{children:r("button",n({type:"button",onClick:function(){f>=1&&f<=l?a(f):g(o)},style:{display:"inline-flex",justifyContent:"center",alignItems:"center",fontSize:"0.75rem",lineHeight:"1rem",height:"23px",paddingLeft:"1rem",paddingRight:"1rem",fontWeight:600,borderRadius:"9999px",color:"#ffffff",backgroundColor:h}},{children:"Go"}))}))]}))}))]}))};function o(t){var i=t.data,d=void 0===i?[]:i,o=t.columns,l=void 0===o?[]:o,a=t.loading,c=void 0!==a&&a,h=t.error,p=void 0===h?"":h,f=t.action,g=void 0!==f&&f,s=t.currentPage,m=void 0===s?1:s,u=t.limit,y=void 0===u?0:u,v=t.onRowClick,b=t.color,x=void 0===b?"#234764":b,C=t.textColor,w=void 0===C?"#fff":C;return e("table",n({style:{minWidth:"100%"}},{children:[r("thead",n({style:{backgroundColor:x}},{children:r("tr",{children:l.map((function(t,i){return r("th",n({scope:"col",style:{borderRightWidth:"1px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",fontSize:"0.875rem",lineHeight:"1.25rem",color:w,fontWeight:600}},{children:e("div",n({style:{display:"flex",justifyContent:"center"}},{children:[t.label,void 0!==(null==t?void 0:t.renderHeader)&&(null==t?void 0:t.renderHeader())]}))}),i)}))})})),e("tbody",n({style:{backgroundColor:"#ffffff"}},{children:[!0!==c&&!p&&d&&(null==d?void 0:d.map((function(t,i){return r("tr",n({onClick:function(){var e;e=t,void 0!==v&&v(e)},role:g?"button":void 0},{children:l.map((function(d,o){return e("td",n({style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.75rem",fontSize:"0.875rem",color:"#201B1C"}},{children:["index"===d.fieldId&&i+1+(m-1)*y,void 0===(null==d?void 0:d.render)&&t[d.fieldId],r("p",n({className:"text-gray-500"},{children:void 0!==(null==d?void 0:d.fieldId2)&&t[d.fieldId2]})),void 0!==(null==d?void 0:d.render)&&d.render(t),r("span",{children:void 0!==(null==d?void 0:d.fieldId3)&&t[d.fieldId3]})]}),o)}))}),i)}))),!0!==c&&!p&&!d&&r("tr",{children:r("td",n({colSpan:l.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:r("div",n({style:{display:"flex",flexDirection:"column",alignItems:"center"}},{children:r("span",n({style:{paddingTop:"1.5rem",paddingBottom:"1.5rem",color:"#7c7c7c"}},{children:"No Data Here"}))}))}))}),!0!==c&&p&&r("tr",{children:r("td",n({colSpan:l.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:p}))}),!0===c&&r("tr",{children:r("td",n({colSpan:l.length,style:{borderRightWidth:"0px",borderLeftWidth:"1px",borderColor:"#bdbdbd",padding:"1rem",textAlign:"center",whiteSpace:"nowrap",lineHeight:"1.25rem",fontSize:"0.875rem",color:"#201B1C"}},{children:"Loading..."}))})]}))]}))}export{d as Pagination,o as Table};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../node_modules/tslib/tslib.es6.mjs","../../src/components/Pagination/Pagination.tsx","../../src/components/Table/Table.tsx"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { useEffect, useState } from \"react\";\ninterface PaginationProps {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n color?: string;\n}\n\nconst Pagination: React.FC<PaginationProps> = ({\n currentPage,\n totalPages,\n onPageChange,\n color = \"#234764\",\n}) => {\n const [inputPage, setInputPage] = useState<any>(currentPage);\n\n useEffect(() => {\n setInputPage(currentPage);\n }, [currentPage]);\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n setInputPage(e.target.value);\n };\n\n const handlePageChange = (): void => {\n if (inputPage >= 1 && inputPage <= totalPages) {\n onPageChange(inputPage);\n } else {\n setInputPage(currentPage);\n }\n };\n\n const handlePreviousPage = (): void => {\n if (currentPage > 1) {\n onPageChange(currentPage - 1);\n }\n };\n\n const handleNextPage = (): void => {\n if (currentPage < totalPages) {\n onPageChange(currentPage + 1);\n }\n };\n\n const handlePageButtonClick = (page: number): void => {\n onPageChange(page);\n };\n\n const generatePageButtons = (): React.ReactNode => {\n const buttons = [];\n const maxButtons = 7;\n const halfMaxButtons = Math.floor(maxButtons / 2);\n let start: number = Math.max(1, currentPage - halfMaxButtons);\n const end: number = Math.min(start + maxButtons - 1, totalPages);\n\n if (end - start < maxButtons - 1) {\n start = Math.max(1, end - maxButtons + 1);\n }\n\n for (let i = start; i <= end; i++) {\n buttons.push(\n <a\n key={i}\n href=\"#\"\n style={{\n backgroundColor: i === currentPage ? color : \"transparent\",\n color: i === currentPage ? \"#ffffff\" : \"#262626\",\n borderRadius: \"9999px\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.75rem\",\n lineHeight: \"1rem\",\n }}\n onClick={() => {\n handlePageButtonClick(i);\n }}\n >\n {i}\n </a>\n );\n }\n\n return buttons;\n };\n\n return (\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(10, minmax(0, 1fr))\",\n marginTop: \"4rem\",\n gap: \"1rem\",\n }}\n >\n <div style={{ gridColumn: \"span 2 / span 2\" }} />\n <div style={{ paddingTop: \"1px\", gridColumn: \"span 6 / span 6\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }}\n >\n <a\n href=\"#\"\n onClick={handlePreviousPage}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n color: \"#262626\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n style={{ width: \"1.5rem\", height: \"1.5rem\" }}\n >\n <path d=\"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z\" />\n </svg>\n </a>\n {generatePageButtons()}\n <a\n href=\"#\"\n onClick={handleNextPage}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n color: \"#262626\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n style={{ width: \"1.5rem\", height: \"1.5rem\" }}\n >\n <path d=\"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z\" />\n </svg>\n </a>\n </div>\n </div>\n <div style={{ gridColumn: \"span 2 / span 2\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"1rem\",\n }}\n >\n <div style={{ flex: \"none\" }}>\n <div\n style={{\n fontSize: \"0.75rem\",\n lineHeight: \"23px\",\n height: \"23px\",\n display: \"block\",\n color: \"#bdbdbd\",\n }}\n >\n Go to page\n </div>\n </div>\n <div style={{ flex: \"1 1 0%\" }}>\n <input\n onChange={handleInputChange}\n value={inputPage}\n type=\"text\"\n style={{\n borderWidth: \"1px\",\n borderRadius: \"9999px\",\n borderColor: color,\n display: \"block\",\n width: \"100%\",\n paddingLeft: \"0.5rem\",\n paddingRight: \"0.5rem\",\n height: \"23px\",\n color: \"#262626\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.25rem\",\n outlineWidth: \"0px\",\n }}\n />\n </div>\n <div style={{ flex: \"1 1 0%\" }}>\n <button\n type=\"button\"\n onClick={handlePageChange}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.75rem\",\n lineHeight: \"1rem\",\n height: \"23px\",\n paddingLeft: \"1rem\",\n paddingRight: \"1rem\",\n fontWeight: 600,\n borderRadius: \"9999px\",\n color: \"#ffffff\",\n backgroundColor: color,\n }}\n >\n Go\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default Pagination;\n","export interface Columns<T> {\n fieldId: string;\n fieldId2?: string;\n fieldId3?: string;\n label: string | React.ReactElement;\n render?: (data?: T) => React.ReactElement | string;\n renderHeader?: () => React.ReactElement | string;\n}\n\ninterface Props<T> {\n data?: any[];\n columns: Columns<T>[];\n ranked?: boolean;\n loading?: boolean | null;\n error?: string;\n action?: boolean;\n currentPage?: number;\n limit?: number;\n onRowClick?: (item: T) => void;\n color?: string;\n textColor?: string;\n}\n\nexport default function Table<T>({\n data = [],\n columns = [],\n ranked = false,\n loading = false,\n error = \"\",\n action = false,\n currentPage = 1,\n limit = 0,\n onRowClick,\n color = \"#234764\",\n textColor = \"#fff\",\n}: Props<T>): React.ReactElement {\n const handleRowClick = (item: T): void => {\n if (onRowClick !== undefined) {\n onRowClick(item);\n }\n };\n return (\n <table style={{ minWidth: \"100%\" }}>\n <thead style={{ backgroundColor: color }}>\n <tr>\n {columns.map((column, index) => (\n <th\n key={index}\n scope=\"col\"\n style={{\n borderRightWidth: \"1px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.25rem\",\n color: textColor,\n fontWeight: 600,\n }}\n >\n <div style={{ display: \"flex\", justifyContent: \"center\" }}>\n {column.label}\n {column?.renderHeader !== undefined && column?.renderHeader()}\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody style={{ backgroundColor: \"#ffffff\" }}>\n {loading !== true &&\n !error &&\n data &&\n data?.map((data, index) => (\n <tr\n key={index}\n onClick={(): void => {\n handleRowClick(data);\n }}\n role={action ? \"button\" : undefined}\n >\n {columns.map((column, row) => (\n <td\n key={row}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.75rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n {column.fieldId === \"index\" &&\n index + 1 + (currentPage - 1) * limit}\n {column?.render === undefined && data[column.fieldId]}\n <p className=\"text-gray-500\">\n {column?.fieldId2 !== undefined && data[column.fieldId2]}\n </p>\n {column?.render !== undefined && column.render(data)}\n <span>\n {column?.fieldId3 !== undefined && data[column.fieldId3]}\n </span>\n </td>\n ))}\n </tr>\n ))}\n {loading !== true && !error && !data && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n }}\n >\n <span\n style={{\n paddingTop: \"1.5rem\",\n paddingBottom: \"1.5rem\",\n color: \"#7c7c7c\",\n }}\n >\n No Data Here\n </span>\n </div>\n </td>\n </tr>\n )}\n {loading !== true && error && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n {error}\n </td>\n </tr>\n )}\n {loading === true && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n Loading...\n </td>\n </tr>\n )}\n </tbody>\n </table>\n );\n}\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","SuppressedError","Pagination","_a","currentPage","totalPages","onPageChange","_b","color","_c","useState","inputPage","setInputPage","useEffect","_jsxs","style","display","gridTemplateColumns","marginTop","gap","children","_jsx","gridColumn","paddingTop","justifyContent","alignItems","href","onClick","marginLeft","marginRight","width","height","xmlns","viewBox","d","buttons","halfMaxButtons","Math","floor","maxButtons","start","max","end","min","push","backgroundColor","borderRadius","fontSize","lineHeight","generatePageButtons","flex","onChange","e","target","value","type","borderWidth","borderColor","paddingLeft","paddingRight","outlineWidth","fontWeight","Table","data","columns","_e","loading","_f","error","_g","action","_h","_j","limit","onRowClick","_k","_l","textColor","minWidth","map","column","index","scope","borderRightWidth","borderLeftWidth","padding","textAlign","whiteSpace","label","undefined","renderHeader","item","role","row","fieldId","render","className","fieldId2","fieldId3","colSpan","flexDirection","paddingBottom"],"mappings":"kGA+BO,IAAIA,EAAW,WAQpB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAC9B,EAsRkD,mBAApBQ,iBAAiCA,gBCtTzD,IAAAC,EAAwC,SAACC,GAC7C,IAAAC,EAAWD,EAAAC,YACXC,EAAUF,EAAAE,WACVC,EAAYH,EAAAG,aAC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OAAA,CAAAD,cAAqBqE,KAArBT,aAAM,EAANA,EAAQkB,WAA0BnC,EAAKiB,EAAOkB,eArB5CL,EAwBR,MAhCIZ,QAmCE,IAAZf,IAAqBE,IAAUL,GAC9B1C,EACE,KAAA,CAAAD,SAAAC,EAAA,KAAAnC,EAAA,CACEiH,QAASnC,EAAQtE,OACjBqB,MAAO,CACLoE,iBAAkB,MAClBC,gBAAiB,MACjB3B,YAAa,UACb4B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZvC,WAAY,UACZD,SAAU,WACVvC,MAAO,YAGT,CAAAY,SAAAC,EAAA,MAAAnC,EAAA,CACE6B,MAAO,CACLC,QAAS,OACToF,cAAe,SACf3E,WAAY,WAGd,CAAAL,SAAAC,EAAA,OAAAnC,EAAA,CACE6B,MAAO,CACLQ,WAAY,SACZ8E,cAAe,SACf7F,MAAO,YAIJ,CAAAY,SAAA,2BAKF,IAAZ8C,GAAoBE,GACnB/C,EAAA,KAAA,CAAAD,SACEC,UACE8E,QAASnC,EAAQtE,OACjBqB,MAAO,CACLoE,iBAAkB,MAClBC,gBAAiB,MACjB3B,YAAa,UACb4B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZvC,WAAY,UACZD,SAAU,WACVvC,MAAO,YACR,CAAAY,SAEAgD,QAIM,IAAZF,GACC7C,EACE,KAAA,CAAAD,SAAAC,EAAA,KAAAnC,EAAA,CACEiH,QAASnC,EAAQtE,OACjBqB,MAAO,CACLoE,iBAAkB,MAClBC,gBAAiB,MACjB3B,YAAa,UACb4B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZvC,WAAY,UACZD,SAAU,WACVvC,MAAO,YACR,CAAAY,SAAA,yBASf"}
1
+ {"version":3,"file":"index.js","sources":["../../node_modules/tslib/tslib.es6.mjs","../../src/components/Pagination/Pagination.tsx","../../src/components/Table/Table.tsx"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { useEffect, useState } from \"react\";\ninterface PaginationProps {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n color?: string;\n}\n\nconst Pagination: React.FC<PaginationProps> = ({\n currentPage,\n totalPages,\n onPageChange,\n color = \"#234764\",\n}) => {\n const [inputPage, setInputPage] = useState<any>(currentPage);\n\n useEffect(() => {\n setInputPage(currentPage);\n }, [currentPage]);\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n setInputPage(e.target.value);\n };\n\n const handlePageChange = (): void => {\n if (inputPage >= 1 && inputPage <= totalPages) {\n onPageChange(inputPage);\n } else {\n setInputPage(currentPage);\n }\n };\n\n const handlePreviousPage = (): void => {\n if (currentPage > 1) {\n onPageChange(currentPage - 1);\n }\n };\n\n const handleNextPage = (): void => {\n if (currentPage < totalPages) {\n onPageChange(currentPage + 1);\n }\n };\n\n const handlePageButtonClick = (page: number): void => {\n onPageChange(page);\n };\n\n const generatePageButtons = (): React.ReactNode => {\n const buttons = [];\n const maxButtons = 7;\n const halfMaxButtons = Math.floor(maxButtons / 2);\n let start: number = Math.max(1, currentPage - halfMaxButtons);\n const end: number = Math.min(start + maxButtons - 1, totalPages);\n\n if (end - start < maxButtons - 1) {\n start = Math.max(1, end - maxButtons + 1);\n }\n\n for (let i = start; i <= end; i++) {\n buttons.push(\n <a\n key={i}\n href=\"#\"\n style={{\n backgroundColor: i === currentPage ? color : \"transparent\",\n color: i === currentPage ? \"#ffffff\" : \"#262626\",\n borderRadius: \"9999px\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.75rem\",\n lineHeight: \"1rem\",\n }}\n onClick={() => {\n handlePageButtonClick(i);\n }}\n >\n {i}\n </a>\n );\n }\n\n return buttons;\n };\n\n return (\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(10, minmax(0, 1fr))\",\n marginTop: \"4rem\",\n gap: \"1rem\",\n }}\n >\n <div style={{ gridColumn: \"span 2 / span 2\" }} />\n <div style={{ paddingTop: \"1px\", gridColumn: \"span 6 / span 6\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }}\n >\n <a\n href=\"#\"\n onClick={handlePreviousPage}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n color: \"#262626\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n style={{ width: \"1.5rem\", height: \"1.5rem\" }}\n >\n <path d=\"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z\" />\n </svg>\n </a>\n {generatePageButtons()}\n <a\n href=\"#\"\n onClick={handleNextPage}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n marginLeft: \"0.5rem\",\n marginRight: \"0.5rem\",\n color: \"#262626\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 320 512\"\n style={{ width: \"1.5rem\", height: \"1.5rem\" }}\n >\n <path d=\"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z\" />\n </svg>\n </a>\n </div>\n </div>\n <div style={{ gridColumn: \"span 2 / span 2\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"1rem\",\n }}\n >\n <div style={{ flex: \"none\" }}>\n <div\n style={{\n fontSize: \"0.75rem\",\n lineHeight: \"23px\",\n height: \"23px\",\n display: \"block\",\n color: \"#bdbdbd\",\n }}\n >\n Go to page\n </div>\n </div>\n <div style={{ flex: \"1 1 0%\" }}>\n <input\n onChange={handleInputChange}\n value={inputPage}\n type=\"text\"\n style={{\n borderWidth: \"1px\",\n borderRadius: \"9999px\",\n borderColor: color,\n display: \"block\",\n width: \"100%\",\n paddingLeft: \"0.5rem\",\n paddingRight: \"0.5rem\",\n height: \"23px\",\n color: \"#262626\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.25rem\",\n outlineWidth: \"0px\",\n }}\n />\n </div>\n <div style={{ flex: \"1 1 0%\" }}>\n <button\n type=\"button\"\n onClick={handlePageChange}\n style={{\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.75rem\",\n lineHeight: \"1rem\",\n height: \"23px\",\n paddingLeft: \"1rem\",\n paddingRight: \"1rem\",\n fontWeight: 600,\n borderRadius: \"9999px\",\n color: \"#ffffff\",\n backgroundColor: color,\n }}\n >\n Go\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default Pagination;\n","export interface Columns<T> {\n fieldId: string;\n fieldId2?: string;\n fieldId3?: string;\n label: string | React.ReactElement;\n render?: (data?: T) => React.ReactElement | string;\n renderHeader?: () => React.ReactElement | string;\n}\n\ninterface Props<T> {\n data?: any[];\n columns: Columns<T>[];\n loading?: boolean | null;\n error?: string;\n action?: boolean;\n currentPage?: number;\n limit?: number;\n onRowClick?: (item: T) => void;\n color?: string;\n textColor?: string;\n}\n\nexport default function Table<T>({\n data = [],\n columns = [],\n loading = false,\n error = \"\",\n action = false,\n currentPage = 1,\n limit = 0,\n onRowClick,\n color = \"#234764\",\n textColor = \"#fff\",\n}: Props<T>): React.ReactElement {\n const handleRowClick = (item: T): void => {\n if (onRowClick !== undefined) {\n onRowClick(item);\n }\n };\n return (\n <table style={{ minWidth: \"100%\" }}>\n <thead style={{ backgroundColor: color }}>\n <tr>\n {columns.map((column, index) => (\n <th\n key={index}\n scope=\"col\"\n style={{\n borderRightWidth: \"1px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n fontSize: \"0.875rem\",\n lineHeight: \"1.25rem\",\n color: textColor,\n fontWeight: 600,\n }}\n >\n <div style={{ display: \"flex\", justifyContent: \"center\" }}>\n {column.label}\n {column?.renderHeader !== undefined && column?.renderHeader()}\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody style={{ backgroundColor: \"#ffffff\" }}>\n {loading !== true &&\n !error &&\n data &&\n data?.map((data, index) => (\n <tr\n key={index}\n onClick={(): void => {\n handleRowClick(data);\n }}\n role={action ? \"button\" : undefined}\n >\n {columns.map((column, row) => (\n <td\n key={row}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.75rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n {column.fieldId === \"index\" &&\n index + 1 + (currentPage - 1) * limit}\n {column?.render === undefined && data[column.fieldId]}\n <p className=\"text-gray-500\">\n {column?.fieldId2 !== undefined && data[column.fieldId2]}\n </p>\n {column?.render !== undefined && column.render(data)}\n <span>\n {column?.fieldId3 !== undefined && data[column.fieldId3]}\n </span>\n </td>\n ))}\n </tr>\n ))}\n {loading !== true && !error && !data && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n }}\n >\n <span\n style={{\n paddingTop: \"1.5rem\",\n paddingBottom: \"1.5rem\",\n color: \"#7c7c7c\",\n }}\n >\n No Data Here\n </span>\n </div>\n </td>\n </tr>\n )}\n {loading !== true && error && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n {error}\n </td>\n </tr>\n )}\n {loading === true && (\n <tr>\n <td\n colSpan={columns.length}\n style={{\n borderRightWidth: \"0px\",\n borderLeftWidth: \"1px\",\n borderColor: \"#bdbdbd\",\n padding: \"1rem\",\n textAlign: \"center\",\n whiteSpace: \"nowrap\",\n lineHeight: \"1.25rem\",\n fontSize: \"0.875rem\",\n color: \"#201B1C\",\n }}\n >\n Loading...\n </td>\n </tr>\n )}\n </tbody>\n </table>\n );\n}\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","SuppressedError","Pagination","_a","currentPage","totalPages","onPageChange","_b","color","_c","useState","inputPage","setInputPage","useEffect","_jsxs","style","display","gridTemplateColumns","marginTop","gap","children","_jsx","gridColumn","paddingTop","justifyContent","alignItems","href","onClick","marginLeft","marginRight","width","height","xmlns","viewBox","d","buttons","halfMaxButtons","Math","floor","maxButtons","start","max","end","min","push","backgroundColor","borderRadius","fontSize","lineHeight","generatePageButtons","flex","onChange","e","target","value","type","borderWidth","borderColor","paddingLeft","paddingRight","outlineWidth","fontWeight","Table","data","columns","_d","loading","_e","error","_f","action","_g","_h","limit","onRowClick","_j","_k","textColor","minWidth","map","column","index","scope","borderRightWidth","borderLeftWidth","padding","textAlign","whiteSpace","label","undefined","renderHeader","item","role","row","fieldId","render","className","fieldId2","fieldId3","colSpan","flexDirection","paddingBottom"],"mappings":"kGA+BO,IAAIA,EAAW,WAQpB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAC9B,EAsRkD,mBAApBQ,iBAAiCA,gBCtTzD,IAAAC,EAAwC,SAACC,GAC7C,IAAAC,EAAWD,EAAAC,YACXC,EAAUF,EAAAE,WACVC,EAAYH,EAAAG,aACZC,EAAiBJ,EAAAK,MAAjBA,OAAK,IAAAD,EAAG,UAASA,EAEXE,EAA4BC,EAAcN,GAAzCO,EAASF,EAAA,GAAEG,EAAYH,EAAA,GAE9BI,GAAU,WACRD,EAAaR,EACf,GAAG,CAACA,IAwEJ,OACEU,EACE,MAAA5B,EAAA,CAAA6B,MAAO,CACLC,QAAS,OACTC,oBAAqB,6BACrBC,UAAW,OACXC,IAAK,SAGP,CAAAC,SAAA,CA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BAAiB,MACjB3B,YAAa,UACb4B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZvC,WAAY,UACZD,SAAU,WACVvC,MAAO,YAGT,CAAAY,SAAAC,EAAA,MAAAnC,EAAA,CACE6B,MAAO,CACLC,QAAS,OACToF,cAAe,SACf3E,WAAY,WAGd,CAAAL,SAAAC,EAAA,OAAAnC,EAAA,CACE6B,MAAO,CACLQ,WAAY,SACZ8E,cAAe,SACf7F,MAAO,YAIJ,CAAAY,SAAA,2BAKF,IAAZ8C,GAAoBE,GACnB/C,EAAA,KAAA,CAAAD,SACEC,UACE8E,QAASnC,EAAQtE,OACjBqB,MAAO,CACLoE,iBAAkB,MAClBC,gBAAiB,MACjB3B,YAAa,UACb4B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZvC,WAAY,UACZD,SAAU,WACVvC,MAAO,YACR,CAAAY,SAEAgD,QAIM,IAAZF,GACC7C,EACE,KAAA,CAAAD,SAAAC,EAAA,KAAAnC,EAAA,CACEiH,QAASnC,EAAQtE,OACjBqB,MAAO,CACLoE,iBAAkB,MAClBC,gBAAiB,MACjB3B,YAAa,UACb4B,QAAS,OACTC,UAAW,SACXC,WAAY,SACZvC,WAAY,UACZD,SAAU,WACVvC,MAAO,YACR,CAAAY,SAAA,yBASf"}
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ interface PaginationProps {
6
6
  }
7
7
  declare const Pagination: React.FC<PaginationProps>;
8
8
 
9
- interface Columns<T> {
9
+ interface Columns$1<T> {
10
10
  fieldId: string;
11
11
  fieldId2?: string;
12
12
  fieldId3?: string;
@@ -16,8 +16,7 @@ interface Columns<T> {
16
16
  }
17
17
  interface Props<T> {
18
18
  data?: any[];
19
- columns: Columns<T>[];
20
- ranked?: boolean;
19
+ columns: Columns$1<T>[];
21
20
  loading?: boolean | null;
22
21
  error?: string;
23
22
  action?: boolean;
@@ -27,6 +26,15 @@ interface Props<T> {
27
26
  color?: string;
28
27
  textColor?: string;
29
28
  }
30
- declare function Table<T>({ data, columns, ranked, loading, error, action, currentPage, limit, onRowClick, color, textColor, }: Props<T>): React.ReactElement;
29
+ declare function Table<T>({ data, columns, loading, error, action, currentPage, limit, onRowClick, color, textColor, }: Props<T>): React.ReactElement;
30
+
31
+ interface Columns<T> {
32
+ fieldId: string;
33
+ fieldId2?: string;
34
+ fieldId3?: string;
35
+ label: string | React.ReactElement;
36
+ render?: (data?: T) => React.ReactElement | string;
37
+ renderHeader?: () => React.ReactElement | string;
38
+ }
31
39
 
32
- export { Pagination, Table };
40
+ export { Columns, Pagination, Table };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quadra-component",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "NPM package for quadra karya santosa developer",
5
5
  "scripts": {
6
6
  "rollup": "rollup -c"