@visns-studio/visns-components 1.6.9 → 1.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.
@@ -736,6 +736,42 @@ const DataGrid = forwardRef(
736
736
  }
737
737
  },
738
738
  };
739
+ case "colour":
740
+ return {
741
+ ...commonProps,
742
+ name: `${column.type}.${column.id}`,
743
+ sortable: false,
744
+ render: ({ data }) => {
745
+ if (data && data[column.id]) {
746
+ return (
747
+ <div
748
+ style={{
749
+ width: "25px",
750
+ height: "25px",
751
+ borderRadius: "10px",
752
+ overflow: "hidden",
753
+ }}
754
+ >
755
+ <div
756
+ style={{
757
+ background:
758
+ data[column.id] +
759
+ " none repeat scroll 0% 0%",
760
+ height: "100%",
761
+ width: "100%",
762
+ cursor: "pointer",
763
+ position: "relative",
764
+ outline:
765
+ "currentcolor none medium",
766
+ }}
767
+ ></div>
768
+ </div>
769
+ );
770
+ } else {
771
+ return null;
772
+ }
773
+ },
774
+ };
739
775
  case "created_by":
740
776
  return {
741
777
  ...commonProps,
@@ -143,7 +143,10 @@ function Form(props) {
143
143
  if (formData.hasOwnProperty(a)) {
144
144
  setFormData((prevState) => ({
145
145
  ...prevState,
146
- [a]: inputValue[a],
146
+ [a]:
147
+ prevState[a] !== ""
148
+ ? prevState[a]
149
+ : inputValue[a],
147
150
  }));
148
151
  }
149
152
  });
@@ -11,18 +11,18 @@ function MultiSelect(props) {
11
11
 
12
12
  if (options.length > 0) {
13
13
  options.forEach((a) => {
14
- let _optionItem;
15
-
16
- _optionItem = {
14
+ let _optionItem = {
17
15
  value: a.id,
18
16
  label: a.label,
19
17
  };
20
18
 
21
19
  Object.keys(a).forEach((b) => {
22
- _optionItem = {
23
- ..._optionItem,
24
- [b]: a[b],
25
- };
20
+ if (b !== "id") {
21
+ _optionItem = {
22
+ ..._optionItem,
23
+ [b]: a[b],
24
+ };
25
+ }
26
26
  });
27
27
 
28
28
  _options.push(_optionItem);
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
 
3
- function Select(props) {
3
+ const Select = (props) => {
4
4
  const { className, dataOptions, inputValue, onChange, options, settings } =
5
5
  props;
6
6
 
@@ -24,6 +24,6 @@ function Select(props) {
24
24
  ))}
25
25
  </select>
26
26
  );
27
- }
27
+ };
28
28
 
29
29
  export default Select;
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.9",
37
+ "version": "1.6.11",
38
38
  "description": "Various packages to assist in the development of our Custom Applications.",
39
39
  "main": "index.js",
40
40
  "devDependencies": {},