@visns-studio/visns-components 2.6.3 → 2.6.4

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.
package/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # Visns Components
2
+
3
+ A list of components that is used by the Visns Studio team on all their CRM and CMS Projects.
4
+
5
+ # Modules
6
+
7
+ There are multiple components that are shared between the CRM and CMS but there are also unique components for both the CRM and CMS
8
+
9
+ ## CRM
10
+
11
+ - Authentication UI
12
+ - Login
13
+ - Profile
14
+ - Reset
15
+ - Verify
16
+ - DataGrid
17
+ - Form
18
+ - Generic Pages
19
+ - Detail Page
20
+ - Index Page
21
+ - Notification Page
22
+
23
+ ## CMS
24
+
25
+ - DataGrid
26
+ - DropZone
27
+ - Field
28
+ - Form
29
+ - Generic Pages
30
+ - Detail Page
31
+ - Index Page
32
+ - Sorting Page
33
+
34
+ ## Shared
35
+
36
+ - Asynchronous React Select
37
+ - Autocomplete (Mapbox)
38
+ - Call Popup
39
+ - Download (Axios)
40
+ - Fetch (Axios)
41
+ - Loader
42
+ - Multi React Select
43
+ - Navigation / Header
44
+ - Notification
45
+ - Select
46
+ - Sub Navigati
47
+
48
+ # Usage
49
+
50
+ Detail list of the usage for each components.
51
+
52
+ ## CRM
53
+
54
+ ### DataGrid
55
+
56
+ #### Prop List
57
+
58
+ | Prop | Description | Default |
59
+ | ------------- | ----------- | ------- |
60
+ | ajaxSetting | | |
61
+ | columns | | |
62
+ | form | | |
63
+ | gridHeight | | |
64
+ | settings | | |
65
+ | setFilterData | | |
66
+ | setConfig | | |
67
+ | style | | |
@@ -1,11 +1,10 @@
1
- import React, { useEffect, useState, useCallback } from 'react';
1
+ import React, {useEffect, useState, useCallback} from 'react';
2
2
  import CustomFetch from './Fetch';
3
3
  import SelectList from './SelectList';
4
4
  import AsyncSelect from 'react-select/async';
5
- import { debounce } from 'lodash';
5
+ import {debounce} from 'lodash';
6
6
 
