@ssplib/react-components 0.0.218 → 0.0.220

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.
@@ -100,7 +100,8 @@ function Table({ mediaQueryLG, columns, fetchFunc, emptyMsg = {
100
100
  status: j.statusCode,
101
101
  });
102
102
  else {
103
- if (!j || !Array.isArray(j)) {
103
+ const value = (0, lodash_get_1.default)(j, dataPath);
104
+ if (!value || !Array.isArray(value)) {
104
105
  setData({ body: { data: [] } });
105
106
  startData = [];
106
107
  }
@@ -161,8 +162,8 @@ function Table({ mediaQueryLG, columns, fetchFunc, emptyMsg = {
161
162
  listData.forEach((x) => {
162
163
  const dataStr = [];
163
164
  Object.keys(x).map((key) => {
164
- // let value = x[key]
165
- let value = (0, lodash_get_1.default)(x, key, '');
165
+ var _a;
166
+ let value = (_a = (0, lodash_get_1.default)(x, key, '')) !== null && _a !== void 0 ? _a : '';
166
167
  if (typeof value === 'number')
167
168
  value = value.toString();
168
169
  if (typeof value !== 'string')
@@ -314,7 +315,6 @@ function Table({ mediaQueryLG, columns, fetchFunc, emptyMsg = {
314
315
  if (multipleDataPath !== '') {
315
316
  keys = ['dtInicio', 'hrInicio', ...keys];
316
317
  }
317
- console.log(keys);
318
318
  const header = keys.map((k) => (csvCustomKeyNames[k] ? csvCustomKeyNames[k] : k)).join(',') + '\n';
319
319
  const values = [];
320
320
  list.forEach((x) => {
@@ -353,7 +353,7 @@ function Table({ mediaQueryLG, columns, fetchFunc, emptyMsg = {
353
353
  if (multipleDataPath !== '') {
354
354
  const dates = x[multipleDataPath];
355
355
  if (dates) {
356
- console.log(dates);
356
+ ;
357
357
  dates.forEach((d) => {
358
358
  values.push(value.replace('{dtInicio}', d.dtInicio).replace('{hrInicio}', d.hrInicio).replace('{hrTermino}', d.hrTermino));
359
359
  });
@@ -703,7 +703,8 @@ function Table({ mediaQueryLG, columns, fetchFunc, emptyMsg = {
703
703
  let obj = {};
704
704
  newList.forEach((x, index) => {
705
705
  columns.forEach((c) => {
706
- obj[index] = obj[index] === true ? true : (0, lodash_get_1.default)(x, c.keyName, '').toString().length >= expandTextMaxLength;
706
+ var _a;
707
+ obj[index] = obj[index] === true ? true : ((_a = (0, lodash_get_1.default)(x, c.keyName, '')) !== null && _a !== void 0 ? _a : 'Não Informado').toString().length >= expandTextMaxLength;
707
708
  });
708
709
  });
709
710
  setShowExpandObj(obj);
@@ -899,7 +900,6 @@ function Table({ mediaQueryLG, columns, fetchFunc, emptyMsg = {
899
900
  react_1.default.createElement(FetchSelectAutoComplete, { url: x.listEndpoint, label: x.name, onChange: (e, value) => {
900
901
  if (value) {
901
902
  const id = `${f}:${JSON.stringify(value)}`;
902
- console.log(x.type, x.keyName, id, value === null || value === void 0 ? void 0 : value.label.toLowerCase(), x.referenceKey);
903
903
  handleFilterOption(x.type, x.keyName, id, value === null || value === void 0 ? void 0 : value.id.toLowerCase(), x.referenceKey);
904
904
  setOldSelectState(id);
905
905
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.218",
3
+ "version": "0.0.220",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",