funuicss 3.4.4 → 3.4.5

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.4.4",
2
+ "version": "3.4.5",
3
3
  "name": "funuicss",
4
4
  "description": "React and Next.js component UI Library for creating Easy and good looking websites with fewer lines of code. Elevate your web development experience with our cutting-edge React/Next.js component UI Library. Craft stunning websites effortlessly, boasting both seamless functionality and aesthetic appeal—all achieved with minimal lines of code. Unleash the power of simplicity and style in your projects!",
5
5
  "main": "index.js",
package/ui/table/Table.js CHANGED
@@ -89,6 +89,7 @@ var ToolTip_1 = __importDefault(require("../tooltip/ToolTip"));
89
89
  var Tip_1 = __importDefault(require("../tooltip/Tip"));
90
90
  var Flex_1 = __importDefault(require("../flex/Flex"));
91
91
  var ci_1 = require("react-icons/ci");
92
+ var io5_1 = require("react-icons/io5");
92
93
  function Table(_a) {
93
94
  var _b, _c;
94
95
  var children = _a.children, funcss = _a.funcss, bordered = _a.bordered, noStripped = _a.noStripped, hoverable = _a.hoverable, _d = _a.title, title = _d === void 0 ? "" : _d, showTotal = _a.showTotal, light = _a.light, dark = _a.dark, head = _a.head, body = _a.body, data = _a.data, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, right = _a.right, hideExport = _a.hideExport, height = _a.height, _f = _a.pageSize, pageSize = _f === void 0 ? data ? 10 : 0 : _f, // Default page size,
@@ -105,7 +106,7 @@ function Table(_a) {
105
106
  var endIndex = data ? Math.min(startIndex + pageSize, ((_c = data === null || data === void 0 ? void 0 : data.data) === null || _c === void 0 ? void 0 : _c.length) || 0) : 0;
106
107
  var _j = (0, react_1.useState)(null), selectedField = _j[0], setSelectedField = _j[1];
107
108
  var _k = (0, react_1.useState)(null), selectedValue = _k[0], setSelectedValue = _k[1];
108
- var _l = (0, react_1.useState)(false), showSearch = _l[0], setshowSearch = _l[1];
109
+ var _l = (0, react_1.useState)(true), showSearch = _l[0], setshowSearch = _l[1];
109
110
  var _m = (0, react_1.useState)(""), searchQuery = _m[0], setsearchQuery = _m[1];
110
111
  // Enhanced filter logic:
111
112
  var normalize = function (val) { return val === null || val === void 0 ? void 0 : val.toString().toLowerCase().trim(); };
@@ -197,10 +198,10 @@ function Table(_a) {
197
198
  React.createElement("div", null,
198
199
  React.createElement(Text_1.default, { text: 'Records: ', size: 'sm' }),
199
200
  React.createElement(Text_1.default, { text: filteredData.length, weight: 600, color: 'primary' }))),
200
- data && filterableFields ?
201
+ data ?
201
202
  React.createElement("div", null,
202
203
  React.createElement(Flex_1.default, { width: '100%', wrap: 'nowrap', alignItems: 'center', gap: 0.7 },
203
- !selectedField && !showSearch &&
204
+ !selectedField && !showSearch && filterableFields &&
204
205
  React.createElement("div", { className: '' },
205
206
  React.createElement(Select_1.default, { fullWidth: true, searchable: true, funcss: 'min-w-300 w-full', rounded: true, value: selectedField || '', onChange: function (e) { return handleFieldChange(e); }, options: __spreadArray([
206
207
  { text: '🔍 Filter', value: '' },
@@ -209,7 +210,7 @@ function Table(_a) {
209
210
  text: field,
210
211
  value: field
211
212
  }); }), true) })),
212
- selectedField && !showSearch && (React.createElement("div", { className: '' },
213
+ selectedField && !showSearch && filterableFields && (React.createElement("div", { className: '' },
213
214
  React.createElement(Select_1.default, { rounded: true, searchable: true, funcss: 'min-w-300 w-full', fullWidth: true, value: selectedValue || '', onChange: function (e) {
214
215
  if (e === 'clear_all') {
215
216
  setSelectedField('');
@@ -235,8 +236,10 @@ function Table(_a) {
235
236
  React.createElement("div", { className: 'animated fade-in' },
236
237
  React.createElement("div", { onClick: function () { return setshowSearch(false); } },
237
238
  React.createElement(ToolTip_1.default, null,
238
- React.createElement(pi_1.PiXThin, { className: 'pointer', size: 23, onClick: function () { return setshowSearch(false); } }),
239
- React.createElement(Tip_1.default, { tip: "bottom", animation: "Opacity", duration: 1, content: "Close Search" })))))
239
+ filterableFields ? React.createElement(io5_1.IoFilterOutline, null)
240
+ :
241
+ React.createElement(pi_1.PiXThin, { className: 'pointer', size: 23, onClick: function () { return setshowSearch(false); } }),
242
+ React.createElement(Tip_1.default, { tip: "bottom", animation: "Opacity", duration: 1, content: filterableFields ? "Filter" : "Close Search" })))))
240
243
  :
241
244
  React.createElement("div", { className: 'animated fade-in' },
242
245
  React.createElement(ToolTip_1.default, null,