tabulify 1.0.29 → 1.0.31

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- .tabulify-wrapper{transform:translate(0)}.tabulify-container{-webkit-overflow-scrolling:touch;overflow-x:auto;position:relative}.tabulify-container.has-scroll:after,.tabulify-container.has-scroll:before{bottom:0;content:"";display:block;pointer-events:none;position:fixed;top:0;width:6px;z-index:1}.tabulify-container:before{background:linear-gradient(90deg,rgba(0,0,0,.1),transparent);transition:background .3s ease}.tabulify-container:after{background:linear-gradient(270deg,rgba(0,0,0,.1),transparent);right:0;transition:background .3s ease}.tabulify-container.hide-left-shadow:before,.tabulify-container.hide-right-shadow:after{background:transparent}.tabulify-container .no-shadow{box-shadow:inset 0 0 0 0 rgba(0,0,0,.1)}.tabulify-table{border-collapse:separate;border-radius:8px 8px 0 0;border-spacing:0;min-width:100%;text-align:start;width:100%}.tabulify-table:after{background-image:linear-gradient(270deg,rgba(0,0,0,.1),transparent);right:0}.tabulify-head tr th{background:#fafafa;border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.88);font-weight:600;position:relative;text-align:start;transition:background .2s ease}.tabulify-body tr td{border-bottom:1px solid #f0f0f0;transition:background .2s,border-color .2s}.tabulify-body tr:hover{background:#fafafa}.tabulify-cell{overflow-wrap:break-word;padding:16px;position:relative}.tabulify-head-cell-content-wrapper{align-items:center;display:flex;justify-content:space-between}.tabulify-head-cell-content-wrapper .icon-wrapper{align-items:center;display:flex;height:16px;justify-content:center;width:16px}.tabulify-pagination-wrapper{display:flex;gap:8px;justify-content:flex-end;margin-top:24px}.tabulify-pagination button{background-color:transparent;border:none;border-radius:4px;color:rgba(0,0,0,.88);padding:4px 12px}.tabulify-pagination button:hover{background:#fafafa;cursor:pointer}.tabulify-pagination button.active{border:1px solid}
1
+ .tabulify-wrapper{transform:translate(0)}.tabulify-container{-webkit-overflow-scrolling:touch;overflow-x:auto;position:relative}.tabulify-container.has-scroll:after,.tabulify-container.has-scroll:before{bottom:0;content:"";display:block;pointer-events:none;position:fixed;top:0;width:6px;z-index:1}.tabulify-container:before{background:linear-gradient(90deg,rgba(0,0,0,.1),transparent);transition:background .3s ease}.tabulify-container:after{background:linear-gradient(270deg,rgba(0,0,0,.1),transparent);right:0;transition:background .3s ease}.tabulify-container.hide-left-shadow:before,.tabulify-container.hide-right-shadow:after{background:transparent}.tabulify-container .no-shadow{box-shadow:inset 0 0 0 0 rgba(0,0,0,.1)}.tabulify-table{border-collapse:separate;border-radius:8px 8px 0 0;border-spacing:0;min-width:100%;text-align:start;width:100%}.tabulify-table:after{background-image:linear-gradient(270deg,rgba(0,0,0,.1),transparent);right:0}.tabulify-head tr th{background:#fafafa;border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.88);font-weight:600;position:relative;text-align:start;transition:background .2s ease}.tabulify-body tr td{border-bottom:1px solid #f0f0f0;transition:background .2s,border-color .2s}.tabulify-body tr:hover{background:#fafafa}.tabulify-cell{overflow-wrap:break-word;padding:16px;position:relative}.tabulify-head-cell-content-wrapper{align-items:center;display:flex;justify-content:space-between}.tabulify-head-cell-content-wrapper .icon-wrapper{align-items:center;display:flex;height:16px;justify-content:center;width:16px}.tabulify-pagination-wrapper{display:flex;gap:8px;justify-content:flex-end;margin-top:24px}.tabulify-pagination button{background-color:transparent;border:none;border-radius:4px;color:rgba(0,0,0,.88);padding:4px 12px}.tabulify-pagination button:hover{background:#fafafa;cursor:pointer}.tabulify-pagination button.active{border:1px solid}.tabulify-body tr .min-height{height:400px}.tabulify-body .tabulify-no-data{gap:8px}.tabulify-body .tabulify-loader-wrapper,.tabulify-body .tabulify-no-data{align-items:center;display:flex;flex-direction:column;justify-content:center}.tabulify-loader{animation:rotation 1s linear infinite;border:5px solid rgba(0,0,0,.88);border-bottom-color:transparent;border-radius:50%;box-sizing:border-box;display:inline-block;height:48px;width:48px}@keyframes rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
package/dist/index.cjs.js CHANGED
@@ -91,12 +91,33 @@ var SortIcon = function (_a) {
91
91
  return React.createElement(IconCartUp, null);
92
92
  };
93
93
 
94
+ var IconBrandDatabricks = function () {
95
+ return React.createElement("div", null, "IconBrandDatabricks");
96
+ };
97
+
98
+ var TableBody = function (_a) {
99
+ var _b, _c;
100
+ var paginatedData = _a.paginatedData, dataIndex = _a.dataIndex, columns = _a.columns, loading = _a.loading, onRowClick = _a.onRowClick;
101
+ if (loading)
102
+ return (React.createElement("tr", { className: "min-height" },
103
+ React.createElement("td", { rowSpan: (_b = columns === null || columns === void 0 ? void 0 : columns.length) !== null && _b !== void 0 ? _b : 1 },
104
+ React.createElement("div", { className: "tabulify-loader-wrapper", "data-testid": "fetching-data" },
105
+ React.createElement("div", { className: "tabulify-loader" })))));
106
+ if (!paginatedData || paginatedData.length < 1)
107
+ return (React.createElement("tr", { className: "min-height" },
108
+ React.createElement("td", { rowSpan: (_c = columns === null || columns === void 0 ? void 0 : columns.length) !== null && _c !== void 0 ? _c : 1 },
109
+ React.createElement("div", { className: "tabulify-no-data", "data-testid": "no-data" },
110
+ React.createElement(IconBrandDatabricks, null),
111
+ React.createElement("div", null, "No Data")))));
112
+ return paginatedData.map(function (record, index) { return (React.createElement("tr", { key: getUniqueId(record[dataIndex]), className: cx([Boolean(onRowClick) && 'has-hover']), "data-id": String(record[dataIndex]), onClick: function () { return onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(record[dataIndex]); } }, columns.map(function (column) { return (React.createElement("td", { className: "tabulify-cell", key: getUniqueId(column.key) }, column.render ? (column.render(record[column.key], record, index)) : (React.createElement(React.Fragment, null, "".concat(record[column.key]))))); }))); });
113
+ };
114
+
94
115
  // Table Component
95
116
  var Table = function (_a) {
96
- var columns = _a.columns, dataSource = _a.dataSource, rowSelection = _a.rowSelection, pagination = _a.pagination, dataIndex = _a.dataIndex, className = _a.className, width = _a.width, testId = _a.testId, sort = _a.sort, onRowClick = _a.onRowClick;
117
+ var _b = _a.columns, columns = _b === void 0 ? [] : _b, _c = _a.dataSource, dataSource = _c === void 0 ? [] : _c, rowSelection = _a.rowSelection, pagination = _a.pagination, dataIndex = _a.dataIndex, className = _a.className, width = _a.width, testId = _a.testId, sort = _a.sort, loading = _a.loading, onRowClick = _a.onRowClick;
97
118
  var containerRef = React.useRef(null);
98
- var _b = React.useState(false), isScrolledToEnd = _b[0], setIsScrolledToEnd = _b[1];
99
- var _c = React.useState(false), isScrollStarted = _c[0], setIsScrollStarted = _c[1];
119
+ var _d = React.useState(false), isScrolledToEnd = _d[0], setIsScrolledToEnd = _d[1];
120
+ var _e = React.useState(false), isScrollStarted = _e[0], setIsScrollStarted = _e[1];
100
121
  var handleScroll = function () {
101
122
  var container = containerRef.current;
102
123
  if (container) {
@@ -105,14 +126,8 @@ var Table = function (_a) {
105
126
  setIsScrolledToEnd(isAtEnd);
106
127
  }
107
128
  };
108
- var _d = React.useState((pagination === null || pagination === void 0 ? void 0 : pagination.current) || 1), currentPage = _d[0], setCurrentPage = _d[1];
129
+ var _f = React.useState((pagination === null || pagination === void 0 ? void 0 : pagination.current) || 1), currentPage = _f[0], setCurrentPage = _f[1];
109
130
  var pageSize = (pagination === null || pagination === void 0 ? void 0 : pagination.pageSize) || dataSource.length;
110
- // Handle pagination
111
- var handlePageChange = function (page) {
112
- var _a;
113
- setCurrentPage(page);
114
- (_a = pagination === null || pagination === void 0 ? void 0 : pagination.onChange) === null || _a === void 0 ? void 0 : _a.call(pagination, page);
115
- };
116
131
  // Sorted Data
117
132
  var sortedData = sortData({
118
133
  dataSource: dataSource,
@@ -123,6 +138,12 @@ var Table = function (_a) {
123
138
  var paginatedData = pagination
124
139
  ? sortedData.slice((currentPage - 1) * pageSize, currentPage * pageSize)
125
140
  : sortedData;
141
+ // Handle pagination
142
+ var handlePageChange = function (page) {
143
+ var _a;
144
+ setCurrentPage(page);
145
+ (_a = pagination === null || pagination === void 0 ? void 0 : pagination.onChange) === null || _a === void 0 ? void 0 : _a.call(pagination, page);
146
+ };
126
147
  React.useEffect(function () {
127
148
  var container = containerRef.current;
128
149
  if (container) {
@@ -148,7 +169,8 @@ var Table = function (_a) {
148
169
  React.createElement("div", { className: "tabulify-head-cell-content-wrapper" },
149
170
  React.createElement("div", null, column.title),
150
171
  React.createElement("div", { className: "icon-wrapper" }, sort && (sort === null || sort === void 0 ? void 0 : sort.sortBy) === column.key && (React.createElement(SortIcon, { sortOrder: sort.sortOrder })))))); }))),
151
- React.createElement("tbody", { className: "tabulify-body" }, paginatedData.map(function (record, index) { return (React.createElement("tr", { key: getUniqueId(record[dataIndex]), className: cx([Boolean(onRowClick) && 'has-hover']), "data-id": String(record[dataIndex]), onClick: function () { return onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(record[dataIndex]); } }, columns.map(function (column) { return (React.createElement("td", { className: "tabulify-cell", key: getUniqueId(column.key) }, column.render ? (column.render(record[column.key], record, index)) : (React.createElement(React.Fragment, null, "".concat(record[column.key]))))); }))); }))))),
172
+ React.createElement("tbody", { className: "tabulify-body", "data-testid": "table-body-content" },
173
+ React.createElement(TableBody, { paginatedData: paginatedData, dataIndex: dataIndex, columns: columns, loading: loading, onRowClick: onRowClick }))))),
152
174
  pagination && (React.createElement("div", { className: "tabulify-pagination-wrapper" },
153
175
  React.createElement(Pagination, { currentPage: currentPage, onPageChange: handlePageChange, pageSize: pageSize, total: pagination.total })))));
