@visns-studio/visns-components 1.6.6 → 1.6.7

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.
@@ -1331,7 +1331,7 @@ const DataGrid = ({
1331
1331
  : 450
1332
1332
  : 400;
1333
1333
 
1334
- let rowCount = Math.floor((dgHeight - 100) / 40);
1334
+ let rowCount = Math.floor((dgHeight - 50) / 60);
1335
1335
  setLimit(rowCount);
1336
1336
  }, [dataCount]);
1337
1337
 
@@ -17,6 +17,7 @@ import CustomFetch from "../crm/visns-fetch";
17
17
  import Select from "../crm/visns-select";
18
18
  import MultiSelect from "../crm/visns-multi-select";
19
19
  import VisnsAutocomplete from "../crm/visns-autocomplete";
20
+ import moment from "moment";
20
21
 
21
22
  Quill.register("modules/imageUploader", ImageUploader);
22
23
 
@@ -63,6 +64,7 @@ const Field = ({
63
64
  inputValue,
64
65
  inputClass,
65
66
  onChange,
67
+ onChangeDate,
66
68
  onChangeFile,
67
69
  onChangeRicheditor,
68
70
  onChangeSelect,
@@ -556,7 +558,11 @@ const Field = ({
556
558
  : "dd-MM-yyyy"
557
559
  }
558
560
  className={inputClass[settings.id]}
559
- selected={inputValue || ""}
561
+ selected={
562
+ inputValue
563
+ ? moment(inputValue).toDate()
564
+ : ""
565
+ }
560
566
  showMonthDropdown
561
567
  showYearDropdown
562
568
  dropdownMode="select"
@@ -576,7 +582,11 @@ const Field = ({
576
582
  }
577
583
  showTimeSelect
578
584
  className={inputClass[settings.id]}
579
- selected={inputValue || null}
585
+ selected={
586
+ inputValue
587
+ ? moment(inputValue).toDate()
588
+ : ""
589
+ }
580
590
  showMonthDropdown
581
591
  showYearDropdown
582
592
  dropdownMode="select"
@@ -600,7 +610,11 @@ const Field = ({
600
610
  timeIntervals={15}
601
611
  timeCaption="Time"
602
612
  className={inputClass[settings.id]}
603
- selected={inputValue || ""}
613
+ selected={
614
+ inputValue
615
+ ? moment(inputValue).toDate()
616
+ : ""
617
+ }
604
618
  onChange={(date) =>
605
619
  onChangeDate(date, settings.id)
606
620
  }
@@ -67,6 +67,13 @@ function Form(props) {
67
67
  }
68
68
  };
69
69
 
70
+ const handleChangeDate = (date, id) => {
71
+ setData((prevState) => ({
72
+ ...prevState,
73
+ [id]: date,
74
+ }));
75
+ };
76
+
70
77
  const handleChangeSelect = (value, action, id) => {
71
78
  if (value && action && id) {
72
79
  setData((prevState) => ({
@@ -406,6 +413,7 @@ function Form(props) {
406
413
  }
407
414
  inputClass={dataClass}
408
415
  onChange={handleChange}
416
+ onChangeDate={handleChangeDate}
409
417
  onChangeFile={handleChangeFile}
410
418
  onChangeRicheditor={handleChangeRicheditor}
411
419
  onChangeSelect={handleChangeSelect}
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "react-dom": "^17.0.1"
35
35
  },
36
36
  "name": "@visns-studio/visns-components",
37
- "version": "1.6.6",
37
+ "version": "1.6.7",
38
38
  "description": "Various packages to assist in the development of our Custom Applications.",
39
39
  "main": "index.js",
40
40
  "devDependencies": {},