@ssplib/react-components 0.0.210 → 0.0.213

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.
@@ -6,11 +6,13 @@ interface ColumnData {
6
6
  size?: number;
7
7
  }
8
8
  type FilterTypes = 'a-z' | 'z-a' | 'items' | 'date-interval' | 'data-a-z' | 'data-z-a' | 'select';
9
- export declare function Table({ mediaQueryLG, 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
+ export declare function Table({ mediaQueryLG, 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, customMargin, customMarginMobile, }: {
10
10
  mediaQueryLG?: {
11
11
  all: number;
12
12
  action: number;
13
13
  };
14
+ customMargin?: number;
15
+ customMarginMobile?: number;
14
16
  normalize?: boolean;
15
17
  csvUpper?: boolean;
16
18
  multipleDataPath?: string;
@@ -64,7 +64,7 @@ let startData = [];
64
64
  function Table({ mediaQueryLG, columns, fetchFunc, emptyMsg = {
65
65
  user: 'Nenhum dado encontrado',
66
66
  public: 'Nenhum dado encontrado',
67
- }, 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 = '', }) {
67
+ }, 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 = '', customMargin = 4, customMarginMobile = 0, }) {
68
68
  const [isLoading, setIsLoading] = (0, react_1.useState)(true);
69
69
  const [error, setError] = (0, react_1.useState)(null);
70
70
  const [data, setData] = (0, react_1.useState)(null);
@@ -718,7 +718,7 @@ function Table({ mediaQueryLG, columns, fetchFunc, emptyMsg = {
718
718
  if (!userLoaded && useKC)
719
719
  return react_1.default.createElement(material_1.LinearProgress, null);
720
720
  return (react_1.default.createElement(react_1.default.Fragment, null,
721
- react_1.default.createElement(material_1.Box, { marginX: isSmall ? 0 : 4, bgcolor: 'white', p: 2, borderRadius: 6 },
721
+ react_1.default.createElement(material_1.Box, { marginX: isSmall ? customMarginMobile : customMargin, bgcolor: 'white', p: 2, borderRadius: 6 },
722
722
  react_1.default.createElement(material_1.Stack, { spacing: 1.5, direction: { xs: 'column', md: 'row' } },
723
723
  react_1.default.createElement(material_1.Stack, { spacing: 1.5, direction: { xs: 'column', md: 'row' }, marginBottom: 2, height: '40px', width: '100%' },
724
724
  react_1.default.createElement(TextField_1.default, { InputProps: {
@@ -898,12 +898,15 @@ exports.Table = Table;
898
898
  function FetchSelectAutoComplete(props) {
899
899
  const [data, setData] = (0, react_1.useState)([]);
900
900
  (0, react_1.useEffect)(() => {
901
- axios_1.default.get(props.url).then((dt) => {
901
+ axios_1.default
902
+ .get(props.url)
903
+ .then((dt) => {
902
904
  setData(dt.data);
903
- });
905
+ })
906
+ .catch((e) => console.log('Erro ao buscar dados do filtro'));
904
907
  }, []);
905
908
  return (react_1.default.createElement(react_1.default.Fragment, null,
906
- react_1.default.createElement(material_1.Autocomplete, { options: data, onFocus: (e) => console.log('ata'), onChange: props.onChange, sx: {
909
+ react_1.default.createElement(material_1.Autocomplete, { options: data, onChange: props.onChange, sx: {
907
910
  margin: 1,
908
911
  }, size: 'small', renderInput: (params) => react_1.default.createElement(TextField_1.default, Object.assign({}, params, { label: props.label })) })));
909
912
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.210",
3
+ "version": "0.0.213",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",