154
176
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/utils/index.ts","../node_modules/tslib/tslib.es6.js","../src/components/Pagination/index.tsx","../src/components/SortIcon/IconCartDown.tsx","../src/components/SortIcon/IconCartUp.tsx","../src/components/SortIcon/index.tsx","../src/components/Table/index.tsx","../src/hooks/useSortTable.ts"],"sourcesContent":["import { SortOptions } from '../types';\n\nexport const getUniqueId = (prefix: unknown): string =>\n `${prefix ?? 'id'}-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n\nexport const cx = (classNames: (string | boolean)[]): string =>\n classNames.filter((i) => i).join(' ');\n\nexport const sortData = <T>({\n dataSource,\n sortBy,\n sortOrder = 'asc',\n}: SortOptions<T>): T[] => {\n if (!sortBy || !sortOrder) return dataSource;\n return dataSource.sort((a, b) => {\n const aValue = a[sortBy];\n const bValue = b[sortBy];\n\n // Handle null or undefined values\n if (aValue == null) return 1; // Push `null` or `undefined` to the end\n if (bValue == null) return -1;\n\n // Handle numbers\n if (typeof aValue === 'number' && typeof bValue === 'number') {\n return sortOrder === 'asc' ? aValue - bValue : bValue - aValue;\n }\n\n // Handle strings\n if (typeof aValue === 'string' && typeof bValue === 'string') {\n const comparison = aValue.localeCompare(bValue);\n return sortOrder === 'asc' ? comparison : -comparison;\n }\n\n // Default to no change for unsupported types\n return 0;\n });\n};\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\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);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\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;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\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]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\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; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\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);\r\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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\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\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\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\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import React from 'react';\n\ninterface PaginationProps {\n pageSize: number;\n total: number;\n currentPage: number;\n onPageChange: (page: number) => void;\n}\n\nconst Pagination: React.FC<PaginationProps> = ({\n pageSize,\n total,\n currentPage,\n onPageChange,\n}) => {\n const totalPages = Math.ceil(total / pageSize);\n\n return (\n <div className=\"tabulify-pagination\">\n {[...Array(totalPages)].map((_, i) => (\n <button\n key={i}\n className={currentPage === i + 1 ? 'active' : ''}\n onClick={() => onPageChange(i + 1)}\n >\n {i + 1}\n </button>\n ))}\n </div>\n );\n};\n\nexport default Pagination;\n","import React from 'react';\n\nexport const IconCartDown = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n className=\"icon-cart-down\"\n data-testid=\"sort-asc\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M18 9c.852 0 1.297 .986 .783 1.623l-.076 .084l-6 6a1 1 0 0 1 -1.32 .083l-.094 -.083l-6 -6l-.083 -.094l-.054 -.077l-.054 -.096l-.017 -.036l-.027 -.067l-.032 -.108l-.01 -.053l-.01 -.06l-.004 -.057v-.118l.005 -.058l.009 -.06l.01 -.052l.032 -.108l.027 -.067l.07 -.132l.065 -.09l.073 -.081l.094 -.083l.077 -.054l.096 -.054l.036 -.017l.067 -.027l.108 -.032l.053 -.01l.06 -.01l.057 -.004l12.059 -.002z\" />\n </svg>\n );\n};\n","import React from 'react';\n\nexport const IconCartUp = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n className=\"icon-cart-up\"\n data-testid=\"sort-desc\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M11.293 7.293a1 1 0 0 1 1.32 -.083l.094 .083l6 6l.083 .094l.054 .077l.054 .096l.017 .036l.027 .067l.032 .108l.01 .053l.01 .06l.004 .057l.002 .059l-.002 .059l-.005 .058l-.009 .06l-.01 .052l-.032 .108l-.027 .067l-.07 .132l-.065 .09l-.073 .081l-.094 .083l-.077 .054l-.096 .054l-.036 .017l-.067 .027l-.108 .032l-.053 .01l-.06 .01l-.057 .004l-.059 .002h-12c-.852 0 -1.297 -.986 -.783 -1.623l.076 -.084l6 -6z\" />\n </svg>\n );\n};\n","import React from 'react';\nimport { SortOrder } from '../../types';\nimport { IconCartDown } from './IconCartDown';\nimport { IconCartUp } from './IconCartUp';\n\ninterface Props {\n sortOrder: SortOrder;\n}\nexport const SortIcon: React.FC<Props> = ({ sortOrder }) => {\n if (sortOrder === 'asc') return <IconCartDown />;\n return <IconCartUp />;\n};\n","import React, { useEffect, useRef, useState } from 'react';\nimport { TableProps } from '../../types';\nimport { cx, getUniqueId, sortData } from '../../utils';\nimport Pagination from '../Pagination';\nimport { SortIcon } from '../SortIcon';\n\n// Table Component\nconst Table = <T,>({\n columns,\n dataSource,\n rowSelection,\n pagination,\n dataIndex,\n className,\n width,\n testId,\n sort,\n onRowClick,\n}: TableProps<T>) => {\n const containerRef: React.Ref<HTMLDivElement> = useRef(null);\n\n const [isScrolledToEnd, setIsScrolledToEnd] = useState(false);\n const [isScrollStarted, setIsScrollStarted] = useState(false);\n\n const handleScroll = () => {\n const container = containerRef.current;\n if (container) {\n const isAtEnd =\n container.scrollLeft + container.clientWidth >= container.scrollWidth;\n setIsScrollStarted(container.scrollLeft > 0);\n setIsScrolledToEnd(isAtEnd);\n }\n };\n\n const [currentPage, setCurrentPage] = useState(pagination?.current || 1);\n\n const pageSize = pagination?.pageSize || dataSource.length;\n\n // Handle pagination\n const handlePageChange = (page: number) => {\n setCurrentPage(page);\n pagination?.onChange?.(page);\n };\n\n // Sorted Data\n const sortedData = sortData({\n dataSource,\n sortBy: sort?.sortBy,\n sortOrder: sort?.sortOrder,\n });\n\n // Paginate data\n const paginatedData = pagination\n ? sortedData.slice((currentPage - 1) * pageSize, currentPage * pageSize)\n : sortedData;\n\n useEffect(() => {\n const container = containerRef.current;\n if (container) {\n handleScroll(); // Initial check\n }\n }, []);\n\n return (\n <div className={className} data-testid={testId}>\n <div className=\"tabulify-wrapper\">\n <div\n className={cx([\n 'tabulify-container',\n width && 'has-scroll',\n isScrolledToEnd && 'hide-right-shadow',\n !isScrollStarted && 'hide-left-shadow',\n ])}\n ref={containerRef}\n onScroll={handleScroll}\n >\n <table className=\"tabulify-table\" style={{ width: width ?? '100%' }}>\n <thead className=\"tabulify-head\">\n <tr>\n {rowSelection && <th></th>}\n {columns.map((column) => (\n <th\n className={cx([\n 'tabulify-cell',\n Boolean(sort) && 'has-hover',\n ])}\n key={getUniqueId(column.key)}\n data-testid={`table-head-th-${String(column.key)}`}\n onClick={() => sort?.onSort(column.key)}\n >\n <div className=\"tabulify-head-cell-content-wrapper\">\n <div>{column.title}</div>\n <div className=\"icon-wrapper\">\n {sort && sort?.sortBy === column.key && (\n <SortIcon sortOrder={sort.sortOrder} />\n )}\n </div>\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody className=\"tabulify-body\">\n {paginatedData.map((record, index) => (\n <tr\n key={getUniqueId(record[dataIndex])}\n className={cx([Boolean(onRowClick) && 'has-hover'])}\n data-id={String(record[dataIndex])}\n onClick={() => onRowClick?.(record[dataIndex])}\n >\n {columns.map((column) => (\n <td className=\"tabulify-cell\" key={getUniqueId(column.key)}>\n {column.render ? (\n column.render(record[column.key], record, index)\n ) : (\n <>{`${record[column.key]}`}</>\n )}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n {pagination && (\n <div className=\"tabulify-pagination-wrapper\">\n <Pagination\n currentPage={currentPage}\n onPageChange={handlePageChange}\n pageSize={pageSize}\n total={pagination.total}\n />\n </div>\n )}\n </div>\n );\n};\n\nexport default Table;\n","import { useState } from 'react';\nimport { SortBy, SortOrder } from '../types';\n\ninterface Props<T> {\n defaultSort: SortBy<T>;\n}\nexport const useSortTable = <T>({ defaultSort }: Props<T>) => {\n const [sortBy, setSortby] = useState<SortBy<T>>(defaultSort);\n const [sortOrder, setSortOrder] = useState<SortOrder>('asc');\n\n const handleSortBy = (newSortBy: keyof T) => {\n if (newSortBy === sortBy) {\n setSortOrder((prev) => (prev === 'asc' ? 'desc' : 'asc'));\n return;\n }\n setSortby(newSortBy as SortBy<T>);\n setSortOrder('asc');\n };\n\n return { handleSortBy, sortBy, sortOrder };\n};\n"],"names":["useRef","useState","useEffect"],"mappings":";;;;AAEO,IAAM,WAAW,GAAG,UAAC,MAAe,EAAA;AACzC,IAAA,OAAA,EAAG,CAAA,MAAA,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,KAAA,CAAA,GAAA,MAAM,GAAI,IAAI,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAC,GAAG,EAAE,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE;AAA/E,CAA+E;AAE1E,IAAM,EAAE,GAAG,UAAC,UAAgC,EAAA;AACjD,IAAA,OAAA,UAAU,CAAC,MAAM,CAAC,UAAC,CAAC,EAAK,EAAA,OAAA,CAAC,CAAA,EAAA,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAArC,CAAqC;AAEhC,IAAM,QAAQ,GAAG,UAAI,EAIX,EAAA;QAHf,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,MAAM,GAAA,EAAA,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MAAM,EAAE;YACxB,YAAY,CAAC,UAAC,IAAI,EAAA,EAAK,QAAC,IAAI,KAAK,KAAK,GAAG,MAAM,GAAG,KAAK,EAAC,EAAA,CAAC;YACzD;;QAEF,SAAS,CAAC,SAAsB,CAAC;QACjC,YAAY,CAAC,KAAK,CAAC;AACrB,KAAC;IAED,OAAO,EAAE,YAAY,EAAA,YAAA,EAAE,MAAM,QAAA,EAAE,SAAS,EAAA,SAAA,EAAE;AAC5C;;;;;","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/utils/index.ts","../node_modules/tslib/tslib.es6.js","../src/components/Pagination/index.tsx","../src/components/Icons/IconCartDown.tsx","../src/components/Icons/IconCartUp.tsx","../src/components/IconSort/index.tsx","../src/components/Icons/IconBrandDatabricks.tsx","../src/components/Table/TableBody.tsx","../src/components/Table/index.tsx","../src/hooks/useSortTable.ts"],"sourcesContent":["import { SortOptions } from '../types';\n\nexport const getUniqueId = (prefix: unknown): string =>\n `${prefix ?? 'id'}-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n\nexport const cx = (classNames: (string | boolean)[]): string =>\n classNames.filter((i) => i).join(' ');\n\nexport const sortData = <T>({\n dataSource,\n sortBy,\n sortOrder = 'asc',\n}: SortOptions<T>): T[] => {\n if (!sortBy || !sortOrder) return dataSource;\n return dataSource.sort((a, b) => {\n const aValue = a[sortBy];\n const bValue = b[sortBy];\n\n // Handle null or undefined values\n if (aValue == null) return 1; // Push `null` or `undefined` to the end\n if (bValue == null) return -1;\n\n // Handle numbers\n if (typeof aValue === 'number' && typeof bValue === 'number') {\n return sortOrder === 'asc' ? aValue - bValue : bValue - aValue;\n }\n\n // Handle strings\n if (typeof aValue === 'string' && typeof bValue === 'string') {\n const comparison = aValue.localeCompare(bValue);\n return sortOrder === 'asc' ? comparison : -comparison;\n }\n\n // Default to no change for unsupported types\n return 0;\n });\n};\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\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);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\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;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\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]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\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; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\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);\r\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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\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\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\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\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import React from 'react';\n\ninterface PaginationProps {\n pageSize: number;\n total: number;\n currentPage: number;\n onPageChange: (page: number) => void;\n}\n\nconst Pagination: React.FC<PaginationProps> = ({\n pageSize,\n total,\n currentPage,\n onPageChange,\n}) => {\n const totalPages = Math.ceil(total / pageSize);\n\n return (\n <div className=\"tabulify-pagination\">\n {[...Array(totalPages)].map((_, i) => (\n <button\n key={i}\n className={currentPage === i + 1 ? 'active' : ''}\n onClick={() => onPageChange(i + 1)}\n >\n {i + 1}\n </button>\n ))}\n </div>\n );\n};\n\nexport default Pagination;\n","import React from 'react';\n\nexport const IconCartDown = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n className=\"icon-cart-down\"\n data-testid=\"sort-asc\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M18 9c.852 0 1.297 .986 .783 1.623l-.076 .084l-6 6a1 1 0 0 1 -1.32 .083l-.094 -.083l-6 -6l-.083 -.094l-.054 -.077l-.054 -.096l-.017 -.036l-.027 -.067l-.032 -.108l-.01 -.053l-.01 -.06l-.004 -.057v-.118l.005 -.058l.009 -.06l.01 -.052l.032 -.108l.027 -.067l.07 -.132l.065 -.09l.073 -.081l.094 -.083l.077 -.054l.096 -.054l.036 -.017l.067 -.027l.108 -.032l.053 -.01l.06 -.01l.057 -.004l12.059 -.002z\" />\n </svg>\n );\n};\n","import React from 'react';\n\nexport const IconCartUp = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n className=\"icon-cart-up\"\n data-testid=\"sort-desc\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M11.293 7.293a1 1 0 0 1 1.32 -.083l.094 .083l6 6l.083 .094l.054 .077l.054 .096l.017 .036l.027 .067l.032 .108l.01 .053l.01 .06l.004 .057l.002 .059l-.002 .059l-.005 .058l-.009 .06l-.01 .052l-.032 .108l-.027 .067l-.07 .132l-.065 .09l-.073 .081l-.094 .083l-.077 .054l-.096 .054l-.036 .017l-.067 .027l-.108 .032l-.053 .01l-.06 .01l-.057 .004l-.059 .002h-12c-.852 0 -1.297 -.986 -.783 -1.623l.076 -.084l6 -6z\" />\n </svg>\n );\n};\n","import React from 'react';\nimport { SortOrder } from '../../types';\nimport { IconCartDown } from '../Icons/IconCartDown';\nimport { IconCartUp } from '../Icons/IconCartUp';\n\ninterface Props {\n sortOrder: SortOrder;\n}\nexport const SortIcon: React.FC<Props> = ({ sortOrder }) => {\n if (sortOrder === 'asc') return <IconCartDown />;\n return <IconCartUp />;\n};\n","import React from 'react';\nimport { IconProps } from '../../types';\n\nconst IconBrandDatabricks: React.FC<Partial<IconProps>> = () => {\n return <div>IconBrandDatabricks</div>;\n};\n\nexport default IconBrandDatabricks;\n","import React from 'react';\nimport { cx, getUniqueId } from '../../utils';\nimport { TableBodyProps } from '../../types';\nimport IconBrandDatabricks from '../Icons/IconBrandDatabricks';\n\nexport const TableBody = <T,>({\n paginatedData,\n dataIndex,\n columns,\n loading,\n onRowClick,\n}: TableBodyProps<T>) => {\n if (loading)\n return (\n <tr className=\"min-height\">\n <td rowSpan={columns?.length ?? 1}>\n <div className=\"tabulify-loader-wrapper\" data-testid=\"fetching-data\">\n <div className=\"tabulify-loader\" />\n </div>\n </td>\n </tr>\n );\n\n if (!paginatedData || paginatedData.length < 1)\n return (\n <tr className=\"min-height\">\n <td rowSpan={columns?.length ?? 1}>\n <div className=\"tabulify-no-data\" data-testid=\"no-data\">\n <IconBrandDatabricks />\n <div>No Data</div>\n </div>\n </td>\n </tr>\n );\n\n return paginatedData.map((record, index) => (\n <tr\n key={getUniqueId(record[dataIndex])}\n className={cx([Boolean(onRowClick) && 'has-hover'])}\n data-id={String(record[dataIndex])}\n onClick={() => onRowClick?.(record[dataIndex])}\n >\n {columns.map((column) => (\n <td className=\"tabulify-cell\" key={getUniqueId(column.key)}>\n {column.render ? (\n column.render(record[column.key], record, index)\n ) : (\n <>{`${record[column.key]}`}</>\n )}\n </td>\n ))}\n </tr>\n ));\n};\n","import React, { useEffect, useRef, useState } from 'react';\nimport { TableProps } from '../../types';\nimport { cx, getUniqueId, sortData } from '../../utils';\nimport Pagination from '../Pagination';\nimport { SortIcon } from '../IconSort';\nimport { TableBody } from './TableBody';\n\n// Table Component\nconst Table = <T,>({\n columns = [],\n dataSource = [],\n rowSelection,\n pagination,\n dataIndex,\n className,\n width,\n testId,\n sort,\n loading,\n onRowClick,\n}: TableProps<T>) => {\n const containerRef: React.Ref<HTMLDivElement> = useRef(null);\n\n const [isScrolledToEnd, setIsScrolledToEnd] = useState(false);\n const [isScrollStarted, setIsScrollStarted] = useState(false);\n\n const handleScroll = () => {\n const container = containerRef.current;\n if (container) {\n const isAtEnd =\n container.scrollLeft + container.clientWidth >= container.scrollWidth;\n setIsScrollStarted(container.scrollLeft > 0);\n setIsScrolledToEnd(isAtEnd);\n }\n };\n\n const [currentPage, setCurrentPage] = useState(pagination?.current || 1);\n\n const pageSize = pagination?.pageSize || dataSource.length;\n\n // Sorted Data\n const sortedData = sortData({\n dataSource,\n sortBy: sort?.sortBy,\n sortOrder: sort?.sortOrder,\n });\n\n // Paginate data\n const paginatedData = pagination\n ? sortedData.slice((currentPage - 1) * pageSize, currentPage * pageSize)\n : sortedData;\n\n // Handle pagination\n const handlePageChange = (page: number) => {\n setCurrentPage(page);\n pagination?.onChange?.(page);\n };\n\n useEffect(() => {\n const container = containerRef.current;\n if (container) {\n handleScroll(); // Initial check\n }\n }, []);\n\n return (\n <div className={className} data-testid={testId}>\n <div className=\"tabulify-wrapper\">\n <div\n className={cx([\n 'tabulify-container',\n width && 'has-scroll',\n isScrolledToEnd && 'hide-right-shadow',\n !isScrollStarted && 'hide-left-shadow',\n ])}\n ref={containerRef}\n onScroll={handleScroll}\n >\n <table className=\"tabulify-table\" style={{ width: width ?? '100%' }}>\n <thead className=\"tabulify-head\">\n <tr>\n {rowSelection && <th></th>}\n {columns.map((column) => (\n <th\n className={cx([\n 'tabulify-cell',\n Boolean(sort) && 'has-hover',\n ])}\n key={getUniqueId(column.key)}\n data-testid={`table-head-th-${String(column.key)}`}\n onClick={() => sort?.onSort(column.key)}\n >\n <div className=\"tabulify-head-cell-content-wrapper\">\n <div>{column.title}</div>\n <div className=\"icon-wrapper\">\n {sort && sort?.sortBy === column.key && (\n <SortIcon sortOrder={sort.sortOrder} />\n )}\n </div>\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody className=\"tabulify-body\" data-testid=\"table-body-content\">\n <TableBody\n paginatedData={paginatedData}\n dataIndex={dataIndex}\n columns={columns}\n loading={loading}\n onRowClick={onRowClick}\n />\n </tbody>\n </table>\n </div>\n </div>\n {pagination && (\n <div className=\"tabulify-pagination-wrapper\">\n <Pagination\n currentPage={currentPage}\n onPageChange={handlePageChange}\n pageSize={pageSize}\n total={pagination.total}\n />\n </div>\n )}\n </div>\n );\n};\n\nexport default Table;\n","import { useState } from 'react';\nimport { SortBy, SortOrder } from '../types';\n\ninterface Props<T> {\n defaultSort: SortBy<T>;\n}\nexport const useSortTable = <T>({ defaultSort }: Props<T>) => {\n const [sortBy, setSortby] = useState<SortBy<T>>(defaultSort);\n const [sortOrder, setSortOrder] = useState<SortOrder>('asc');\n\n const handleSortBy = (newSortBy: keyof T) => {\n if (newSortBy === sortBy) {\n setSortOrder((prev) => (prev === 'asc' ? 'desc' : 'asc'));\n return;\n }\n setSortby(newSortBy as SortBy<T>);\n setSortOrder('asc');\n };\n\n return { handleSortBy, sortBy, sortOrder };\n};\n"],"names":["useRef","useState","useEffect"],"mappings":";;;;AAEO,IAAM,WAAW,GAAG,UAAC,MAAe,EAAA;AACzC,IAAA,OAAA,EAAG,CAAA,MAAA,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,KAAA,CAAA,GAAA,MAAM,GAAI,IAAI,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAC,GAAG,EAAE,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE;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AS,EAAA,SAAA,EAAE;AAC5C;;;;;","x_google_ignoreList":[1]}
@@ -1 +1 @@
1
- .tabulify-wrapper{transform:translate(0)}.tabulify-container{-webkit-overflow-scrolling:touch;overflow-x:auto;position:relative}.tabulify-container.has-scroll:after,.tabulify-container.has-scroll:before{bottom:0;content:"";display:block;pointer-events:none;position:fixed;top:0;width:6px;z-index:1}.tabulify-container:before{background:linear-gradient(90deg,rgba(0,0,0,.1),transparent);transition:background .3s ease}.tabulify-container:after{background:linear-gradient(270deg,rgba(0,0,0,.1),transparent);right:0;transition:background .3s ease}.tabulify-container.hide-left-shadow:before,.tabulify-container.hide-right-shadow:after{background:transparent}.tabulify-container .no-shadow{box-shadow:inset 0 0 0 0 rgba(0,0,0,.1)}.tabulify-table{border-collapse:separate;border-radius:8px 8px 0 0;border-spacing:0;min-width:100%;text-align:start;width:100%}.tabulify-table:after{background-image:linear-gradient(270deg,rgba(0,0,0,.1),transparent);right:0}.tabulify-head tr th{background:#fafafa;border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.88);font-weight:600;position:relative;text-align:start;transition:background .2s ease}.tabulify-body tr td{border-bottom:1px solid #f0f0f0;transition:background .2s,border-color .2s}.tabulify-body tr:hover{background:#fafafa}.tabulify-cell{overflow-wrap:break-word;padding:16px;position:relative}.tabulify-head-cell-content-wrapper{align-items:center;display:flex;justify-content:space-between}.tabulify-head-cell-content-wrapper .icon-wrapper{align-items:center;display:flex;height:16px;justify-content:center;width:16px}.tabulify-pagination-wrapper{display:flex;gap:8px;justify-content:flex-end;margin-top:24px}.tabulify-pagination button{background-color:transparent;border:none;border-radius:4px;color:rgba(0,0,0,.88);padding:4px 12px}.tabulify-pagination button:hover{background:#fafafa;cursor:pointer}.tabulify-pagination button.active{border:1px solid}
1
+ .tabulify-wrapper{transform:translate(0)}.tabulify-container{-webkit-overflow-scrolling:touch;overflow-x:auto;position:relative}.tabulify-container.has-scroll:after,.tabulify-container.has-scroll:before{bottom:0;content:"";display:block;pointer-events:none;position:fixed;top:0;width:6px;z-index:1}.tabulify-container:before{background:linear-gradient(90deg,rgba(0,0,0,.1),transparent);transition:background .3s ease}.tabulify-container:after{background:linear-gradient(270deg,rgba(0,0,0,.1),transparent);right:0;transition:background .3s ease}.tabulify-container.hide-left-shadow:before,.tabulify-container.hide-right-shadow:after{background:transparent}.tabulify-container .no-shadow{box-shadow:inset 0 0 0 0 rgba(0,0,0,.1)}.tabulify-table{border-collapse:separate;border-radius:8px 8px 0 0;border-spacing:0;min-width:100%;text-align:start;width:100%}.tabulify-table:after{background-image:linear-gradient(270deg,rgba(0,0,0,.1),transparent);right:0}.tabulify-head tr th{background:#fafafa;border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.88);font-weight:600;position:relative;text-align:start;transition:background .2s ease}.tabulify-body tr td{border-bottom:1px solid #f0f0f0;transition:background .2s,border-color .2s}.tabulify-body tr:hover{background:#fafafa}.tabulify-cell{overflow-wrap:break-word;padding:16px;position:relative}.tabulify-head-cell-content-wrapper{align-items:center;display:flex;justify-content:space-between}.tabulify-head-cell-content-wrapper .icon-wrapper{align-items:center;display:flex;height:16px;justify-content:center;width:16px}.tabulify-pagination-wrapper{display:flex;gap:8px;justify-content:flex-end;margin-top:24px}.tabulify-pagination button{background-color:transparent;border:none;border-radius:4px;color:rgba(0,0,0,.88);padding:4px 12px}.tabulify-pagination button:hover{background:#fafafa;cursor:pointer}.tabulify-pagination button.active{border:1px solid}.tabulify-body tr .min-height{height:400px}.tabulify-body .tabulify-no-data{gap:8px}.tabulify-body .tabulify-loader-wrapper,.tabulify-body .tabulify-no-data{align-items:center;display:flex;flex-direction:column;justify-content:center}.tabulify-loader{animation:rotation 1s linear infinite;border:5px solid rgba(0,0,0,.88);border-bottom-color:transparent;border-radius:50%;box-sizing:border-box;display:inline-block;height:48px;width:48px}@keyframes rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
package/dist/index.esm.js CHANGED
@@ -89,12 +89,33 @@ var SortIcon = function (_a) {
89
89
  return React.createElement(IconCartUp, null);
90
90
  };
91
91
 
92
+ var IconBrandDatabricks = function () {
93
+ return React.createElement("div", null, "IconBrandDatabricks");
94
+ };
95
+
96
+ var TableBody = function (_a) {
97
+ var _b, _c;
98
+ var paginatedData = _a.paginatedData, dataIndex = _a.dataIndex, columns = _a.columns, loading = _a.loading, onRowClick = _a.onRowClick;
99
+ if (loading)
100
+ return (React.createElement("tr", { className: "min-height" },
101
+ React.createElement("td", { rowSpan: (_b = columns === null || columns === void 0 ? void 0 : columns.length) !== null && _b !== void 0 ? _b : 1 },
102
+ React.createElement("div", { className: "tabulify-loader-wrapper", "data-testid": "fetching-data" },
103
+ React.createElement("div", { className: "tabulify-loader" })))));
104
+ if (!paginatedData || paginatedData.length < 1)
105
+ return (React.createElement("tr", { className: "min-height" },
106
+ React.createElement("td", { rowSpan: (_c = columns === null || columns === void 0 ? void 0 : columns.length) !== null && _c !== void 0 ? _c : 1 },
107
+ React.createElement("div", { className: "tabulify-no-data", "data-testid": "no-data" },
108
+ React.createElement(IconBrandDatabricks, null),
109
+ React.createElement("div", null, "No Data")))));
110
+ return paginatedData.map(function (record, index) { return (React.createElement("tr", { key: getUniqueId(record[dataIndex]), className: cx([Boolean(onRowClick) && 'has-hover']), "data-id": String(record[dataIndex]), onClick: function () { return onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(record[dataIndex]); } }, columns.map(function (column) { return (React.createElement("td", { className: "tabulify-cell", key: getUniqueId(column.key) }, column.render ? (column.render(record[column.key], record, index)) : (React.createElement(React.Fragment, null, "".concat(record[column.key]))))); }))); });
111
+ };
112
+
92
113
  // Table Component
93
114
  var Table = function (_a) {
94
- var columns = _a.columns, dataSource = _a.dataSource, rowSelection = _a.rowSelection, pagination = _a.pagination, dataIndex = _a.dataIndex, className = _a.className, width = _a.width, testId = _a.testId, sort = _a.sort, onRowClick = _a.onRowClick;
115
+ var _b = _a.columns, columns = _b === void 0 ? [] : _b, _c = _a.dataSource, dataSource = _c === void 0 ? [] : _c, rowSelection = _a.rowSelection, pagination = _a.pagination, dataIndex = _a.dataIndex, className = _a.className, width = _a.width, testId = _a.testId, sort = _a.sort, loading = _a.loading, onRowClick = _a.onRowClick;
95
116
  var containerRef = useRef(null);
96
- var _b = useState(false), isScrolledToEnd = _b[0], setIsScrolledToEnd = _b[1];
97
- var _c = useState(false), isScrollStarted = _c[0], setIsScrollStarted = _c[1];
117
+ var _d = useState(false), isScrolledToEnd = _d[0], setIsScrolledToEnd = _d[1];
118
+ var _e = useState(false), isScrollStarted = _e[0], setIsScrollStarted = _e[1];
98
119
  var handleScroll = function () {
99
120
  var container = containerRef.current;
100
121
  if (container) {
@@ -103,14 +124,8 @@ var Table = function (_a) {
103
124
  setIsScrolledToEnd(isAtEnd);
104
125
  }
105
126
  };
106
- var _d = useState((pagination === null || pagination === void 0 ? void 0 : pagination.current) || 1), currentPage = _d[0], setCurrentPage = _d[1];
127
+ var _f = useState((pagination === null || pagination === void 0 ? void 0 : pagination.current) || 1), currentPage = _f[0], setCurrentPage = _f[1];
107
128
  var pageSize = (pagination === null || pagination === void 0 ? void 0 : pagination.pageSize) || dataSource.length;
108
- // Handle pagination
109
- var handlePageChange = function (page) {
110
- var _a;
111
- setCurrentPage(page);
112
- (_a = pagination === null || pagination === void 0 ? void 0 : pagination.onChange) === null || _a === void 0 ? void 0 : _a.call(pagination, page);
113
- };
114
129
  // Sorted Data
115
130
  var sortedData = sortData({
116
131
  dataSource: dataSource,
@@ -121,6 +136,12 @@ var Table = function (_a) {
121
136
  var paginatedData = pagination
122
137
  ? sortedData.slice((currentPage - 1) * pageSize, currentPage * pageSize)
123
138
  : sortedData;
139
+ // Handle pagination
140
+ var handlePageChange = function (page) {
141
+ var _a;
142
+ setCurrentPage(page);
143
+ (_a = pagination === null || pagination === void 0 ? void 0 : pagination.onChange) === null || _a === void 0 ? void 0 : _a.call(pagination, page);
144
+ };
124
145
  useEffect(function () {
125
146
  var container = containerRef.current;
126
147
  if (container) {
@@ -146,7 +167,8 @@ var Table = function (_a) {
146
167
  React.createElement("div", { className: "tabulify-head-cell-content-wrapper" },
147
168
  React.createElement("div", null, column.title),
148
169
  React.createElement("div", { className: "icon-wrapper" }, sort && (sort === null || sort === void 0 ? void 0 : sort.sortBy) === column.key && (React.createElement(SortIcon, { sortOrder: sort.sortOrder })))))); }))),
149
- React.createElement("tbody", { className: "tabulify-body" }, paginatedData.map(function (record, index) { return (React.createElement("tr", { key: getUniqueId(record[dataIndex]), className: cx([Boolean(onRowClick) && 'has-hover']), "data-id": String(record[dataIndex]), onClick: function () { return onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(record[dataIndex]); } }, columns.map(function (column) { return (React.createElement("td", { className: "tabulify-cell", key: getUniqueId(column.key) }, column.render ? (column.render(record[column.key], record, index)) : (React.createElement(React.Fragment, null, "".concat(record[column.key]))))); }))); }))))),
170
+ React.createElement("tbody", { className: "tabulify-body", "data-testid": "table-body-content" },
171
+ React.createElement(TableBody, { paginatedData: paginatedData, dataIndex: dataIndex, columns: columns, loading: loading, onRowClick: onRowClick }))))),
150
172
  pagination && (React.createElement("div", { className: "tabulify-pagination-wrapper" },
151
173
  React.createElement(Pagination, { currentPage: currentPage, onPageChange: handlePageChange, pageSize: pageSize, total: pagination.total })))));
