@gpa-gemstone/react-forms 1.1.64 → 1.1.65

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.
@@ -1,14 +1,45 @@
1
1
  interface IProps<T> {
2
+ /**
3
+ * Record to be used in form
4
+ * @type {T}
5
+ */
2
6
  Record: T;
7
+ /**
8
+ * Field of the record to be edited
9
+ * @type {keyof T}
10
+ */
3
11
  Field: keyof T;
12
+ /**
13
+ * Setter function to update the Record
14
+ * @param record - Updated Record
15
+ */
4
16
  Setter: (record: T) => void;
17
+ /**
18
+ * Help message or element to display
19
+ * @type {string | JSX.Element}
20
+ * @optional
21
+ */
5
22
  Help?: string | JSX.Element;
23
+ /**
24
+ * Position to display radion buttons in
25
+ * @type {'vertical' | 'horizontal'}
26
+ * @optional
27
+ */
6
28
  Position?: ('vertical' | 'horizontal');
29
+ /**
30
+ * Options for the radion buttons
31
+ * @type {{ Value: string | number; Label: string, Disabled?: boolean }[]}
32
+ */
7
33
  Options: {
8
- Value: string;
34
+ Value: string | number;
9
35
  Label: string;
10
36
  Disabled?: boolean;
11
37
  }[];
38
+ /**
39
+ * Label to display for the form, defaults to the Field prop
40
+ * @type {string}
41
+ * @optional
42
+ */
12
43
  Label?: string;
13
44
  }
14
45
  export default function RadioButtons<T>(props: IProps<T>): JSX.Element;
package/lib/Select.d.ts CHANGED
@@ -14,7 +14,7 @@ interface IProps<T> {
14
14
  * @type {{ Value: string; Label: string }[]}
15
15
  */
16
16
  Options: {
17
- Value: string;
17
+ Value: string | number;
18
18
  Label: string;
19
19
  }[];
20
20
  /**
package/lib/Select.js CHANGED
@@ -68,7 +68,7 @@ function Select(props) {
68
68
  }
69
69
  // Rretrieve the current value of the select field from the record.
70
70
  function GetRecordValue() {
71
- return props.Record[props.Field] == null ? '' : props.Record[props.Field].toString();
71
+ return props.Record[props.Field] == null ? '' : props.Record[props.Field];
72
72
  }
73
73
  return (React.createElement("div", { className: "form-group" },
74
74
  (props.Label !== "") ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/react-forms",
3
- "version": "1.1.64",
3
+ "version": "1.1.65",
4
4
  "description": "React Form modules for gpa webapps",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",