@ssplib/react-components 0.0.182 → 0.0.183

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.
@@ -5,7 +5,7 @@ interface ColumnData {
5
5
  size?: number;
6
6
  }
7
7
  type FilterTypes = 'a-z' | 'z-a' | 'items' | 'date-interval' | 'data-a-z' | 'data-z-a';
8
- export declare function Table({ columns, fetchFunc, emptyMsg, dataPath, tableName, csv, columnSize, action, isPublic, statusKeyName, csvExcludeKeys, csvExcludeKeysCSV, csvExcludeKeysAll, csvCustomKeyNames, csvExcludeValidate, csvButtonTitle, csvNoZipText, csvAllButtonTitle, removeQuotes, normalize, csvShowAllButton, csvWithoutZip, itemCount, csvUpper, csvZipFileNamesKey, generateCsvZip, filters, hideTitleCSV, csvExcludeUpper, filterSeparator, filterStorageName, multipleDataPath, }: {
8
+ export declare function Table({ columns, fetchFunc, emptyMsg, dataPath, tableName, csv, columnSize, action, useKC, statusKeyName, csvExcludeKeys, csvExcludeKeysCSV, csvExcludeKeysAll, csvCustomKeyNames, csvExcludeValidate, csvButtonTitle, csvNoZipText, csvAllButtonTitle, removeQuotes, normalize, csvShowAllButton, csvWithoutZip, itemCount, csvUpper, csvZipFileNamesKey, generateCsvZip, filters, hideTitleCSV, csvExcludeUpper, filterSeparator, filterStorageName, multipleDataPath, }: {
9
9
  normalize?: boolean;
10
10
  csvUpper?: boolean;
11
11
  multipleDataPath?: string;
@@ -42,7 +42,7 @@ export declare function Table({ columns, fetchFunc, emptyMsg, dataPath, tableNam
42
42
  public: string;
43
43
  };
44
44
  dataPath?: string;
45
- isPublic?: boolean;
45
+ useKC?: boolean;
46
46
  filters?: {
47
47
  [key: string]: {
48
48
  type: FilterTypes;
@@ -46,7 +46,7 @@ let startData = [];
46
46
  function Table({ columns, fetchFunc, emptyMsg = {
47
47
  user: 'Nenhum dado encontrado',
48
48
  public: 'Nenhum dado encontrado',
49
- }, dataPath = '', tableName = 'Dados', csv, columnSize, action, isPublic = false, statusKeyName = '', csvExcludeKeys = [], csvExcludeKeysCSV = [], csvExcludeKeysAll = [], csvCustomKeyNames = {}, csvExcludeValidate = (key, value) => false, csvButtonTitle = 'Salvar .CSV', csvNoZipText = 'Salvar .CSV', csvAllButtonTitle = 'Salvar todos em CSV', removeQuotes = false, normalize = false, csvShowAllButton = false, csvWithoutZip = false, itemCount = 10, csvUpper = false, csvZipFileNamesKey = '', generateCsvZip = false, filters = {}, hideTitleCSV = false, csvExcludeUpper = [], filterSeparator = '|', filterStorageName = 'tableFilters', multipleDataPath = '', }) {
49
+ }, dataPath = '', tableName = 'Dados', csv, columnSize, action, useKC = true, statusKeyName = '', csvExcludeKeys = [], csvExcludeKeysCSV = [], csvExcludeKeysAll = [], csvCustomKeyNames = {}, csvExcludeValidate = (key, value) => false, csvButtonTitle = 'Salvar .CSV', csvNoZipText = 'Salvar .CSV', csvAllButtonTitle = 'Salvar todos em CSV', removeQuotes = false, normalize = false, csvShowAllButton = false, csvWithoutZip = false, itemCount = 10, csvUpper = false, csvZipFileNamesKey = '', generateCsvZip = false, filters = {}, hideTitleCSV = false, csvExcludeUpper = [], filterSeparator = '|', filterStorageName = 'tableFilters', multipleDataPath = '', }) {
50
50
  const [isLoading, setIsLoading] = (0, react_1.useState)(true);
51
51
  const [error, setError] = (0, react_1.useState)(null);
52
52
  const [data, setData] = (0, react_1.useState)(null);
@@ -64,7 +64,8 @@ function Table({ columns, fetchFunc, emptyMsg = {
64
64
  const theme = (0, material_1.useTheme)();
65
65
  const isSmall = (0, material_1.useMediaQuery)(theme.breakpoints.only('xs'));
66
66
  (0, react_1.useEffect)(() => {
67
- if (userLoaded || isPublic)
67
+ setError(null);
68
+ if (userLoaded || !useKC)
68
69
  fetchFunc()
69
70
  .then((res) => {
70
71
  if (!res.ok)
@@ -682,7 +683,7 @@ function Table({ columns, fetchFunc, emptyMsg = {
682
683
  "Carregando ",
683
684
  tableName),
684
685
  react_1.default.createElement(material_1.CircularProgress, null)));
685
- if (!userLoaded && !isPublic)
686
+ if (!userLoaded && useKC)
686
687
  return react_1.default.createElement(material_1.LinearProgress, null);
687
688
  return (react_1.default.createElement(react_1.default.Fragment, null,
688
689
  react_1.default.createElement(material_1.Box, { marginX: isSmall ? 0 : 4 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.182",
3
+ "version": "0.0.183",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",