152
174
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/utils/index.ts","../node_modules/tslib/tslib.es6.js","../src/components/Pagination/index.tsx","../src/components/SortIcon/IconCartDown.tsx","../src/components/SortIcon/IconCartUp.tsx","../src/components/SortIcon/index.tsx","../src/components/Table/index.tsx","../src/hooks/useSortTable.ts"],"sourcesContent":["import { SortOptions } from '../types';\n\nexport const getUniqueId = (prefix: unknown): string =>\n `${prefix ?? 'id'}-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n\nexport const cx = (classNames: (string | boolean)[]): string =>\n classNames.filter((i) => i).join(' ');\n\nexport const sortData = <T>({\n dataSource,\n sortBy,\n sortOrder = 'asc',\n}: SortOptions<T>): T[] => {\n if (!sortBy || !sortOrder) return dataSource;\n return dataSource.sort((a, b) => {\n const aValue = a[sortBy];\n const bValue = b[sortBy];\n\n // Handle null or undefined values\n if (aValue == null) return 1; // Push `null` or `undefined` to the end\n if (bValue == null) return -1;\n\n // Handle numbers\n if (typeof aValue === 'number' && typeof bValue === 'number') {\n return sortOrder === 'asc' ? aValue - bValue : bValue - aValue;\n }\n\n // Handle strings\n if (typeof aValue === 'string' && typeof bValue === 'string') {\n const comparison = aValue.localeCompare(bValue);\n return sortOrder === 'asc' ? comparison : -comparison;\n }\n\n // Default to no change for unsupported types\n return 0;\n });\n};\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\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);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\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;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\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]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\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; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\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);\r\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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\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\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\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\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import React from 'react';\n\ninterface PaginationProps {\n pageSize: number;\n total: number;\n currentPage: number;\n onPageChange: (page: number) => void;\n}\n\nconst Pagination: React.FC<PaginationProps> = ({\n pageSize,\n total,\n currentPage,\n onPageChange,\n}) => {\n const totalPages = Math.ceil(total / pageSize);\n\n return (\n <div className=\"tabulify-pagination\">\n {[...Array(totalPages)].map((_, i) => (\n <button\n key={i}\n className={currentPage === i + 1 ? 'active' : ''}\n onClick={() => onPageChange(i + 1)}\n >\n {i + 1}\n </button>\n ))}\n </div>\n );\n};\n\nexport default Pagination;\n","import React from 'react';\n\nexport const IconCartDown = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n className=\"icon-cart-down\"\n data-testid=\"sort-asc\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M18 9c.852 0 1.297 .986 .783 1.623l-.076 .084l-6 6a1 1 0 0 1 -1.32 .083l-.094 -.083l-6 -6l-.083 -.094l-.054 -.077l-.054 -.096l-.017 -.036l-.027 -.067l-.032 -.108l-.01 -.053l-.01 -.06l-.004 -.057v-.118l.005 -.058l.009 -.06l.01 -.052l.032 -.108l.027 -.067l.07 -.132l.065 -.09l.073 -.081l.094 -.083l.077 -.054l.096 -.054l.036 -.017l.067 -.027l.108 -.032l.053 -.01l.06 -.01l.057 -.004l12.059 -.002z\" />\n </svg>\n );\n};\n","import React from 'react';\n\nexport const IconCartUp = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n className=\"icon-cart-up\"\n data-testid=\"sort-desc\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M11.293 7.293a1 1 0 0 1 1.32 -.083l.094 .083l6 6l.083 .094l.054 .077l.054 .096l.017 .036l.027 .067l.032 .108l.01 .053l.01 .06l.004 .057l.002 .059l-.002 .059l-.005 .058l-.009 .06l-.01 .052l-.032 .108l-.027 .067l-.07 .132l-.065 .09l-.073 .081l-.094 .083l-.077 .054l-.096 .054l-.036 .017l-.067 .027l-.108 .032l-.053 .01l-.06 .01l-.057 .004l-.059 .002h-12c-.852 0 -1.297 -.986 -.783 -1.623l.076 -.084l6 -6z\" />\n </svg>\n );\n};\n","import React from 'react';\nimport { SortOrder } from '../../types';\nimport { IconCartDown } from './IconCartDown';\nimport { IconCartUp } from './IconCartUp';\n\ninterface Props {\n sortOrder: SortOrder;\n}\nexport const SortIcon: React.FC<Props> = ({ sortOrder }) => {\n if (sortOrder === 'asc') return <IconCartDown />;\n return <IconCartUp />;\n};\n","import React, { useEffect, useRef, useState } from 'react';\nimport { TableProps } from '../../types';\nimport { cx, getUniqueId, sortData } from '../../utils';\nimport Pagination from '../Pagination';\nimport { SortIcon } from '../SortIcon';\n\n// Table Component\nconst Table = <T,>({\n columns,\n dataSource,\n rowSelection,\n pagination,\n dataIndex,\n className,\n width,\n testId,\n sort,\n onRowClick,\n}: TableProps<T>) => {\n const containerRef: React.Ref<HTMLDivElement> = useRef(null);\n\n const [isScrolledToEnd, setIsScrolledToEnd] = useState(false);\n const [isScrollStarted, setIsScrollStarted] = useState(false);\n\n const handleScroll = () => {\n const container = containerRef.current;\n if (container) {\n const isAtEnd =\n container.scrollLeft + container.clientWidth >= container.scrollWidth;\n setIsScrollStarted(container.scrollLeft > 0);\n setIsScrolledToEnd(isAtEnd);\n }\n };\n\n const [currentPage, setCurrentPage] = useState(pagination?.current || 1);\n\n const pageSize = pagination?.pageSize || dataSource.length;\n\n // Handle pagination\n const handlePageChange = (page: number) => {\n setCurrentPage(page);\n pagination?.onChange?.(page);\n };\n\n // Sorted Data\n const sortedData = sortData({\n dataSource,\n sortBy: sort?.sortBy,\n sortOrder: sort?.sortOrder,\n });\n\n // Paginate data\n const paginatedData = pagination\n ? sortedData.slice((currentPage - 1) * pageSize, currentPage * pageSize)\n : sortedData;\n\n useEffect(() => {\n const container = containerRef.current;\n if (container) {\n handleScroll(); // Initial check\n }\n }, []);\n\n return (\n <div className={className} data-testid={testId}>\n <div className=\"tabulify-wrapper\">\n <div\n className={cx([\n 'tabulify-container',\n width && 'has-scroll',\n isScrolledToEnd && 'hide-right-shadow',\n !isScrollStarted && 'hide-left-shadow',\n ])}\n ref={containerRef}\n onScroll={handleScroll}\n >\n <table className=\"tabulify-table\" style={{ width: width ?? '100%' }}>\n <thead className=\"tabulify-head\">\n <tr>\n {rowSelection && <th></th>}\n {columns.map((column) => (\n <th\n className={cx([\n 'tabulify-cell',\n Boolean(sort) && 'has-hover',\n ])}\n key={getUniqueId(column.key)}\n data-testid={`table-head-th-${String(column.key)}`}\n onClick={() => sort?.onSort(column.key)}\n >\n <div className=\"tabulify-head-cell-content-wrapper\">\n <div>{column.title}</div>\n <div className=\"icon-wrapper\">\n {sort && sort?.sortBy === column.key && (\n <SortIcon sortOrder={sort.sortOrder} />\n )}\n </div>\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody className=\"tabulify-body\">\n {paginatedData.map((record, index) => (\n <tr\n key={getUniqueId(record[dataIndex])}\n className={cx([Boolean(onRowClick) && 'has-hover'])}\n data-id={String(record[dataIndex])}\n onClick={() => onRowClick?.(record[dataIndex])}\n >\n {columns.map((column) => (\n <td className=\"tabulify-cell\" key={getUniqueId(column.key)}>\n {column.render ? (\n column.render(record[column.key], record, index)\n ) : (\n <>{`${record[column.key]}`}</>\n )}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n {pagination && (\n <div className=\"tabulify-pagination-wrapper\">\n <Pagination\n currentPage={currentPage}\n onPageChange={handlePageChange}\n pageSize={pageSize}\n total={pagination.total}\n />\n </div>\n )}\n </div>\n );\n};\n\nexport default Table;\n","import { useState } from 'react';\nimport { SortBy, SortOrder } from '../types';\n\ninterface Props<T> {\n defaultSort: SortBy<T>;\n}\nexport const useSortTable = <T>({ defaultSort }: Props<T>) => {\n const [sortBy, setSortby] = useState<SortBy<T>>(defaultSort);\n const [sortOrder, setSortOrder] = useState<SortOrder>('asc');\n\n const handleSortBy = (newSortBy: keyof T) => {\n if (newSortBy === sortBy) {\n setSortOrder((prev) => (prev === 'asc' ? 'desc' : 'asc'));\n return;\n }\n setSortby(newSortBy as SortBy<T>);\n setSortOrder('asc');\n };\n\n return { handleSortBy, sortBy, sortOrder };\n};\n"],"names":[],"mappings":";;AAEO,IAAM,WAAW,GAAG,UAAC,MAAe,EAAA;AACzC,IAAA,OAAA,EAAG,CAAA,MAAA,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,KAAA,CAAA,GAAA,MAAM,GAAI,IAAI,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAC,GAAG,EAAE,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE;AAA/E,CAA+E;AAE1E,IAAM,EAAE,GAAG,UAAC,UAAgC,EAAA;AACjD,IAAA,OAAA,UAAU,CAAC,MAAM,CAAC,UAAC,CAAC,EAAK,EAAA,OAAA,CAAC,CAAA,EAAA,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAArC,CAAqC;AAEhC,IAAM,QAAQ,GAAG,UAAI,EAIX,EAAA;QAHf,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,iBAAiB,EAAjB,SAA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AA,EAAK,QAAC,IAAI,KAAK,KAAK,GAAG,MAAM,GAAG,KAAK,EAAC,EAAA,CAAC;YACzD;;QAEF,SAAS,CAAC,SAAsB,CAAC;QACjC,YAAY,CAAC,KAAK,CAAC;AACrB,KAAC;IAED,OAAO,EAAE,YAAY,EAAA,YAAA,EAAE,MAAM,QAAA,EAAE,SAAS,EAAA,SAAA,EAAE;AAC5C;;;;","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/utils/index.ts","../node_modules/tslib/tslib.es6.js","../src/components/Pagination/index.tsx","../src/components/Icons/IconCartDown.tsx","../src/components/Icons/IconCartUp.tsx","../src/components/IconSort/index.tsx","../src/components/Icons/IconBrandDatabricks.tsx","../src/components/Table/TableBody.tsx","../src/components/Table/index.tsx","../src/hooks/useSortTable.ts"],"sourcesContent":["import { SortOptions } from '../types';\n\nexport const getUniqueId = (prefix: unknown): string =>\n `${prefix ?? 'id'}-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n\nexport const cx = (classNames: (string | boolean)[]): string =>\n classNames.filter((i) => i).join(' ');\n\nexport const sortData = <T>({\n dataSource,\n sortBy,\n sortOrder = 'asc',\n}: SortOptions<T>): T[] => {\n if (!sortBy || !sortOrder) return dataSource;\n return dataSource.sort((a, b) => {\n const aValue = a[sortBy];\n const bValue = b[sortBy];\n\n // Handle null or undefined values\n if (aValue == null) return 1; // Push `null` or `undefined` to the end\n if (bValue == null) return -1;\n\n // Handle numbers\n if (typeof aValue === 'number' && typeof bValue === 'number') {\n return sortOrder === 'asc' ? aValue - bValue : bValue - aValue;\n }\n\n // Handle strings\n if (typeof aValue === 'string' && typeof bValue === 'string') {\n const comparison = aValue.localeCompare(bValue);\n return sortOrder === 'asc' ? comparison : -comparison;\n }\n\n // Default to no change for unsupported types\n return 0;\n });\n};\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\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);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\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;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\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]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\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; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\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);\r\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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\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\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\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\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import React from 'react';\n\ninterface PaginationProps {\n pageSize: number;\n total: number;\n currentPage: number;\n onPageChange: (page: number) => void;\n}\n\nconst Pagination: React.FC<PaginationProps> = ({\n pageSize,\n total,\n currentPage,\n onPageChange,\n}) => {\n const totalPages = Math.ceil(total / pageSize);\n\n return (\n <div className=\"tabulify-pagination\">\n {[...Array(totalPages)].map((_, i) => (\n <button\n key={i}\n className={currentPage === i + 1 ? 'active' : ''}\n onClick={() => onPageChange(i + 1)}\n >\n {i + 1}\n </button>\n ))}\n </div>\n );\n};\n\nexport default Pagination;\n","import React from 'react';\n\nexport const IconCartDown = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n className=\"icon-cart-down\"\n data-testid=\"sort-asc\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M18 9c.852 0 1.297 .986 .783 1.623l-.076 .084l-6 6a1 1 0 0 1 -1.32 .083l-.094 -.083l-6 -6l-.083 -.094l-.054 -.077l-.054 -.096l-.017 -.036l-.027 -.067l-.032 -.108l-.01 -.053l-.01 -.06l-.004 -.057v-.118l.005 -.058l.009 -.06l.01 -.052l.032 -.108l.027 -.067l.07 -.132l.065 -.09l.073 -.081l.094 -.083l.077 -.054l.096 -.054l.036 -.017l.067 -.027l.108 -.032l.053 -.01l.06 -.01l.057 -.004l12.059 -.002z\" />\n </svg>\n );\n};\n","import React from 'react';\n\nexport const IconCartUp = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n className=\"icon-cart-up\"\n data-testid=\"sort-desc\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M11.293 7.293a1 1 0 0 1 1.32 -.083l.094 .083l6 6l.083 .094l.054 .077l.054 .096l.017 .036l.027 .067l.032 .108l.01 .053l.01 .06l.004 .057l.002 .059l-.002 .059l-.005 .058l-.009 .06l-.01 .052l-.032 .108l-.027 .067l-.07 .132l-.065 .09l-.073 .081l-.094 .083l-.077 .054l-.096 .054l-.036 .017l-.067 .027l-.108 .032l-.053 .01l-.06 .01l-.057 .004l-.059 .002h-12c-.852 0 -1.297 -.986 -.783 -1.623l.076 -.084l6 -6z\" />\n </svg>\n );\n};\n","import React from 'react';\nimport { SortOrder } from '../../types';\nimport { IconCartDown } from '../Icons/IconCartDown';\nimport { IconCartUp } from '../Icons/IconCartUp';\n\ninterface Props {\n sortOrder: SortOrder;\n}\nexport const SortIcon: React.FC<Props> = ({ sortOrder }) => {\n if (sortOrder === 'asc') return <IconCartDown />;\n return <IconCartUp />;\n};\n","import React from 'react';\nimport { IconProps } from '../../types';\n\nconst IconBrandDatabricks: React.FC<Partial<IconProps>> = () => {\n return <div>IconBrandDatabricks</div>;\n};\n\nexport default IconBrandDatabricks;\n","import React from 'react';\nimport { cx, getUniqueId } from '../../utils';\nimport { TableBodyProps } from '../../types';\nimport IconBrandDatabricks from '../Icons/IconBrandDatabricks';\n\nexport const TableBody = <T,>({\n paginatedData,\n dataIndex,\n columns,\n loading,\n onRowClick,\n}: TableBodyProps<T>) => {\n if (loading)\n return (\n <tr className=\"min-height\">\n <td rowSpan={columns?.length ?? 1}>\n <div className=\"tabulify-loader-wrapper\" data-testid=\"fetching-data\">\n <div className=\"tabulify-loader\" />\n </div>\n </td>\n </tr>\n );\n\n if (!paginatedData || paginatedData.length < 1)\n return (\n <tr className=\"min-height\">\n <td rowSpan={columns?.length ?? 1}>\n <div className=\"tabulify-no-data\" data-testid=\"no-data\">\n <IconBrandDatabricks />\n <div>No Data</div>\n </div>\n </td>\n </tr>\n );\n\n return paginatedData.map((record, index) => (\n <tr\n key={getUniqueId(record[dataIndex])}\n className={cx([Boolean(onRowClick) && 'has-hover'])}\n data-id={String(record[dataIndex])}\n onClick={() => onRowClick?.(record[dataIndex])}\n >\n {columns.map((column) => (\n <td className=\"tabulify-cell\" key={getUniqueId(column.key)}>\n {column.render ? (\n column.render(record[column.key], record, index)\n ) : (\n <>{`${record[column.key]}`}</>\n )}\n </td>\n ))}\n </tr>\n ));\n};\n","import React, { useEffect, useRef, useState } from 'react';\nimport { TableProps } from '../../types';\nimport { cx, getUniqueId, sortData } from '../../utils';\nimport Pagination from '../Pagination';\nimport { SortIcon } from '../IconSort';\nimport { TableBody } from './TableBody';\n\n// Table Component\nconst Table = <T,>({\n columns = [],\n dataSource = [],\n rowSelection,\n pagination,\n dataIndex,\n className,\n width,\n testId,\n sort,\n loading,\n onRowClick,\n}: TableProps<T>) => {\n const containerRef: React.Ref<HTMLDivElement> = useRef(null);\n\n const [isScrolledToEnd, setIsScrolledToEnd] = useState(false);\n const [isScrollStarted, setIsScrollStarted] = useState(false);\n\n const handleScroll = () => {\n const container = containerRef.current;\n if (container) {\n const isAtEnd =\n container.scrollLeft + container.clientWidth >= container.scrollWidth;\n setIsScrollStarted(container.scrollLeft > 0);\n setIsScrolledToEnd(isAtEnd);\n }\n };\n\n const [currentPage, setCurrentPage] = useState(pagination?.current || 1);\n\n const pageSize = pagination?.pageSize || dataSource.length;\n\n // Sorted Data\n const sortedData = sortData({\n dataSource,\n sortBy: sort?.sortBy,\n sortOrder: sort?.sortOrder,\n });\n\n // Paginate data\n const paginatedData = pagination\n ? sortedData.slice((currentPage - 1) * pageSize, currentPage * pageSize)\n : sortedData;\n\n // Handle pagination\n const handlePageChange = (page: number) => {\n setCurrentPage(page);\n pagination?.onChange?.(page);\n };\n\n useEffect(() => {\n const container = containerRef.current;\n if (container) {\n handleScroll(); // Initial check\n }\n }, []);\n\n return (\n <div className={className} data-testid={testId}>\n <div className=\"tabulify-wrapper\">\n <div\n className={cx([\n 'tabulify-container',\n width && 'has-scroll',\n isScrolledToEnd && 'hide-right-shadow',\n !isScrollStarted && 'hide-left-shadow',\n ])}\n ref={containerRef}\n onScroll={handleScroll}\n >\n <table className=\"tabulify-table\" style={{ width: width ?? '100%' }}>\n <thead className=\"tabulify-head\">\n <tr>\n {rowSelection && <th></th>}\n {columns.map((column) => (\n <th\n className={cx([\n 'tabulify-cell',\n Boolean(sort) && 'has-hover',\n ])}\n key={getUniqueId(column.key)}\n data-testid={`table-head-th-${String(column.key)}`}\n onClick={() => sort?.onSort(column.key)}\n >\n <div className=\"tabulify-head-cell-content-wrapper\">\n <div>{column.title}</div>\n <div className=\"icon-wrapper\">\n {sort && sort?.sortBy === column.key && (\n <SortIcon sortOrder={sort.sortOrder} />\n )}\n </div>\n </div>\n </th>\n ))}\n </tr>\n </thead>\n <tbody className=\"tabulify-body\" data-testid=\"table-body-content\">\n <TableBody\n paginatedData={paginatedData}\n dataIndex={dataIndex}\n columns={columns}\n loading={loading}\n onRowClick={onRowClick}\n />\n </tbody>\n </table>\n </div>\n </div>\n {pagination && (\n <div className=\"tabulify-pagination-wrapper\">\n <Pagination\n currentPage={currentPage}\n onPageChange={handlePageChange}\n pageSize={pageSize}\n total={pagination.total}\n />\n </div>\n )}\n </div>\n );\n};\n\nexport default Table;\n","import { useState } from 'react';\nimport { SortBy, SortOrder } from '../types';\n\ninterface Props<T> {\n defaultSort: SortBy<T>;\n}\nexport const useSortTable = <T>({ defaultSort }: Props<T>) => {\n const [sortBy, setSortby] = useState<SortBy<T>>(defaultSort);\n const [sortOrder, setSortOrder] = useState<SortOrder>('asc');\n\n const handleSortBy = (newSortBy: keyof T) => {\n if (newSortBy === sortBy) {\n setSortOrder((prev) => (prev === 'asc' ? 'desc' : 'asc'));\n return;\n }\n setSortby(newSortBy as SortBy<T>);\n setSortOrder('asc');\n };\n\n return { handleSortBy, sortBy, sortOrder };\n};\n"],"names":[],"mappings":";;AAEO,IAAM,WAAW,GAAG,UAAC,MAAe,EAAA;AACzC,IAAA,OAAA,EAAG,CAAA,MAAA,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,KAAA,CAAA,GAAA,MAAM,GAAI,IAAI,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAC,GAAG,EAAE,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE;AAA/E,CAA+E;AAE1E,IAAM,EAAE,GAAG,UAAC,UAAgC,EAAA;AACjD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
+ import React from 'react';
2
+ import { IconProps } from '../../types';
3
+ declare const IconBrandDatabricks: React.FC<Partial<IconProps>>;
4
+ export default IconBrandDatabricks;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { TableBodyProps } from '../../types';
3
+ export declare const TableBody: <T>({ paginatedData, dataIndex, columns, loading, onRowClick, }: TableBodyProps<T>) => React.JSX.Element | React.JSX.Element[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { TableProps } from '../../types';
3
- declare const Table: <T>({ columns, dataSource, rowSelection, pagination, dataIndex, className, width, testId, sort, onRowClick, }: TableProps<T>) => React.JSX.Element;
3
+ declare const Table: <T>({ columns, dataSource, rowSelection, pagination, dataIndex, className, width, testId, sort, loading, onRowClick, }: TableProps<T>) => React.JSX.Element;
4
4
  export default Table;
@@ -40,5 +40,17 @@ export interface TableProps<T> {
40
40
  className?: string;
41
41
  width?: string;
42
42
  testId?: string;
43
+ loading?: boolean;
43
44
  onRowClick?: (id: T[keyof T]) => void;
44
45
  }
46
+ export interface TableBodyProps<T> {
47
+ paginatedData: T[];
48
+ dataIndex: keyof T;
49
+ columns: Column<T>[];
50
+ loading?: boolean;
51
+ onRowClick?: (id: T[keyof T]) => void;
52
+ }
53
+ export interface IconProps {
54
+ width: string;
55
+ height: string;
56
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabulify",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "type": "module",
5
5
  "description": "A lightweight and customizable React table component.",
6
6
  "scripts": {