@gpa-gemstone/react-forms 1.1.80 → 1.1.81

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/lib/FileUpload.js CHANGED
@@ -62,11 +62,11 @@ var FileUpload = function (props) {
62
62
  };
63
63
  return (React.createElement(React.Fragment, null,
64
64
  React.createElement("div", { className: 'row' },
65
- React.createElement("div", { className: 'col-auto mt-2' },
65
+ React.createElement("div", { className: 'col-auto mt-2 pl-0' },
66
66
  React.createElement("label", { style: { cursor: 'pointer' } },
67
67
  React.createElement(gpa_symbols_1.ReactIcons.ShareArrow, { Color: 'var(--info)' }),
68
68
  React.createElement("input", { type: "file", onChange: handleFileUpload, accept: props.FileTypeAttribute, style: { display: 'none' } }))),
69
- React.createElement("div", { className: 'col-auto' },
69
+ React.createElement("div", { className: 'col-auto pl-0' },
70
70
  React.createElement("button", { className: 'btn', onClick: handleOnClear },
71
71
  React.createElement(gpa_symbols_1.ReactIcons.CircledX, { Color: 'red' })))),
72
72
  isFileUpload ?
@@ -38,16 +38,18 @@ var React = require("react");
38
38
  var StylableSelect_1 = require("./StylableSelect");
39
39
  var gpa_symbols_1 = require("@gpa-gemstone/gpa-symbols");
40
40
  function SearchableSelect(props) {
41
- var _a = React.useState(props.Record[props.Field].toString()), search = _a[0], setSearch = _a[1];
42
- var _b = React.useState(props.Record[props.Field].toString()), label = _b[0], setLabel = _b[1];
43
- var _c = React.useState([]), results = _c[0], setResults = _c[1];
44
- var _d = React.useState(false), loading = _d[0], setLoading = _d[1];
41
+ var _a, _b, _c, _d;
42
+ var _e = React.useState((_b = (_a = props.Record[props.Field]) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''), search = _e[0], setSearch = _e[1];
43
+ var _f = React.useState((_d = (_c = props.Record[props.Field]) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : ''), label = _f[0], setLabel = _f[1];
44
+ var _g = React.useState([]), results = _g[0], setResults = _g[1];
45
+ var _h = React.useState(false), loading = _h[0], setLoading = _h[1];
45
46
  React.useEffect(function () {
47
+ var _a, _b;
46
48
  if (props.GetLabel === undefined)
47
- setLabel(props.Record[props.Field].toString());
49
+ setLabel((_b = (_a = props.Record[props.Field]) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '');
48
50
  else {
49
51
  setLoading(true);
50
- var _a = props.GetLabel(), handle = _a[0], callback = _a[1];
52
+ var _c = props.GetLabel(), handle = _c[0], callback = _c[1];
51
53
  handle.then(function (lab) {
52
54
  setLabel(lab);
53
55
  setSearch(lab);
@@ -69,19 +71,19 @@ function SearchableSelect(props) {
69
71
  setSearch(label);
70
72
  }, [label]);
71
73
  var options = React.useMemo(function () {
72
- var _a;
74
+ var _a, _b;
73
75
  var ops = [];
74
76
  ops.push({
75
77
  Value: props.Record[props.Field],
76
78
  Element: React.createElement("div", { className: 'input-group' },
77
- React.createElement("input", { type: "text", className: "form-control", value: search, onChange: function (d) { return setSearch(d.target.value); }, onBlur: handleOnBlur }),
79
+ React.createElement("input", { type: "text", className: "form-control", value: search, onChange: function (d) { return setSearch(d.target.value); }, onBlur: handleOnBlur, disabled: (_a = props.Disabled) !== null && _a !== void 0 ? _a : false }),
78
80
  loading ?
79
81
  React.createElement("div", { className: "input-group-append" },
80
82
  React.createElement("span", { className: "input-group-text" },
81
83
  React.createElement(gpa_symbols_1.ReactIcons.SpiningIcon, null)))
82
84
  : null)
83
85
  });
84
- if (!((_a = props.AllowCustom) !== null && _a !== void 0 ? _a : false))
86
+ if (!((_b = props.AllowCustom) !== null && _b !== void 0 ? _b : false))
85
87
  ops.push({ Value: 'search-' + props.Record[props.Field], Element: label });
86
88
  else
87
89
  ops.push({ Value: search, Element: search });
@@ -90,7 +92,8 @@ function SearchableSelect(props) {
90
92
  }, [search, props.Record[props.Field], results, props.Disabled, loading, label, props.AllowCustom, handleOnBlur]);
91
93
  var update = React.useCallback(function (record, selectedOption) {
92
94
  var _a;
93
- var stringVal = record[props.Field].toString();
95
+ var _b, _c;
96
+ var stringVal = (_c = (_b = record[props.Field]) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : '';
94
97
  var newLabel = stringVal;
95
98
  if (!React.isValidElement(selectedOption.Element))
96
99
  newLabel = selectedOption.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/react-forms",
3
- "version": "1.1.80",
3
+ "version": "1.1.81",
4
4
  "description": "React Form modules for gpa webapps",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -45,8 +45,8 @@
45
45
  "typescript": "5.5.3"
46
46
  },
47
47
  "dependencies": {
48
- "@gpa-gemstone/application-typings": "0.0.80",
49
- "@gpa-gemstone/gpa-symbols": "0.0.46",
48
+ "@gpa-gemstone/application-typings": "0.0.81",
49
+ "@gpa-gemstone/gpa-symbols": "0.0.47",
50
50
  "@gpa-gemstone/helper-functions": "0.0.37",
51
51
  "@types/react": "^17.0.14",
52
52
  "@types/styled-components": "^5.1.11",