@dreamtree-org/twreact-ui 1.0.78 → 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +72 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +72 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -276,6 +276,26 @@ const ChevronUp = createLucideIcon$1("ChevronUp", [
|
|
|
276
276
|
*/
|
|
277
277
|
|
|
278
278
|
|
|
279
|
+
const ChevronsLeft = createLucideIcon$1("ChevronsLeft", [
|
|
280
|
+
["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
|
|
281
|
+
["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
|
|
282
|
+
]);
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* lucide-react v0.0.1 - ISC
|
|
286
|
+
*/
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
const ChevronsRight = createLucideIcon$1("ChevronsRight", [
|
|
290
|
+
["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
|
|
291
|
+
["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
|
|
292
|
+
]);
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* lucide-react v0.0.1 - ISC
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
|
|
279
299
|
const EyeOff = createLucideIcon$1("EyeOff", [
|
|
280
300
|
["path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24", key: "1jxqfv" }],
|
|
281
301
|
[
|
|
@@ -4657,7 +4677,16 @@ var Table = function Table(_ref2) {
|
|
|
4657
4677
|
className: "text-sm text-gray-700 whitespace-nowrap"
|
|
4658
4678
|
}, filteredData.length === 0 ? 0 : startIndex + 1, " -", " ", Math.min(endIndex, filteredData.length), " of ", filteredData.length, " results"), pagination && /*#__PURE__*/React.createElement("div", {
|
|
4659
4679
|
className: "flex items-center gap-1"
|
|
4660
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
4680
|
+
}, totalPages >= 4 && /*#__PURE__*/React.createElement("button", {
|
|
4681
|
+
className: "rounded-lg md:rounded-md border border-gray-300 p-2 disabled:opacity-50 hover:bg-gray-50",
|
|
4682
|
+
disabled: currentPage === 1,
|
|
4683
|
+
onClick: function onClick() {
|
|
4684
|
+
return handlePageChange(1);
|
|
4685
|
+
},
|
|
4686
|
+
"aria-label": "First page"
|
|
4687
|
+
}, /*#__PURE__*/React.createElement(ChevronsLeft, {
|
|
4688
|
+
className: "size-4 md:size-5 text-gray-800"
|
|
4689
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
4661
4690
|
className: "rounded-lg md:rounded-md border border-gray-300 p-2 disabled:opacity-50 hover:bg-gray-50",
|
|
4662
4691
|
disabled: currentPage === 1,
|
|
4663
4692
|
onClick: function onClick() {
|
|
@@ -4675,6 +4704,15 @@ var Table = function Table(_ref2) {
|
|
|
4675
4704
|
"aria-label": "Next page"
|
|
4676
4705
|
}, /*#__PURE__*/React.createElement(ChevronRight, {
|
|
4677
4706
|
className: "size-4 md:size-5 text-gray-800"
|
|
4707
|
+
})), totalPages >= 4 && /*#__PURE__*/React.createElement("button", {
|
|
4708
|
+
className: "rounded-lg md:rounded-md border border-gray-300 p-2 disabled:opacity-50 hover:bg-gray-50",
|
|
4709
|
+
disabled: currentPage === totalPages,
|
|
4710
|
+
onClick: function onClick() {
|
|
4711
|
+
return handlePageChange(totalPages);
|
|
4712
|
+
},
|
|
4713
|
+
"aria-label": "Last page"
|
|
4714
|
+
}, /*#__PURE__*/React.createElement(ChevronsRight, {
|
|
4715
|
+
className: "size-4 md:size-5 text-gray-800"
|
|
4678
4716
|
}))))), globalSearch && /*#__PURE__*/React.createElement("div", {
|
|
4679
4717
|
className: "p-4 border-b"
|
|
4680
4718
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -4950,17 +4988,29 @@ var Table = function Table(_ref2) {
|
|
|
4950
4988
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4951
4989
|
className: "text-sm text-gray-600"
|
|
4952
4990
|
}, "Page ", currentPage, " of ", totalPages), /*#__PURE__*/React.createElement("div", {
|
|
4953
|
-
className: "flex items-center gap-2"
|
|
4954
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
4955
|
-
className: "rounded-lg md:rounded-md border border-gray-300
|
|
4991
|
+
className: "flex items-center gap-1 sm:gap-2"
|
|
4992
|
+
}, totalPages >= 4 && /*#__PURE__*/React.createElement("button", {
|
|
4993
|
+
className: cn$1("rounded-lg md:rounded-md border border-gray-300 disabled:opacity-50 hover:bg-gray-50", isMobileView ? "p-2" : "px-4 py-2 text-sm"),
|
|
4994
|
+
disabled: currentPage === 1,
|
|
4995
|
+
onClick: function onClick() {
|
|
4996
|
+
return handlePageChange(1);
|
|
4997
|
+
},
|
|
4998
|
+
"aria-label": "First page"
|
|
4999
|
+
}, isMobileView ? /*#__PURE__*/React.createElement(ChevronsLeft, {
|
|
5000
|
+
className: "size-4 text-gray-800"
|
|
5001
|
+
}) : "First"), /*#__PURE__*/React.createElement("button", {
|
|
5002
|
+
className: cn$1("rounded-lg md:rounded-md border border-gray-300 disabled:opacity-50 hover:bg-gray-50", isMobileView ? "p-2" : "px-4 py-2 text-sm"),
|
|
4956
5003
|
disabled: currentPage === 1,
|
|
4957
5004
|
onClick: function onClick() {
|
|
4958
5005
|
return handlePageChange(Math.max(1, currentPage - 1));
|
|
4959
|
-
}
|
|
4960
|
-
|
|
5006
|
+
},
|
|
5007
|
+
"aria-label": "Previous page"
|
|
5008
|
+
}, isMobileView ? /*#__PURE__*/React.createElement(ChevronLeft, {
|
|
5009
|
+
className: "size-4 text-gray-800"
|
|
5010
|
+
}) : "Previous"), /*#__PURE__*/React.createElement("div", {
|
|
4961
5011
|
className: "flex items-center gap-1"
|
|
4962
5012
|
}, Array.from({
|
|
4963
|
-
length: Math.min(5, totalPages)
|
|
5013
|
+
length: Math.min(isMobileView ? 5 : 3, totalPages)
|
|
4964
5014
|
}, function (_, i) {
|
|
4965
5015
|
var pageNum;
|
|
4966
5016
|
if (totalPages <= 5) {
|
|
@@ -4983,12 +5033,24 @@ var Table = function Table(_ref2) {
|
|
|
4983
5033
|
}
|
|
4984
5034
|
}, pageNum);
|
|
4985
5035
|
})), /*#__PURE__*/React.createElement("button", {
|
|
4986
|
-
className: "rounded-lg md:rounded-md border border-gray-300
|
|
5036
|
+
className: cn$1("rounded-lg md:rounded-md border border-gray-300 disabled:opacity-50 hover:bg-gray-50", isMobileView ? "p-2" : "px-4 py-2 text-sm"),
|
|
4987
5037
|
disabled: currentPage === totalPages,
|
|
4988
5038
|
onClick: function onClick() {
|
|
4989
5039
|
return handlePageChange(Math.min(totalPages, currentPage + 1));
|
|
4990
|
-
}
|
|
4991
|
-
|
|
5040
|
+
},
|
|
5041
|
+
"aria-label": "Next page"
|
|
5042
|
+
}, isMobileView ? /*#__PURE__*/React.createElement(ChevronRight, {
|
|
5043
|
+
className: "size-4 text-gray-800"
|
|
5044
|
+
}) : "Next"), totalPages >= 4 && /*#__PURE__*/React.createElement("button", {
|
|
5045
|
+
className: cn$1("rounded-lg md:rounded-md border border-gray-300 disabled:opacity-50 hover:bg-gray-50", isMobileView ? "p-2" : "px-4 py-2 text-sm"),
|
|
5046
|
+
disabled: currentPage === totalPages,
|
|
5047
|
+
onClick: function onClick() {
|
|
5048
|
+
return handlePageChange(totalPages);
|
|
5049
|
+
},
|
|
5050
|
+
"aria-label": "Last page"
|
|
5051
|
+
}, isMobileView ? /*#__PURE__*/React.createElement(ChevronsRight, {
|
|
5052
|
+
className: "size-4 text-gray-800"
|
|
5053
|
+
}) : "Last")))));
|
|
4992
5054
|
};
|
|
4993
5055
|
|
|
4994
5056
|
var isCheckBoxInput = (element) => element.type === 'checkbox';
|