@visns-studio/visns-components 3.0.8 → 3.0.9

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.
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { Link } from 'react-router-dom';
3
+ import { CircleChevronRight } from 'akar-icons';
4
+
5
+ function Breadcrumb({ data, page }) {
6
+ return (
7
+ <h1>
8
+ <Link to={page && page.previousUrl ? page.previousUrl : null}>
9
+ {page && page.title ? page.title : null}
10
+ </Link>{' '}
11
+ {data && data[page.titleKey] ? (
12
+ <>
13
+ <CircleChevronRight strokeWidth={2} size={18} />{' '}
14
+ {data[page.titleKey]}
15
+ </>
16
+ ) : null}
17
+ </h1>
18
+ );
19
+ }
20
+
21
+ export default Breadcrumb;
@@ -977,7 +977,9 @@ const DataGrid = forwardRef(
977
977
  filterEditorProps = (props, { index }) => {
978
978
  return {
979
979
  dateFormat: 'DD-MM-YYYY',
980
- placeholder: 'All Dates',
980
+ placeholder: column.filter.placeholder
981
+ ? column.filter.placeholder
982
+ : 'Select Date',
981
983
  };
982
984
  };
983
985
  break;
@@ -1933,6 +1935,12 @@ const DataGrid = forwardRef(
1933
1935
  ...(column.filter.fields && {
1934
1936
  fields: column.filter.fields,
1935
1937
  }),
1938
+ ...(column.filter.order && {
1939
+ order: column.filter.order,
1940
+ }),
1941
+ ...(column.filter.orderBy && {
1942
+ orderBy: column.filter.orderBy,
1943
+ }),
1936
1944
  };
1937
1945
 
1938
1946
  CustomFetch(
@@ -1949,7 +1957,7 @@ const DataGrid = forwardRef(
1949
1957
  updateFilterDataSource(filterName, column.filter.options);
1950
1958
  }
1951
1959
  });
1952
- }, []);
1960
+ }, [columns]);
1953
1961
 
1954
1962
  // Data Grid Styling
1955
1963
  const [windowHeight, setWindowHeight] = useState(window.innerHeight);
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { usePromiseTracker } from 'react-promise-tracker';
3
3
 
4
- function VisnsLoader(props) {
4
+ function VisnsLoader({}) {
5
5
  const { promiseInProgress } = usePromiseTracker();
6
6
  const [loaderStyle, setLoaderStyle] = useState({
7
7
  opacity: 0,
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { useParams, Link } from 'react-router-dom';
2
+ import { useParams } from 'react-router-dom';
3
3
  import moment from 'moment';
4
4
  import parse from 'html-react-parser';
5
5
  import Popup from 'reactjs-popup';
@@ -8,16 +8,11 @@ import Dropzone from 'react-dropzone';
8
8
  import { confirmAlert } from 'react-confirm-alert';
9
9
  import truncate from 'truncate';
10
10
  import { CopyToClipboard } from 'react-copy-to-clipboard';
11
- import {
12
- CircleCheck,
13
- CircleChevronRight,
14
- Copy,
15
- File,
16
- TrashCan,
17
- } from 'akar-icons';
11
+ import { CircleCheck, Copy, File, TrashCan } from 'akar-icons';
18
12
 
19
13
  import 'react-confirm-alert/src/react-confirm-alert.css';
20
14
 
15
+ import Breadcrumb from '../Breadcrumb';
21
16
  import CustomFetch from '../Fetch';
22
17
  import Form from '../Form';
23
18
  import QrCode from '../QrCode';
@@ -876,26 +871,7 @@ function GenericDetail({ setting, urlParam, userProfile }) {
876
871
  <div className="grid">
877
872
  <div className="grid__row">
878
873
  <div className="grid__full crmtitle">
879
- <h1>
880
- <Link
881
- to={
882
- page && page.previousUrl
883
- ? page.previousUrl
884
- : null
885
- }
886
- >
887
- {page && page.title ? page.title : null}
888
- </Link>{' '}
889
- {data && data[page.titleKey] ? (
890
- <>
891
- <CircleChevronRight
892
- strokeWidth={2}
893
- size={18}
894
- />{' '}
895
- {data[page.titleKey]}
896
- </>
897
- ) : null}
898
- </h1>
874
+ <Breadcrumb data={data} page={page} />
899
875
  {total > 0 && (
900
876
  <div className="titleInfo">
901
877
  <span>
package/index.js CHANGED
@@ -7,6 +7,7 @@ import SortableList from './components/cms/sorting/List';
7
7
  /** CRM Components */
8
8
  import AsyncSelect from './components/crm/AsyncSelect';
9
9
  import Autocomplete from './components/crm/Autocomplete';
10
+ import Breadcrumb from './components/crm/Breadcrumb';
10
11
  import Call from './components/crm/Call';
11
12
  import CustomFetch from './components/crm/Fetch';
12
13
  import Download from './components/crm/Download';
@@ -41,6 +42,7 @@ import NotificationList from './components/crm/generic/NotificationList';
41
42
  export {
42
43
  AsyncSelect,
43
44
  Autocomplete,
45
+ Breadcrumb,
44
46
  Call,
45
47
  CmsDetail,
46
48
  CmsForm,
package/package.json CHANGED
@@ -46,7 +46,7 @@
46
46
  "react-dom": "^17.0.1"
47
47
  },
48
48
  "name": "@visns-studio/visns-components",
49
- "version": "3.0.8",
49
+ "version": "3.0.9",
50
50
  "description": "Various packages to assist in the development of our Custom Applications.",
51
51
  "main": "index.js",
52
52
  "scripts": {