7
- function VisnsAsyncSelect(props) {
8
- const { inputValue, onChange, settings, multi } = props;
7
+ function VisnsAsyncSelect({inputValue, onChange, settings}) {
9
8
 
10
9
  const loadSuggestedOptions = useCallback(
11
10
  debounce((inputValue, callback) => {
@@ -71,7 +70,7 @@ function VisnsAsyncSelect(props) {
71
70
  onChange={(inputValue, action) => {
72
71
  onChange(inputValue, action, settings.id);
73
72
  }}
74
- components={{ SelectList }}
73
+ components={{SelectList}}
75
74
  styles={{
76
75
  menu: (provided) => ({
77
76
  ...provided,
@@ -499,6 +499,24 @@ const DataGrid = forwardRef(
499
499
  return null; // Return null if neither search is enabled nor create is disabled
500
500
  };
501
501
 
502
+ const renderRowContextMenu = useCallback((menuProps, { rowProps }) => {
503
+ if (form && form.newTabUrl && form.newTabUrl !== '') {
504
+ menuProps.autoDismiss = true;
505
+ menuProps.items = [
506
+ {
507
+ label: 'Open Link in a New Tab',
508
+ onClick: () => {
509
+ window.open(
510
+ `${form.newTabUrl}${
511
+ rowProps.data[form.primaryKey]
512
+ }`
513
+ );
514
+ },
515
+ },
516
+ ];
517
+ }
518
+ }, []);
519
+
502
520
  const handleCoding = (c, data) => {
503
521
  const icons = [];
504
522
  const assetPath =
@@ -1384,14 +1402,9 @@ const DataGrid = forwardRef(
1384
1402
  ) {
1385
1403
  filterEditor = SelectFilter;
1386
1404
  filterEditorProps = {
1387
- multiple:
1388
- column.filter.operator === 'inlist'
1389
- ? true
1390
- : false,
1405
+ multiple: column.filter.operator === 'inlist',
1391
1406
  wrapMultiple:
1392
- column.filter.operator === 'inlist'
1393
- ? false
1394
- : true,
1407
+ column.filter.operator !== 'inlist',
1395
1408
  placeholder: column.filter.placeholder
1396
1409
  ? column.filter.placeholder
1397
1410
  : 'All Options',
@@ -1647,13 +1660,9 @@ const DataGrid = forwardRef(
1647
1660
  filterEditor = SelectFilter;
1648
1661
  filterEditorProps = {
1649
1662
  multiple:
1650
- column.filter.operator === 'inlist'
1651
- ? true
1652
- : false,
1663
+ column.filter.operator === 'inlist',
1653
1664
  wrapMultiple:
1654
- column.filter.operator === 'inlist'
1655
- ? false
1656
- : true,
1665
+ column.filter.operator !== 'inlist',
1657
1666
  placeholder: column.filter.placeholder
1658
1667
  ? column.filter.placeholder
1659
1668
  : 'All Options',
@@ -1913,6 +1922,7 @@ const DataGrid = forwardRef(
1913
1922
  onSortInfoChange={handleSort}
1914
1923
  onRenderRow={onRenderRow}
1915
1924
  pagination
1925
+ renderRowContextMenu={renderRowContextMenu}
1916
1926
  renderColumnContextMenu={renderColumnContextMenu}
1917
1927
  rowClassName="vs-datagrid--row"
1918
1928
  rowHeight={null}
package/package.json CHANGED
@@ -1,64 +1,64 @@
1
1
  {
2
- "dependencies": {
3
- "@inovua/reactdatagrid-community": "^5.10.2",
4
- "add": "^2.0.6",
5
- "akar-icons": "^1.9.29",
6
- "array-move": "^4.0.0",
7
- "awesome-debounce-promise": "^2.1.0",
8
- "axios": "^1.5.0",
9
- "framer-motion": "^10.16.4",
10
- "html-react-parser": "^4.2.2",
11
- "lodash": "^4.17.21",
12
- "moment": "^2.29.4",
13
- "motion": "^10.16.2",
14
- "numeral": "^2.0.6",
15
- "quill-image-uploader": "^1.3.0",
16
- "react-color": "^2.19.3",
17
- "react-confirm-alert": "^3.0.6",
18
- "react-copy-to-clipboard": "^5.1.0",
19
- "react-datepicker": "^4.16.0",
20
- "react-dropzone": "^14.2.3",
21
- "react-number-format": "^5.3.1",
22
- "react-password-strength-bar": "^0.4.1",
23
- "react-promise-tracker": "^2.1.1",
24
- "react-quill": "^2.0.0",
25
- "react-reveal": "^1.2.2",
26
- "react-select": "^5.7.4",
27
- "react-slugify": "^3.0.2",
28
- "react-sortable-hoc": "^2.0.0",
29
- "react-toastify": "^9.1.3",
30
- "react-toggle": "^4.1.3",
31
- "react-tooltip": "^5.21.3",
32
- "react-window": "^1.8.9",
33
- "reactjs-popup": "^2.0.6",
34
- "truncate": "^3.0.0",
35
- "validator": "^13.11.0",
36
- "yarn": "^1.22.19"
37
- },
38
- "devDependecies": {
39
- "react": "^18.2.0",
40
- "react-dom": "^18.2.0"
41
- },
42
- "peerDependencies": {
43
- "react": "^17.0.1",
44
- "react-dom": "^17.0.1"
45
- },
46
- "name": "@visns-studio/visns-components",
47
- "version": "2.6.3",
48
- "description": "Various packages to assist in the development of our Custom Applications.",
49
- "main": "index.js",
50
- "scripts": {
51
- "test": "echo \"Error: no test specified\" && exit 1"
52
- },
53
- "repository": {
54
- "type": "git",
55
- "url": "git+https://github.com/visnsstudio/visns-components.git"
56
- },
57
- "author": "Visns Studio",
58
- "license": "ISC",
59
- "bugs": {
60
- "url": "https://github.com/visnsstudio/visns-components/issues"
61
- },
62
- "homepage": "https://github.com/visnsstudio/visns-components#readme",
63
- "packageManager": "yarn@3.6.1"
2
+ "dependencies": {
3
+ "@inovua/reactdatagrid-community": "^5.10.2",
4
+ "add": "^2.0.6",
5
+ "akar-icons": "^1.9.29",
6
+ "array-move": "^4.0.0",
7
+ "awesome-debounce-promise": "^2.1.0",
8
+ "axios": "^1.5.0",
9
+ "framer-motion": "^10.16.4",
10
+ "html-react-parser": "^4.2.2",
11
+ "lodash": "^4.17.21",
12
+ "moment": "^2.29.4",
13
+ "motion": "^10.16.2",
14
+ "numeral": "^2.0.6",
15
+ "quill-image-uploader": "^1.3.0",
16
+ "react-color": "^2.19.3",
17
+ "react-confirm-alert": "^3.0.6",
18
+ "react-copy-to-clipboard": "^5.1.0",
19
+ "react-datepicker": "^4.16.0",
20
+ "react-dropzone": "^14.2.3",
21
+ "react-number-format": "^5.3.1",
22
+ "react-password-strength-bar": "^0.4.1",
23
+ "react-promise-tracker": "^2.1.1",
24
+ "react-quill": "^2.0.0",
25
+ "react-reveal": "^1.2.2",
26
+ "react-select": "^5.7.4",
27
+ "react-slugify": "^3.0.2",
28
+ "react-sortable-hoc": "^2.0.0",
29
+ "react-toastify": "^9.1.3",
30
+ "react-toggle": "^4.1.3",
31
+ "react-tooltip": "^5.21.3",
32
+ "react-window": "^1.8.9",
33
+ "reactjs-popup": "^2.0.6",
34
+ "truncate": "^3.0.0",
35
+ "validator": "^13.11.0",
36
+ "yarn": "^1.22.19"
37
+ },
38
+ "devDependecies": {
39
+ "react": "^18.2.0",
40
+ "react-dom": "^18.2.0"
41
+ },
42
+ "peerDependencies": {
43
+ "react": "^17.0.1",
44
+ "react-dom": "^17.0.1"
45
+ },
46
+ "name": "@visns-studio/visns-components",
47
+ "version": "2.6.4",
48
+ "description": "Various packages to assist in the development of our Custom Applications.",
49
+ "main": "index.js",
50
+ "scripts": {
51
+ "test": "echo \"Error: no test specified\" && exit 1"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/visnsstudio/visns-components.git"
56
+ },
57
+ "author": "Visns Studio",
58
+ "license": "ISC",
59
+ "bugs": {
60
+ "url": "https://github.com/visnsstudio/visns-components/issues"
61
+ },
62
+ "homepage": "https://github.com/visnsstudio/visns-components#readme",
63
+ "packageManager": "yarn@3.6.1"
64
64
  }