@ssplib/react-components 0.0.201 → 0.0.203

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.
@@ -456,8 +456,8 @@ function Table({ columns, fetchFunc, emptyMsg = {
456
456
  function category(type, keyName, uniqueName, customValue, referencekey) {
457
457
  if (type === 'a-z') {
458
458
  rawList = rawList.sort((a, b) => {
459
- const aValue = a[keyName];
460
- const bValue = b[keyName];
459
+ const aValue = String(a[keyName]);
460
+ const bValue = String(b[keyName]);
461
461
  const valueA = typeof aValue === 'number' ? aValue : aValue.toLowerCase();
462
462
  const valueB = typeof bValue === 'number' ? bValue : bValue.toLowerCase();
463
463
  if (valueA < valueB) {
@@ -471,8 +471,8 @@ function Table({ columns, fetchFunc, emptyMsg = {
471
471
  } //
472
472
  else if (type === 'z-a') {
473
473
  rawList = rawList.sort((a, b) => {
474
- const aValue = a[keyName];
475
- const bValue = b[keyName];
474
+ const aValue = String(a[keyName]);
475
+ const bValue = String(b[keyName]);
476
476
  const valueA = typeof aValue === 'number' ? aValue : aValue.toLowerCase();
477
477
  const valueB = typeof bValue === 'number' ? bValue : bValue.toLowerCase();
478
478
  if (valueA < valueB) {
@@ -486,15 +486,17 @@ function Table({ columns, fetchFunc, emptyMsg = {
486
486
  } //
487
487
  else if (type === 'items') {
488
488
  rawList = rawList
489
- .filter((x) => x[keyName].toLowerCase().includes(customValue))
489
+ .filter((x) => String(x[keyName])
490
+ .toLowerCase()
491
+ .includes(customValue !== null && customValue !== void 0 ? customValue : ''))
490
492
  .sort((a, b) => {
491
- const aValue = a[keyName];
492
- const bValue = b[keyName];
493
+ const aValue = String(a[keyName]);
494
+ const bValue = String(b[keyName]);
493
495
  const valueA = typeof aValue === 'number' ? aValue : aValue.toLowerCase();
494
496
  const valueB = typeof bValue === 'number' ? bValue : bValue.toLowerCase();
495
- if (valueA.includes(customValue))
497
+ if (valueA.includes(customValue !== null && customValue !== void 0 ? customValue : ''))
496
498
  return -1;
497
- if (valueB.includes(customValue))
499
+ if (valueB.includes(customValue !== null && customValue !== void 0 ? customValue : ''))
498
500
  return 1;
499
501
  if (valueA < valueB) {
500
502
  return -1;
@@ -507,7 +509,7 @@ function Table({ columns, fetchFunc, emptyMsg = {
507
509
  if (referencekey) {
508
510
  const data = [];
509
511
  let newFiltered = rawList.filter((x) => {
510
- const item = x[keyName];
512
+ const item = String(x[keyName]);
511
513
  const value = typeof item === 'number' ? item : item.toLowerCase();
512
514
  if (value === customValue) {
513
515
  data.push(x);
@@ -516,8 +518,8 @@ function Table({ columns, fetchFunc, emptyMsg = {
516
518
  return true;
517
519
  });
518
520
  data.sort((a, b) => {
519
- const aValue = a[referencekey];
520
- const bValue = b[referencekey];
521
+ const aValue = String(a[referencekey]);
522
+ const bValue = String(b[referencekey]);
521
523
  const valueA = typeof aValue === 'number' ? aValue : aValue.toLowerCase();
522
524
  const valueB = typeof bValue === 'number' ? bValue : bValue.toLowerCase();
523
525
  if (valueA < valueB) {
@@ -98,7 +98,7 @@ function TabNavBar(_a) {
98
98
  }
99
99
  return (react_1.default.createElement(react_1.default.Fragment, null,
100
100
  react_1.default.createElement(material_1.Box, { position: pos, sx: { width: '100%', zIndex: 100 } },
101
- react_1.default.createElement(material_1.AppBar, { position: 'relative', elevation: 0, sx: { backgroundColor: 'red', color: 'black', paddingY: 1, paddingX: { xs: 1, md: 4 } } },
101
+ react_1.default.createElement(material_1.AppBar, { position: 'relative', elevation: 0, sx: { backgroundColor: 'white', color: 'black', paddingX: { xs: 1, md: 4 } } },
102
102
  react_1.default.createElement(material_1.Stack, { direction: 'row', justifyContent: 'space-between' },
103
103
  react_1.default.createElement(material_1.Stack, { direction: 'row', alignItems: 'center', spacing: 2, marginRight: 2, sx: { display: { xs: 'none', md: 'flex' }, width: '100%' } },
104
104
  react_1.default.createElement(link_1.default, { href: '/' }, next ? react_1.default.createElement(image_1.default, { src: img, alt: title, width: 40, height: 40 }) : react_1.default.createElement("img", { src: img, height: 35 })),
@@ -106,7 +106,7 @@ function TabNavBar(_a) {
106
106
  react_1.default.createElement(material_1.Typography, { variant: 'subtitle1', fontWeight: 600 }, title))),
107
107
  react_1.default.createElement(material_1.Stack, { direction: 'row', width: '100%', justifyContent: 'center', alignItems: 'center', spacing: 2, sx: { display: { xs: 'none', md: 'flex' } } }, links.map((x) => {
108
108
  var _a;
109
- return (react_1.default.createElement(material_1.Box, { borderBottom: next ? (verificarRota((_a = router === null || router === void 0 ? void 0 : router.pathname) !== null && _a !== void 0 ? _a : '', x.path) ? `solid 4px ${color}` : '') : verificarRota(route, x.path) ? `solid 4px ${color}` : '', height: '100%', paddingX: 2, paddingBottom: 1.4, sx: {
109
+ return (react_1.default.createElement(material_1.Box, { borderBottom: next ? (verificarRota((_a = router === null || router === void 0 ? void 0 : router.pathname) !== null && _a !== void 0 ? _a : '', x.path) ? `solid 4px ${color}` : '') : verificarRota(route, x.path) ? `solid 4px ${color}` : '', height: '100%', paddingX: 2, sx: {
110
110
  ':hover': {
111
111
  backgroundColor: '#fcfcfc',
112
112
  cursor: 'pointer',
@@ -128,7 +128,7 @@ function TabNavBar(_a) {
128
128
  react_1.default.createElement(Menu_1.default, null)),
129
129
  react_1.default.createElement(material_1.Menu, { open: menuOpen, onClose: closeMenu, anchorEl: anchor }, links.map((x) => (react_1.default.createElement(material_1.MenuItem, { key: `navmenu${x}`, onClick: (e) => onMenuItemClick(e, x.path) },
130
130
  react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize' }, x.name)))))))),
131
- react_1.default.createElement(material_1.Stack, { direction: 'row', justifyContent: 'flex-end', alignItems: 'center', sx: { width: { md: '100%' } } },
131
+ react_1.default.createElement(material_1.Stack, { direction: 'row', justifyContent: 'flex-end', alignItems: 'center', sx: { width: { md: '100%' } }, paddingY: 1 },
132
132
  react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 2 },
133
133
  react_1.default.createElement(material_1.Box, null, el),
134
134
  user ? (react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 1, sx: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.201",
3
+ "version": "0.0.203",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",