@irontec/ivoz-ui 1.5.0 → 1.5.1

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.
@@ -9,9 +9,7 @@ import useFirstColumn from './hook/useFirstColumn';
9
9
  import useFirstColumnCriteria from './hook/useFirstColumnCriteria';
10
10
  const FastSearchField = (props, ref) => {
11
11
  const { className, path, entityService, ignoreColumn } = props;
12
- const queryStringCriteria = useStoreState((state) => [
13
- ...state.route.queryStringCriteria,
14
- ]);
12
+ const storeQueryStringCriteria = useStoreState((state) => state.route.queryStringCriteria);
15
13
  const setQueryStringCriteria = useStoreActions((actions) => {
16
14
  return actions.route.setQueryStringCriteria;
17
15
  });
@@ -43,6 +41,7 @@ const FastSearchField = (props, ref) => {
43
41
  }
44
42
  let match = false;
45
43
  let matchIdx;
44
+ const queryStringCriteria = [...storeQueryStringCriteria];
46
45
  for (const idx in queryStringCriteria) {
47
46
  if (queryStringCriteria[idx].name !== firstColumnCriteria.name) {
48
47
  continue;
@@ -61,7 +60,8 @@ const FastSearchField = (props, ref) => {
61
60
  else if (value === '' && matchIdx) {
62
61
  queryStringCriteria.splice(parseInt(matchIdx, 10), 1);
63
62
  }
64
- setQueryStringCriteria(queryStringCriteria);
63
+ const queryStringCriteriaWithoutPagination = queryStringCriteria.filter((criteria) => criteria.name !== '_page');
64
+ setQueryStringCriteria(queryStringCriteriaWithoutPagination);
65
65
  };
66
66
  const changeHandler = ({ target, }) => {
67
67
  const { value } = target;
@@ -4,9 +4,7 @@ import { getI18n } from 'react-i18next';
4
4
  const useFirstColumnCriteria = (props) => {
5
5
  const { entityService, ignoreColumn, path } = props;
6
6
  const [firstColumnCriteria, setFirstColumnCriteria] = useState(undefined);
7
- const queryStringCriteria = useStoreState((state) => [
8
- ...state.route.queryStringCriteria,
9
- ]);
7
+ const queryStringCriteria = useStoreState((state) => state.route.queryStringCriteria);
10
8
  const storeState = useStoreState((state) => state, () => {
11
9
  return true;
12
10
  });
@@ -67,6 +67,7 @@ export default function ContentFilterSelector(props) {
67
67
  type: defaultFilter,
68
68
  value: '',
69
69
  }, columns: columns, fkChoices: fkChoices, fieldNames: fieldNames, isLast: true, setRow: setRow, removeRow: removeRow }, criteria.length)] })), mobile && (_jsx(Box, { children: _jsx(FilterCriteria, { entityService: entityService, fkChoices: fkChoices, removeFilter: removeRow, path: path, criteriaOverride: criteria }) })), _jsxs(Box, Object.assign({ className: 'actions' }, { children: [_jsx(Box, { children: _jsx("a", Object.assign({ href: '#', onClick: resetCriteria, className: 'link' }, { children: _('Clear all filters') })) }), _jsxs(Box, Object.assign({ className: 'buttons' }, { children: [_jsx(OutlinedButton, Object.assign({ variant: 'contained', onClick: close }, { children: _('Cancel') })), _jsx(SolidButton, Object.assign({ variant: 'contained', disabled: criteria.length < 1, onClick: () => {
70
- commitCriteria(criteria);
70
+ const queryStringCriteriaWithoutPagination = criteria.filter((criteria) => criteria.name !== '_page');
71
+ commitCriteria(queryStringCriteriaWithoutPagination);
71
72
  } }, { children: _('Apply') }))] }))] }))] })));
72
73
  }
@@ -23,7 +23,7 @@ import useFirstColumn from './Content/hook/useFirstColumn';
23
23
  import { criteriaToArray, queryStringToCriteria } from './List.helpers';
24
24
  import useQueryStringParams from './useQueryStringParams';
25
25
  const List = function (props) {
26
- const { path, foreignKeyResolver, entityService, routeMap, className, List: EntityListDecorator, } = props;
26
+ const { path, foreignKeyResolver, entityService, routeMap, className, List: EntityListDecorator } = props;
27
27
  const location = useLocation();
28
28
  const match = useCurrentPathMatch();
29
29
  const params = useParams();
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ListContent } from '../../components/List/Content/';
3
3
  const List = (props) => {
4
- return _jsx(ListContent, Object.assign({}, props));
4
+ return (_jsx(ListContent, Object.assign({}, props)));
5
5
  };
6
6
  export default List;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@irontec/ivoz-ui",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "UI library used in ivozprovider",
5
5
  "license": "GPL-3.0",
6
6
  "main": "index.js",