@visns-studio/visns-components 3.5.6 → 3.5.8
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.
|
@@ -770,6 +770,7 @@ function GenericDetail({ extraUrlParam, setting, urlParam, userProfile }) {
|
|
|
770
770
|
{({
|
|
771
771
|
getRootProps,
|
|
772
772
|
getInputProps,
|
|
773
|
+
isDragActive,
|
|
773
774
|
}) => (
|
|
774
775
|
<section className="dropzone__container">
|
|
775
776
|
<div
|
|
@@ -778,23 +779,55 @@ function GenericDetail({ extraUrlParam, setting, urlParam, userProfile }) {
|
|
|
778
779
|
<input
|
|
779
780
|
{...getInputProps()}
|
|
780
781
|
/>
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
782
|
+
{isDragActive ? (
|
|
783
|
+
<p>
|
|
784
|
+
Drop
|
|
785
|
+
the
|
|
786
|
+
files
|
|
787
|
+
here
|
|
788
|
+
...
|
|
789
|
+
</p>
|
|
790
|
+
) : (
|
|
791
|
+
<p>
|
|
792
|
+
Drag
|
|
793
|
+
'n'
|
|
794
|
+
drop
|
|
795
|
+
some
|
|
796
|
+
files
|
|
797
|
+
here,
|
|
798
|
+
or
|
|
799
|
+
click
|
|
800
|
+
to
|
|
801
|
+
select
|
|
802
|
+
files
|
|
803
|
+
</p>
|
|
804
|
+
)}
|
|
794
805
|
</div>
|
|
795
806
|
</section>
|
|
796
807
|
)}
|
|
797
808
|
</Dropzone>
|
|
809
|
+
<div className="progress">
|
|
810
|
+
<motion.div
|
|
811
|
+
className="progress__bar"
|
|
812
|
+
initial={{
|
|
813
|
+
width: '0%',
|
|
814
|
+
}}
|
|
815
|
+
animate={{
|
|
816
|
+
width:
|
|
817
|
+
loadingProgress +
|
|
818
|
+
'%',
|
|
819
|
+
}}
|
|
820
|
+
transition={{
|
|
821
|
+
duration: 2,
|
|
822
|
+
ease: [
|
|
823
|
+
0.165,
|
|
824
|
+
0.84,
|
|
825
|
+
0.44,
|
|
826
|
+
1.0,
|
|
827
|
+
],
|
|
828
|
+
}}
|
|
829
|
+
/>
|
|
830
|
+
</div>
|
|
798
831
|
</div>
|
|
799
832
|
</div>
|
|
800
833
|
)}
|
|
@@ -363,27 +363,26 @@ const GenericDynamic = ({ data, fetchData, label, setData, setting, type }) => {
|
|
|
363
363
|
};
|
|
364
364
|
|
|
365
365
|
useEffect(() => {
|
|
366
|
-
if (data[type]) {
|
|
366
|
+
if (data[type] && data[type].length > 0) {
|
|
367
367
|
// Retrieve the last form of the specified type
|
|
368
368
|
let lastForm = data[type][data[type].length - 1];
|
|
369
369
|
|
|
370
|
-
|
|
371
|
-
([key, field]) => {
|
|
372
|
-
if (field.required) {
|
|
370
|
+
if (lastForm && typeof lastForm === 'object') {
|
|
371
|
+
Object.entries(lastForm).forEach(([key, field]) => {
|
|
372
|
+
if (field && field.required) {
|
|
373
373
|
if (
|
|
374
374
|
field.required === 'yes' ||
|
|
375
375
|
field.required === 'no'
|
|
376
376
|
) {
|
|
377
|
-
lastForm[key].required =
|
|
378
|
-
field.required === 'yes' ? true : false;
|
|
377
|
+
lastForm[key].required = field.required === 'yes';
|
|
379
378
|
}
|
|
380
379
|
}
|
|
381
|
-
}
|
|
382
|
-
);
|
|
380
|
+
});
|
|
383
381
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
382
|
+
// Update the active form with the modified lastForm
|
|
383
|
+
setActiveForm(lastForm);
|
|
384
|
+
setActiveFormKey(data[type].length - 1);
|
|
385
|
+
}
|
|
387
386
|
} else {
|
|
388
387
|
handleAddNewForm();
|
|
389
388
|
}
|
package/package.json
CHANGED