@visns-studio/visns-components 4.10.47 → 5.0.0
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/package.json +28 -30
- package/src/components/cms/Field.jsx +39 -63
- package/src/components/crm/Breadcrumb.jsx +2 -18
- package/src/components/crm/DataGrid.jsx +23 -379
- package/src/components/crm/Field.jsx +16 -215
- package/src/components/crm/Form.jsx +81 -79
- package/src/components/crm/MultiSelect.jsx +25 -71
- package/src/components/crm/Navigation.jsx +7 -11
- package/src/components/crm/QrCode.jsx +8 -12
- package/src/components/crm/QuickAction.jsx +1 -0
- package/src/components/crm/generic/GenericAuth.jsx +2 -6
- package/src/components/crm/generic/GenericDashboard.jsx +30 -340
- package/src/components/crm/generic/GenericDetail.jsx +37 -80
- package/src/components/crm/generic/GenericDynamic.jsx +76 -94
- package/src/components/crm/generic/GenericFormBuilder.jsx +19 -79
- package/src/components/crm/generic/GenericIndex.jsx +1 -2
- package/src/components/crm/generic/styles/GenericDetail.module.scss +0 -51
- package/src/components/crm/generic/styles/GenericFormBuilder.module.scss +0 -5
- package/src/components/crm/styles/DataGrid.module.scss +25 -0
- package/src/components/crm/styles/Field.module.scss +0 -210
- package/src/components/crm/styles/Form.module.scss +0 -78
- package/src/components/crm/styles/Navigation.module.scss +4 -10
- package/src/components/crm/styles/QrCode.module.scss +0 -18
- package/src/index.js +0 -8
- package/src/components/crm/generic/styles/GenericDashboard.module.scss +0 -325
- package/src/components/crm/sketch/SketchField.jsx +0 -395
- package/src/components/crm/sketch/arrow.jsx +0 -108
- package/src/components/crm/sketch/circle.jsx +0 -75
- package/src/components/crm/sketch/default-tool.jsx +0 -16
- package/src/components/crm/sketch/fabrictool.jsx +0 -22
- package/src/components/crm/sketch/history.jsx +0 -144
- package/src/components/crm/sketch/json/config.json +0 -14
- package/src/components/crm/sketch/line.jsx +0 -64
- package/src/components/crm/sketch/pan.jsx +0 -48
- package/src/components/crm/sketch/pencil.jsx +0 -36
- package/src/components/crm/sketch/rectangle-label-object.jsx +0 -69
- package/src/components/crm/sketch/rectangle-label.jsx +0 -93
- package/src/components/crm/sketch/rectangle.jsx +0 -76
- package/src/components/crm/sketch/select.jsx +0 -16
- package/src/components/crm/sketch/tools.jsx +0 -11
- package/src/components/crm/sketch/utils.jsx +0 -67
|
@@ -38,7 +38,6 @@ function GenericDetail({
|
|
|
38
38
|
layout = 'full',
|
|
39
39
|
setting,
|
|
40
40
|
setActiveNav = null,
|
|
41
|
-
themeType,
|
|
42
41
|
urlParam,
|
|
43
42
|
userProfile,
|
|
44
43
|
}) {
|
|
@@ -192,7 +191,6 @@ function GenericDetail({
|
|
|
192
191
|
relationKey,
|
|
193
192
|
size,
|
|
194
193
|
truncateLength,
|
|
195
|
-
checkboxLabel,
|
|
196
194
|
} = item;
|
|
197
195
|
const value =
|
|
198
196
|
relation && relation.length > 0 && type !== 'total'
|
|
@@ -265,22 +263,16 @@ function GenericDetail({
|
|
|
265
263
|
return '';
|
|
266
264
|
}
|
|
267
265
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
266
|
+
const formatKey = (key) => {
|
|
267
|
+
return key
|
|
268
|
+
.toLowerCase()
|
|
269
|
+
.split('_')
|
|
270
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
271
|
+
.join(' ');
|
|
272
|
+
};
|
|
275
273
|
|
|
276
274
|
const keys = Object.keys(value)
|
|
277
|
-
.filter(
|
|
278
|
-
(key) =>
|
|
279
|
-
(typeof value[key] === 'boolean' ||
|
|
280
|
-
typeof value[key] === 'string') &&
|
|
281
|
-
value[key] &&
|
|
282
|
-
key !== 'notes'
|
|
283
|
-
)
|
|
275
|
+
.filter((key) => value[key] && key !== 'notes')
|
|
284
276
|
.sort((a, b) => {
|
|
285
277
|
if (a === 'other') return 1;
|
|
286
278
|
if (b === 'other') return -1;
|
|
@@ -288,44 +280,35 @@ function GenericDetail({
|
|
|
288
280
|
});
|
|
289
281
|
|
|
290
282
|
const formattedKeys = keys.map((key) => {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
283
|
+
let formattedKey = formatKey(key);
|
|
284
|
+
if (key === 'other') {
|
|
285
|
+
const otherValue = getValueFromData(
|
|
286
|
+
data,
|
|
287
|
+
[...relation],
|
|
288
|
+
`${id}_other`,
|
|
289
|
+
type
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
if (otherValue) {
|
|
293
|
+
formattedKey += `: ${otherValue}`;
|
|
294
|
+
}
|
|
297
295
|
}
|
|
298
|
-
|
|
299
|
-
// Return the label for boolean values
|
|
300
|
-
return label;
|
|
296
|
+
return formattedKey;
|
|
301
297
|
});
|
|
302
298
|
|
|
303
299
|
return formattedKeys.join(', ');
|
|
304
300
|
};
|
|
305
301
|
|
|
306
|
-
// Helper function to format the key as a fallback
|
|
307
|
-
const formatKey = (key) => {
|
|
308
|
-
return key
|
|
309
|
-
.toLowerCase()
|
|
310
|
-
.split('_')
|
|
311
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
312
|
-
.join(' ');
|
|
313
|
-
};
|
|
314
|
-
|
|
315
302
|
const renderDate = () => formatDateValue(value);
|
|
316
303
|
|
|
317
304
|
const renderDateTime = () => formatDateTimeValue(value);
|
|
318
305
|
|
|
319
|
-
const renderFile = () =>
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
return isValidUrl ? (
|
|
324
|
-
<a href={value} target="_blank" rel="noopener noreferrer">
|
|
306
|
+
const renderFile = () =>
|
|
307
|
+
value ? (
|
|
308
|
+
<a href={value} target="_blank">
|
|
325
309
|
Download
|
|
326
310
|
</a>
|
|
327
311
|
) : null;
|
|
328
|
-
};
|
|
329
312
|
|
|
330
313
|
const renderExist = () => (truncatedValue ? 'Yes' : 'No');
|
|
331
314
|
|
|
@@ -979,39 +962,19 @@ function GenericDetail({
|
|
|
979
962
|
)}
|
|
980
963
|
</div>
|
|
981
964
|
|
|
982
|
-
{
|
|
983
|
-
activeTabConfig.export) && (
|
|
965
|
+
{activeTabConfig.form && (
|
|
984
966
|
<div className={styles.polActions}>
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
>
|
|
997
|
-
Edit
|
|
998
|
-
</button>
|
|
999
|
-
)}
|
|
1000
|
-
{activeTabConfig.export && (
|
|
1001
|
-
<button
|
|
1002
|
-
className={styles.btn}
|
|
1003
|
-
onClick={() =>
|
|
1004
|
-
window.open
|
|
1005
|
-
? window.open(
|
|
1006
|
-
`${activeTabConfig.export.url}/${routeParams[urlParam]}`,
|
|
1007
|
-
'_blank'
|
|
1008
|
-
)
|
|
1009
|
-
: (window.location.href = `${activeTabConfig.export.url}/${routeParams[urlParam]}`)
|
|
1010
|
-
}
|
|
1011
|
-
>
|
|
1012
|
-
Export
|
|
1013
|
-
</button>
|
|
1014
|
-
)}
|
|
967
|
+
<button
|
|
968
|
+
className={styles.btn}
|
|
969
|
+
onClick={() =>
|
|
970
|
+
modalOpen(
|
|
971
|
+
'update',
|
|
972
|
+
routeParams[urlParam]
|
|
973
|
+
)
|
|
974
|
+
}
|
|
975
|
+
>
|
|
976
|
+
Edit
|
|
977
|
+
</button>
|
|
1015
978
|
</div>
|
|
1016
979
|
)}
|
|
1017
980
|
</>
|
|
@@ -1536,13 +1499,7 @@ function GenericDetail({
|
|
|
1536
1499
|
|
|
1537
1500
|
<div className={styles.grid}>
|
|
1538
1501
|
<div className={styles.grid__subrow}>
|
|
1539
|
-
<div
|
|
1540
|
-
className={
|
|
1541
|
-
themeType === 'alternate'
|
|
1542
|
-
? styles.grid__subnav__alternate
|
|
1543
|
-
: styles.grid__subnav
|
|
1544
|
-
}
|
|
1545
|
-
>
|
|
1502
|
+
<div className={styles.grid__subnav}>
|
|
1546
1503
|
<TableFilter filters={subnav} setFilters={setSubnav} />
|
|
1547
1504
|
</div>
|
|
1548
1505
|
<div className={styles.grid__subcontent}>
|
|
@@ -31,8 +31,6 @@ const updateField = (fields, name, value) => {
|
|
|
31
31
|
|
|
32
32
|
const renderValue = (field, data) => {
|
|
33
33
|
switch (field.type) {
|
|
34
|
-
case 'canvas':
|
|
35
|
-
return field.value || '';
|
|
36
34
|
case 'datetime':
|
|
37
35
|
case 'date':
|
|
38
36
|
return field.value && moment(field.value).isValid()
|
|
@@ -105,7 +103,6 @@ const GenericDynamic = ({
|
|
|
105
103
|
}) => {
|
|
106
104
|
const [activeForm, setActiveForm] = useState({});
|
|
107
105
|
const [activeFormKey, setActiveFormKey] = useState(0);
|
|
108
|
-
const [canvasSaveCounter, setCanvasSaveCounter] = useState(0);
|
|
109
106
|
|
|
110
107
|
const handleChange = (e) => {
|
|
111
108
|
const {
|
|
@@ -177,35 +174,6 @@ const GenericDynamic = ({
|
|
|
177
174
|
}
|
|
178
175
|
};
|
|
179
176
|
|
|
180
|
-
const handleChangeCanvas = (fieldSetting, value, imageData) => {
|
|
181
|
-
// Check if activeForm has keys
|
|
182
|
-
if (activeForm && typeof activeForm === 'object') {
|
|
183
|
-
// Iterate over the keys in activeForm to find the matching id
|
|
184
|
-
for (const key in activeForm) {
|
|
185
|
-
if (activeForm[key].id === fieldSetting.id) {
|
|
186
|
-
// If a matching id is found, update the corresponding field
|
|
187
|
-
setActiveForm((prevState) => ({
|
|
188
|
-
...prevState,
|
|
189
|
-
[key]: {
|
|
190
|
-
...prevState[key],
|
|
191
|
-
value, // Update the value for the matching id
|
|
192
|
-
imageData,
|
|
193
|
-
},
|
|
194
|
-
}));
|
|
195
|
-
|
|
196
|
-
setCanvasSaveCounter((prevState) => prevState + 1);
|
|
197
|
-
return; // Exit after updating to prevent further iterations
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
useEffect(() => {
|
|
204
|
-
if (canvasSaveCounter > 0) {
|
|
205
|
-
handleSaveForm(false);
|
|
206
|
-
}
|
|
207
|
-
}, [canvasSaveCounter]);
|
|
208
|
-
|
|
209
177
|
const handleChangeCheckbox = (e) => {
|
|
210
178
|
const { checked, name, value } = e.target;
|
|
211
179
|
|
|
@@ -279,20 +247,33 @@ const GenericDynamic = ({
|
|
|
279
247
|
return prevActiveForm;
|
|
280
248
|
}
|
|
281
249
|
|
|
282
|
-
// Create a
|
|
250
|
+
// Create a new rows array with updated value properties based on input type
|
|
283
251
|
const updatedRows = prevActiveForm[formKey].rows.map((row) => {
|
|
284
252
|
if (row.id === rowId) {
|
|
285
|
-
//
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
[columnId]:
|
|
253
|
+
// Determine new value based on input type
|
|
254
|
+
let newValue;
|
|
255
|
+
if (type === 'checkbox') {
|
|
256
|
+
newValue = { ...row.value, [columnId]: checked };
|
|
257
|
+
} else if (
|
|
258
|
+
type === 'date' ||
|
|
259
|
+
type === 'time' ||
|
|
260
|
+
type === 'text'
|
|
261
|
+
) {
|
|
262
|
+
newValue = { ...row.value, [columnId]: value };
|
|
263
|
+
} else {
|
|
264
|
+
// For other input types, use the value directly
|
|
265
|
+
newValue = { ...row.value, [columnId]: value };
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
...row,
|
|
270
|
+
value: newValue,
|
|
289
271
|
};
|
|
290
|
-
return { ...row, value: newValue }; // Return the updated row
|
|
291
272
|
}
|
|
292
|
-
return row;
|
|
273
|
+
return row;
|
|
293
274
|
});
|
|
294
275
|
|
|
295
|
-
//
|
|
276
|
+
// Return the updated activeForm state
|
|
296
277
|
return {
|
|
297
278
|
...prevActiveForm,
|
|
298
279
|
[formKey]: {
|
|
@@ -582,29 +563,27 @@ const GenericDynamic = ({
|
|
|
582
563
|
});
|
|
583
564
|
};
|
|
584
565
|
|
|
585
|
-
const handleSaveForm = async (
|
|
566
|
+
const handleSaveForm = async () => {
|
|
586
567
|
try {
|
|
587
568
|
let error = '';
|
|
588
569
|
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
];
|
|
570
|
+
const excludedTypes = [
|
|
571
|
+
'dynamicdata',
|
|
572
|
+
'plaintext',
|
|
573
|
+
'plaintextheading',
|
|
574
|
+
'section',
|
|
575
|
+
'table_radio',
|
|
576
|
+
];
|
|
597
577
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
578
|
+
Object.entries(activeForm).forEach(([key, field]) => {
|
|
579
|
+
if (
|
|
580
|
+
field.required === true &&
|
|
581
|
+
!excludedTypes.includes(field.type) &&
|
|
582
|
+
(field.value === null || field.value === '')
|
|
583
|
+
) {
|
|
584
|
+
error += `<p>${field.label} is required</p>`;
|
|
585
|
+
}
|
|
586
|
+
});
|
|
608
587
|
|
|
609
588
|
if (error === '') {
|
|
610
589
|
const res = await CustomFetch(setting.save, 'POST', {
|
|
@@ -629,34 +608,47 @@ const GenericDynamic = ({
|
|
|
629
608
|
};
|
|
630
609
|
|
|
631
610
|
useEffect(() => {
|
|
632
|
-
if (
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
611
|
+
if (data[type] && data[type].length > 0) {
|
|
612
|
+
if (multiple) {
|
|
613
|
+
if (templateStatus) {
|
|
614
|
+
let lastForm = data[type][data[type].length - 1];
|
|
615
|
+
|
|
616
|
+
if (lastForm && typeof lastForm === 'object') {
|
|
617
|
+
Object.entries(lastForm).forEach(([key, field]) => {
|
|
618
|
+
if (field && field.required) {
|
|
619
|
+
if (
|
|
620
|
+
field.required === 'yes' ||
|
|
621
|
+
field.required === 'no'
|
|
622
|
+
) {
|
|
623
|
+
lastForm[key].required =
|
|
624
|
+
field.required === 'yes';
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
});
|
|
636
628
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
? data[type][0] || data[type]
|
|
641
|
-
: data[type];
|
|
642
|
-
|
|
643
|
-
if (
|
|
644
|
-
multiple &&
|
|
645
|
-
templateStatus &&
|
|
646
|
-
formData &&
|
|
647
|
-
typeof formData === 'object'
|
|
648
|
-
) {
|
|
649
|
-
// Process the last form for required fields
|
|
650
|
-
Object.entries(formData).forEach(([key, field]) => {
|
|
651
|
-
if (field?.required) {
|
|
652
|
-
field.required = field.required === 'yes';
|
|
629
|
+
setActiveForm(lastForm);
|
|
630
|
+
setActiveFormKey(data[type].length - 1);
|
|
631
|
+
}
|
|
653
632
|
}
|
|
654
|
-
}
|
|
633
|
+
} else {
|
|
634
|
+
if (data[type].hasOwnProperty('id')) {
|
|
635
|
+
if (
|
|
636
|
+
Object.keys(activeForm).length === 0 &&
|
|
637
|
+
templateStatus &&
|
|
638
|
+
data[type][0]
|
|
639
|
+
) {
|
|
640
|
+
setActiveForm(data[type][0]);
|
|
641
|
+
setActiveFormKey(0);
|
|
642
|
+
}
|
|
643
|
+
} else {
|
|
644
|
+
setActiveForm(data[type]);
|
|
645
|
+
setActiveFormKey(0);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
} else {
|
|
649
|
+
setActiveForm({});
|
|
655
650
|
}
|
|
656
|
-
|
|
657
|
-
setActiveForm(formData);
|
|
658
|
-
setActiveFormKey(0);
|
|
659
|
-
}, [data, type, multiple, templateStatus]);
|
|
651
|
+
}, [data, type]);
|
|
660
652
|
|
|
661
653
|
useEffect(() => {
|
|
662
654
|
if (data[type] && data[type].length > 0) {
|
|
@@ -824,7 +816,6 @@ const GenericDynamic = ({
|
|
|
824
816
|
? Object.entries(activeForm)
|
|
825
817
|
.filter(
|
|
826
818
|
([key, value]) =>
|
|
827
|
-
value && // Add this check to ensure value is not null
|
|
828
819
|
typeof value === 'object' &&
|
|
829
820
|
[
|
|
830
821
|
'id',
|
|
@@ -851,9 +842,6 @@ const GenericDynamic = ({
|
|
|
851
842
|
onChange={
|
|
852
843
|
handleChange
|
|
853
844
|
}
|
|
854
|
-
onChangeCanvas={
|
|
855
|
-
handleChangeCanvas
|
|
856
|
-
}
|
|
857
845
|
onChangeCheckbox={
|
|
858
846
|
handleChangeCheckbox
|
|
859
847
|
}
|
|
@@ -902,18 +890,12 @@ const GenericDynamic = ({
|
|
|
902
890
|
originalData
|
|
903
891
|
)}
|
|
904
892
|
onChange={handleChange}
|
|
905
|
-
onChangeCanvas={
|
|
906
|
-
handleChangeCanvas
|
|
907
|
-
}
|
|
908
893
|
onChangeCheckbox={
|
|
909
894
|
handleChangeCheckbox
|
|
910
895
|
}
|
|
911
896
|
onChangeDate={
|
|
912
897
|
handleChangeDate
|
|
913
898
|
}
|
|
914
|
-
onChangeNumberFormat={
|
|
915
|
-
handleChangeNumberFormat
|
|
916
|
-
}
|
|
917
899
|
onChangeTableRadio={
|
|
918
900
|
handleChangeTableRadio
|
|
919
901
|
}
|
|
@@ -8,7 +8,7 @@ import Toggle from 'react-toggle';
|
|
|
8
8
|
import { toast } from 'react-toastify';
|
|
9
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
10
10
|
import { Editor } from '@tinymce/tinymce-react';
|
|
11
|
-
import { CirclePlus, CircleX, TrashCan } from 'akar-icons';
|
|
11
|
+
import { CircleChevronRight, CirclePlus, CircleX, TrashCan } from 'akar-icons';
|
|
12
12
|
|
|
13
13
|
import 'react-toggle/style.css';
|
|
14
14
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
@@ -17,7 +17,6 @@ import 'react-confirm-alert/src/react-confirm-alert.css';
|
|
|
17
17
|
import Breadcrumb from '../Breadcrumb';
|
|
18
18
|
import CustomFetch from '../Fetch';
|
|
19
19
|
import SortableList from '../../../components/cms/sorting/List';
|
|
20
|
-
import SketchConfig from '../sketch/json/config.json';
|
|
21
20
|
|
|
22
21
|
import styles from './styles/GenericFormBuilder.module.scss'; // Import the CSS module
|
|
23
22
|
|
|
@@ -45,8 +44,7 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
45
44
|
label: '',
|
|
46
45
|
type: '',
|
|
47
46
|
});
|
|
48
|
-
const [fieldTypes] = useState([
|
|
49
|
-
{ value: 'canvas', label: 'Canvas' },
|
|
47
|
+
const [fieldTypes, setFieldTypes] = useState([
|
|
50
48
|
{ value: 'checkbox', label: 'Checkbox' },
|
|
51
49
|
{ value: 'html5_date', label: 'Date' },
|
|
52
50
|
{ value: 'html5_datetime', label: 'Date & Time' },
|
|
@@ -80,7 +78,6 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
80
78
|
});
|
|
81
79
|
const [modalFormShow, setModalFormShow] = useState(false);
|
|
82
80
|
const [roles, setRoles] = useState([]);
|
|
83
|
-
const canvasTypes = SketchConfig.canvasTypes;
|
|
84
81
|
|
|
85
82
|
/** Data Option Functionalities */
|
|
86
83
|
const handleDataOption = (e) => {
|
|
@@ -431,21 +428,6 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
431
428
|
|
|
432
429
|
const renderField = (field) => {
|
|
433
430
|
switch (field.type) {
|
|
434
|
-
case 'canvas':
|
|
435
|
-
const canvasType = canvasTypes.find(
|
|
436
|
-
(item) => item.id === field.canvasType
|
|
437
|
-
);
|
|
438
|
-
return (
|
|
439
|
-
<label className={`${styles.fi__label}`}>
|
|
440
|
-
<span
|
|
441
|
-
className={`${styles.fi__span} ${styles.prefocus}`}
|
|
442
|
-
>
|
|
443
|
-
{field.label}{' '}
|
|
444
|
-
{field.required === 'yes' ? '*' : null}
|
|
445
|
-
</span>
|
|
446
|
-
<img src={canvasType.url} width="200" />
|
|
447
|
-
</label>
|
|
448
|
-
);
|
|
449
431
|
case 'checkbox':
|
|
450
432
|
return (
|
|
451
433
|
<label className={styles.fi__label}>
|
|
@@ -839,19 +821,17 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
839
821
|
<div className={styles.grid__subrow}>
|
|
840
822
|
<div className={styles.grid__subnav}>
|
|
841
823
|
{data.detail && data.detail.length > 0 ? (
|
|
842
|
-
<
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
/>
|
|
854
|
-
</div>
|
|
824
|
+
<SortableList
|
|
825
|
+
handleClick={handleEdit}
|
|
826
|
+
handleDelete={handleDeleteField}
|
|
827
|
+
items={data.detail}
|
|
828
|
+
onSortEnd={onSortEnd}
|
|
829
|
+
axis="xy"
|
|
830
|
+
helperClass={styles.dragitem}
|
|
831
|
+
transitionDuration={250}
|
|
832
|
+
showImage={false}
|
|
833
|
+
useDragHandle
|
|
834
|
+
/>
|
|
855
835
|
) : null}
|
|
856
836
|
</div>
|
|
857
837
|
<div className={styles.grid__subcontent}>
|
|
@@ -1493,9 +1473,9 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
1493
1473
|
dataField.type ===
|
|
1494
1474
|
'table_text'
|
|
1495
1475
|
) {
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1476
|
+
excludedKeywords.push(
|
|
1477
|
+
'checkbox'
|
|
1478
|
+
);
|
|
1499
1479
|
}
|
|
1500
1480
|
return !excludedKeywords.some(
|
|
1501
1481
|
(
|
|
@@ -1630,9 +1610,9 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
1630
1610
|
dataField.type ===
|
|
1631
1611
|
'table_text'
|
|
1632
1612
|
) {
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1613
|
+
excludedKeywords.push(
|
|
1614
|
+
'checkbox'
|
|
1615
|
+
);
|
|
1636
1616
|
}
|
|
1637
1617
|
return !excludedKeywords.some(
|
|
1638
1618
|
(
|
|
@@ -1699,46 +1679,6 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
1699
1679
|
</div>
|
|
1700
1680
|
) : null}
|
|
1701
1681
|
|
|
1702
|
-
{['canvas'].includes(dataField.type) ? (
|
|
1703
|
-
<div className={styles.formItem}>
|
|
1704
|
-
<label className={styles.fi__label}>
|
|
1705
|
-
<select
|
|
1706
|
-
name="canvasType"
|
|
1707
|
-
value={dataField.canvasType}
|
|
1708
|
-
onChange={handleChangeForm}
|
|
1709
|
-
>
|
|
1710
|
-
<option>
|
|
1711
|
-
Please select a type
|
|
1712
|
-
</option>
|
|
1713
|
-
{canvasTypes.map(
|
|
1714
|
-
(
|
|
1715
|
-
canvasType,
|
|
1716
|
-
canvasTypeKey
|
|
1717
|
-
) => (
|
|
1718
|
-
<option
|
|
1719
|
-
value={
|
|
1720
|
-
canvasType.id
|
|
1721
|
-
}
|
|
1722
|
-
key={
|
|
1723
|
-
canvasTypeKey
|
|
1724
|
-
}
|
|
1725
|
-
>
|
|
1726
|
-
{
|
|
1727
|
-
canvasType.label
|
|
1728
|
-
}
|
|
1729
|
-
</option>
|
|
1730
|
-
)
|
|
1731
|
-
)}
|
|
1732
|
-
</select>
|
|
1733
|
-
<span
|
|
1734
|
-
className={styles.fi__span}
|
|
1735
|
-
>
|
|
1736
|
-
Canvas Type
|
|
1737
|
-
</span>
|
|
1738
|
-
</label>
|
|
1739
|
-
</div>
|
|
1740
|
-
) : null}
|
|
1741
|
-
|
|
1742
1682
|
{['signature'].includes(dataField.type) ? (
|
|
1743
1683
|
<div className={styles.formItem}>
|
|
1744
1684
|
<label className={styles.fi__label}>
|
|
@@ -4,7 +4,6 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
4
4
|
import { Outlet } from 'react-router-dom';
|
|
5
5
|
import { toast } from 'react-toastify';
|
|
6
6
|
import { saveAs } from 'file-saver';
|
|
7
|
-
import parse from 'html-react-parser';
|
|
8
7
|
import _ from 'lodash';
|
|
9
8
|
import moment from 'moment';
|
|
10
9
|
|
|
@@ -388,7 +387,7 @@ function GenericIndex({
|
|
|
388
387
|
: styles.crmtitleSimple
|
|
389
388
|
}`}
|
|
390
389
|
>
|
|
391
|
-
<h1>{
|
|
390
|
+
<h1>{setting.page?.title}</h1>
|
|
392
391
|
<div className={styles.titleInfo}>
|
|
393
392
|
<span>
|
|
394
393
|
[<strong>{total}</strong> Total{' '}
|
|
@@ -127,57 +127,6 @@
|
|
|
127
127
|
color: var(--background-color);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
.grid__subnav__alternate {
|
|
131
|
-
flex: 1;
|
|
132
|
-
background: rgba(var(--item-color-rgb), 0.05);
|
|
133
|
-
border-radius: var(--br);
|
|
134
|
-
border: 1px solid rgba(var(--item-color-rgb), 1.15);
|
|
135
|
-
box-sizing: border-box;
|
|
136
|
-
padding: 5px;
|
|
137
|
-
margin: 8px 0;
|
|
138
|
-
height: auto;
|
|
139
|
-
box-shadow: 0 4px 0 rgba(var(--primary-color-rgb), 0.05);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.grid__subnav__alternate > ul {
|
|
143
|
-
width: 100%;
|
|
144
|
-
list-style: none;
|
|
145
|
-
padding: 0;
|
|
146
|
-
margin: 0;
|
|
147
|
-
display: flex;
|
|
148
|
-
flex-wrap: wrap;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.grid__subnav__alternate > ul li {
|
|
152
|
-
width: 100%;
|
|
153
|
-
margin-bottom: 3px;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.grid__subnav__alternate > ul li a {
|
|
157
|
-
width: 100%;
|
|
158
|
-
padding: 8px 20px;
|
|
159
|
-
box-sizing: border-box;
|
|
160
|
-
display: block;
|
|
161
|
-
text-decoration: none;
|
|
162
|
-
background: rgba(var(--item-color-rgb), 1.05);
|
|
163
|
-
color: var(--secondary-color);
|
|
164
|
-
border-radius: 5px;
|
|
165
|
-
transition: background 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
166
|
-
outline: none;
|
|
167
|
-
cursor: pointer;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.grid__subnav__alternate > ul li:hover a {
|
|
171
|
-
background: var(--primary-color);
|
|
172
|
-
color: var(--secondary-color);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.grid__subnav__alternate > ul li .subactive {
|
|
176
|
-
font-weight: 700;
|
|
177
|
-
background: var(--primary-color);
|
|
178
|
-
color: var(--secondary-color);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
130
|
.grid__minheight {
|
|
182
131
|
min-height: 300px;
|
|
183
132
|
}
|