@visns-studio/visns-components 2.6.3 → 2.6.5
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 +67 -0
- package/components/crm/AsyncSelect.jsx +4 -5
- package/components/crm/DataGrid.jsx +26 -13
- package/package.json +62 -62
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, {
|
|
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 {
|
|
5
|
+
import {debounce} from 'lodash';
|
|
6
6
|
|
|
7
|
-
function VisnsAsyncSelect(
|
|
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={{
|
|
73
|
+
components={{SelectList}}
|
|
75
74
|
styles={{
|
|
76
75
|
menu: (provided) => ({
|
|
77
76
|
...provided,
|
|
@@ -499,6 +499,27 @@ 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(
|
|
503
|
+
(menuProps, { rowProps }) => {
|
|
504
|
+
if (form && form.newTabUrl && form.newTabUrl !== '') {
|
|
505
|
+
menuProps.autoDismiss = true;
|
|
506
|
+
menuProps.items = [
|
|
507
|
+
{
|
|
508
|
+
label: 'Open Link in a New Tab',
|
|
509
|
+
onClick: () => {
|
|
510
|
+
window.open(
|
|
511
|
+
`${form.newTabUrl}${
|
|
512
|
+
rowProps.data[form.primaryKey]
|
|
513
|
+
}`
|
|
514
|
+
);
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
];
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
[form]
|
|
521
|
+
);
|
|
522
|
+
|
|
502
523
|
const handleCoding = (c, data) => {
|
|
503
524
|
const icons = [];
|
|
504
525
|
const assetPath =
|
|
@@ -1384,14 +1405,9 @@ const DataGrid = forwardRef(
|
|
|
1384
1405
|
) {
|
|
1385
1406
|
filterEditor = SelectFilter;
|
|
1386
1407
|
filterEditorProps = {
|
|
1387
|
-
multiple:
|
|
1388
|
-
column.filter.operator === 'inlist'
|
|
1389
|
-
? true
|
|
1390
|
-
: false,
|
|
1408
|
+
multiple: column.filter.operator === 'inlist',
|
|
1391
1409
|
wrapMultiple:
|
|
1392
|
-
column.filter.operator
|
|
1393
|
-
? false
|
|
1394
|
-
: true,
|
|
1410
|
+
column.filter.operator !== 'inlist',
|
|
1395
1411
|
placeholder: column.filter.placeholder
|
|
1396
1412
|
? column.filter.placeholder
|
|
1397
1413
|
: 'All Options',
|
|
@@ -1647,13 +1663,9 @@ const DataGrid = forwardRef(
|
|
|
1647
1663
|
filterEditor = SelectFilter;
|
|
1648
1664
|
filterEditorProps = {
|
|
1649
1665
|
multiple:
|
|
1650
|
-
column.filter.operator === 'inlist'
|
|
1651
|
-
? true
|
|
1652
|
-
: false,
|
|
1666
|
+
column.filter.operator === 'inlist',
|
|
1653
1667
|
wrapMultiple:
|
|
1654
|
-
column.filter.operator
|
|
1655
|
-
? false
|
|
1656
|
-
: true,
|
|
1668
|
+
column.filter.operator !== 'inlist',
|
|
1657
1669
|
placeholder: column.filter.placeholder
|
|
1658
1670
|
? column.filter.placeholder
|
|
1659
1671
|
: 'All Options',
|
|
@@ -1913,6 +1925,7 @@ const DataGrid = forwardRef(
|
|
|
1913
1925
|
onSortInfoChange={handleSort}
|
|
1914
1926
|
onRenderRow={onRenderRow}
|
|
1915
1927
|
pagination
|
|
1928
|
+
renderRowContextMenu={renderRowContextMenu}
|
|
1916
1929
|
renderColumnContextMenu={renderColumnContextMenu}
|
|
1917
1930
|
rowClassName="vs-datagrid--row"
|
|
1918
1931
|
rowHeight={null}
|
package/package.json
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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.5",
|
|
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
|
}
|