@visns-studio/visns-components 4.6.9 → 4.6.11
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.
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
Image,
|
|
44
44
|
Inbox,
|
|
45
45
|
LinkOut,
|
|
46
|
+
LockOn,
|
|
46
47
|
Network,
|
|
47
48
|
Ribbon,
|
|
48
49
|
Search,
|
|
@@ -378,6 +379,34 @@ const DataGrid = forwardRef(
|
|
|
378
379
|
toast.success(result.message);
|
|
379
380
|
});
|
|
380
381
|
break;
|
|
382
|
+
case 'oauth2':
|
|
383
|
+
let oauth2Payload = d;
|
|
384
|
+
|
|
385
|
+
if (s.key?.detailKey?.length > 0) {
|
|
386
|
+
for (const k of s.key.detailKey) {
|
|
387
|
+
if (oauth2Payload?.[k]) {
|
|
388
|
+
oauth2Payload = oauth2Payload[k];
|
|
389
|
+
} else {
|
|
390
|
+
oauth2Payload = undefined;
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
CustomFetch(
|
|
396
|
+
s.key.redirect,
|
|
397
|
+
'POST',
|
|
398
|
+
{ ...oauth2Payload, id: d.id },
|
|
399
|
+
(result) => {
|
|
400
|
+
if (result.url !== '') {
|
|
401
|
+
window.location.href = result.url;
|
|
402
|
+
} else {
|
|
403
|
+
toast.error(
|
|
404
|
+
'An error occurred while processing the request.'
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
);
|
|
409
|
+
break;
|
|
381
410
|
case 'delete':
|
|
382
411
|
const getDataId = () => {
|
|
383
412
|
for (const item of ajaxSetting.where) {
|
|
@@ -1014,12 +1043,33 @@ const DataGrid = forwardRef(
|
|
|
1014
1043
|
}
|
|
1015
1044
|
}
|
|
1016
1045
|
|
|
1046
|
+
if (s.id === 'oauth2') {
|
|
1047
|
+
let tmpCheckValue = d;
|
|
1048
|
+
|
|
1049
|
+
if (s.key?.check?.length > 0) {
|
|
1050
|
+
for (const k of s.key.check) {
|
|
1051
|
+
if (tmpCheckValue?.[k]) {
|
|
1052
|
+
tmpCheckValue = tmpCheckValue[k];
|
|
1053
|
+
} else {
|
|
1054
|
+
tmpCheckValue = undefined;
|
|
1055
|
+
break;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
if (!tmpCheckValue) {
|
|
1061
|
+
allow = false;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1017
1065
|
if (allow) {
|
|
1018
1066
|
switch (s.id) {
|
|
1019
1067
|
case 'activate':
|
|
1020
1068
|
return getIconComponent(CircleCheck);
|
|
1021
1069
|
case 'archive':
|
|
1022
1070
|
return getIconComponent(ShippingBoxV1);
|
|
1071
|
+
case 'oauth2':
|
|
1072
|
+
return getIconComponent(LockOn);
|
|
1023
1073
|
case 'complete':
|
|
1024
1074
|
return getIconComponent(Check);
|
|
1025
1075
|
case 'copy':
|
|
@@ -1837,7 +1887,11 @@ const DataGrid = forwardRef(
|
|
|
1837
1887
|
render: ({ data }) => {
|
|
1838
1888
|
value = column.id.reduce((acc, id) => {
|
|
1839
1889
|
if (acc === '') {
|
|
1840
|
-
|
|
1890
|
+
if (data[id]) {
|
|
1891
|
+
return data[id];
|
|
1892
|
+
} else {
|
|
1893
|
+
return '';
|
|
1894
|
+
}
|
|
1841
1895
|
} else {
|
|
1842
1896
|
if (acc && acc[id]) {
|
|
1843
1897
|
return acc[id];
|
|
@@ -1849,14 +1903,19 @@ const DataGrid = forwardRef(
|
|
|
1849
1903
|
|
|
1850
1904
|
if (value) {
|
|
1851
1905
|
if (Array.isArray(value)) {
|
|
1852
|
-
|
|
1906
|
+
if (value[0]) {
|
|
1907
|
+
value = value[0];
|
|
1908
|
+
}
|
|
1853
1909
|
}
|
|
1854
1910
|
|
|
1855
1911
|
if (
|
|
1856
1912
|
Array.isArray(column.nameFrom)
|
|
1857
1913
|
) {
|
|
1858
1914
|
value = column.nameFrom
|
|
1859
|
-
.map(
|
|
1915
|
+
.map(
|
|
1916
|
+
(nf) =>
|
|
1917
|
+
value?.[nf] ?? ''
|
|
1918
|
+
)
|
|
1860
1919
|
.join(' ');
|
|
1861
1920
|
} else {
|
|
1862
1921
|
if (
|
|
@@ -1895,7 +1954,11 @@ const DataGrid = forwardRef(
|
|
|
1895
1954
|
}
|
|
1896
1955
|
}
|
|
1897
1956
|
|
|
1898
|
-
|
|
1957
|
+
if (typeof value === 'string') {
|
|
1958
|
+
return <span>{value}</span>;
|
|
1959
|
+
} else {
|
|
1960
|
+
return null;
|
|
1961
|
+
}
|
|
1899
1962
|
}
|
|
1900
1963
|
} else {
|
|
1901
1964
|
return null;
|
package/components/crm/Field.jsx
CHANGED
|
@@ -59,7 +59,7 @@ function Field({
|
|
|
59
59
|
const [counter, setCounter] = useState(0);
|
|
60
60
|
const [dataOptions, setDataOptions] = useState([]);
|
|
61
61
|
const [formItemStyle, setFormItemStyle] = useState({});
|
|
62
|
-
const [formItemClass, setFormItemClass] = useState('
|
|
62
|
+
const [formItemClass, setFormItemClass] = useState('');
|
|
63
63
|
const [options, setOptions] = useState([]);
|
|
64
64
|
|
|
65
65
|
const cover = {
|
|
@@ -140,10 +140,16 @@ function Field({
|
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
switch (settings.size) {
|
|
144
|
+
case 'full':
|
|
145
|
+
setFormItemClass(`${styles.formItem} ${styles.fwItem}`);
|
|
146
|
+
break;
|
|
147
|
+
case 'quarter':
|
|
148
|
+
setFormItemClass(`${styles.formItem} ${styles.qtrItem}`);
|
|
149
|
+
break;
|
|
150
|
+
default:
|
|
151
|
+
setFormItemClass(`${styles.formItem}`);
|
|
152
|
+
break;
|
|
147
153
|
}
|
|
148
154
|
}, [settings, counter]);
|
|
149
155
|
|
|
@@ -15,10 +15,10 @@ function VisnsLoader({}) {
|
|
|
15
15
|
}, [promiseInProgress]);
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<div className=
|
|
19
|
-
<div className=
|
|
20
|
-
<div className=
|
|
21
|
-
<div className=
|
|
18
|
+
<div className={styles.preloader} style={loaderStyle}>
|
|
19
|
+
<div className={styles.preloader__icn}>
|
|
20
|
+
<div className={styles.preloader__cut}>
|
|
21
|
+
<div className={styles.preloader__donut}></div>
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
24
24
|
<span>Processing Data</span>
|
|
@@ -36,9 +36,24 @@
|
|
|
36
36
|
color: var(--primary-color);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.formItem {
|
|
40
|
+
width: 50%;
|
|
41
|
+
padding: 0.5em;
|
|
42
|
+
position: relative;
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
.formItem .fi__label {
|
|
40
47
|
position: relative;
|
|
41
48
|
display: block;
|
|
49
|
+
|
|
50
|
+
> svg {
|
|
51
|
+
position: absolute;
|
|
52
|
+
right: 0.5em;
|
|
53
|
+
top: 1em;
|
|
54
|
+
color: var(--paragraph-color);
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
}
|
|
42
57
|
}
|
|
43
58
|
|
|
44
59
|
.fi__span {
|
|
@@ -88,6 +103,16 @@ select:not(:placeholder-shown) + .fi__span {
|
|
|
88
103
|
top: 0;
|
|
89
104
|
}
|
|
90
105
|
|
|
106
|
+
.fwItem {
|
|
107
|
+
flex-basis: 100%;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.lastItem {
|
|
111
|
+
.btn {
|
|
112
|
+
width: 100%;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
91
116
|
.fi__button--right {
|
|
92
117
|
position: absolute;
|
|
93
118
|
right: 50px;
|
|
@@ -119,7 +144,6 @@ select:not(:placeholder-shown) + .fi__span {
|
|
|
119
144
|
) {
|
|
120
145
|
background: var(--item-color);
|
|
121
146
|
border-radius: var(--br);
|
|
122
|
-
border: 1px solid transparent;
|
|
123
147
|
padding: 1rem;
|
|
124
148
|
outline: none;
|
|
125
149
|
width: 100%;
|
package/package.json
CHANGED