@gpa-gemstone/react-forms 1.1.106 → 1.1.108
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.
|
@@ -69,7 +69,7 @@ function DateTimePickerBase(props) {
|
|
|
69
69
|
var _j = React.useState(0), left = _j[0], setLeft = _j[1];
|
|
70
70
|
var allowNull = React.useMemo(function () { var _a; return (_a = props.AllowEmpty) !== null && _a !== void 0 ? _a : false; }, [props.AllowEmpty]);
|
|
71
71
|
React.useEffect(function () {
|
|
72
|
-
if (props.Record[props.Field]
|
|
72
|
+
if (props.Record[props.Field] != null) {
|
|
73
73
|
setPickerRecord(parse(props.Record));
|
|
74
74
|
setBoxRecord(parse(props.Record).format(boxFormat));
|
|
75
75
|
}
|
|
@@ -114,11 +114,12 @@ function DateTimePickerBase(props) {
|
|
|
114
114
|
}, [props.Record, props.Field, boxFormat, showOverlay]);
|
|
115
115
|
function setPickerAndRecord(arg) {
|
|
116
116
|
var _a, _b;
|
|
117
|
+
var _c;
|
|
117
118
|
setPickerRecord(arg);
|
|
118
|
-
if (allowNull && arg
|
|
119
|
+
if (allowNull && arg == null && props.Record[props.Field] != null)
|
|
119
120
|
props.Setter(__assign(__assign({}, props.Record), (_a = {}, _a[props.Field] = null, _a)));
|
|
120
|
-
else if ((arg !=
|
|
121
|
-
props.Record[props.Field].toString() !== arg.format(recordFormat))
|
|
121
|
+
else if ((arg != null && validateDate(arg)) &&
|
|
122
|
+
((_c = props.Record[props.Field]) === null || _c === void 0 ? void 0 : _c.toString()) !== arg.format(recordFormat))
|
|
122
123
|
props.Setter(__assign(__assign({}, props.Record), (_b = {}, _b[props.Field] = arg.format(recordFormat), _b)));
|
|
123
124
|
}
|
|
124
125
|
// Handle clicks outside the component.
|
|
@@ -189,9 +190,6 @@ function DateTimePickerBase(props) {
|
|
|
189
190
|
props.Setter(__assign(__assign({}, props.Record), (_b = {}, _b[props.Field] = moment(value, boxFormat).format(recordFormat), _b)));
|
|
190
191
|
setPickerAndRecord(moment(value, boxFormat));
|
|
191
192
|
}
|
|
192
|
-
else {
|
|
193
|
-
setPickerAndRecord(undefined);
|
|
194
|
-
}
|
|
195
193
|
setBoxRecord(value);
|
|
196
194
|
}
|
|
197
195
|
React.useEffect(function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gpa-gemstone/react-forms",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.108",
|
|
4
4
|
"description": "React Form modules for gpa webapps",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"typescript": "5.5.3"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@gpa-gemstone/application-typings": "0.0.
|
|
49
|
-
"@gpa-gemstone/gpa-symbols": "0.0.
|
|
50
|
-
"@gpa-gemstone/helper-functions": "0.0.
|
|
48
|
+
"@gpa-gemstone/application-typings": "0.0.93",
|
|
49
|
+
"@gpa-gemstone/gpa-symbols": "0.0.58",
|
|
50
|
+
"@gpa-gemstone/helper-functions": "0.0.52",
|
|
51
51
|
"@types/react": "^17.0.14",
|
|
52
52
|
"@types/styled-components": "^5.1.11",
|
|
53
53
|
"lodash": "^4.17.21",
|