@opengeoweb/form-fields 4.6.1 → 4.7.0
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/index.esm.js +10 -21
- package/index.umd.js +10 -4
- package/lib/components/ReactHookFormHiddenInput.d.ts +1 -1
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -852,37 +852,26 @@ var ReactHookFormProviderWrapper = function ReactHookFormProviderWrapper(_ref2)
|
|
|
852
852
|
}, children));
|
|
853
853
|
};
|
|
854
854
|
|
|
855
|
-
/* *
|
|
856
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
857
|
-
* you may not use this file except in compliance with the License.
|
|
858
|
-
* You may obtain a copy of the License at
|
|
859
|
-
*
|
|
860
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
861
|
-
*
|
|
862
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
863
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
864
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
865
|
-
* See the License for the specific language governing permissions and
|
|
866
|
-
* limitations under the License.
|
|
867
|
-
*
|
|
868
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
869
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
870
|
-
* */
|
|
871
|
-
|
|
872
855
|
var ReactHookFormHiddenInput = function ReactHookFormHiddenInput(_ref) {
|
|
873
856
|
var name = _ref.name,
|
|
874
857
|
_ref$defaultValue = _ref.defaultValue,
|
|
875
|
-
defaultValue = _ref$defaultValue === void 0 ?
|
|
858
|
+
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
|
|
876
859
|
rules = _ref.rules;
|
|
877
860
|
|
|
878
861
|
var _useFormContext = useFormContext(),
|
|
879
862
|
control = _useFormContext.control;
|
|
880
863
|
|
|
881
864
|
return /*#__PURE__*/React.createElement(Controller, {
|
|
882
|
-
render: function render(
|
|
883
|
-
|
|
865
|
+
render: function render(_a) {
|
|
866
|
+
var value = _a.value,
|
|
867
|
+
field = __rest(_a, ["value"]);
|
|
868
|
+
|
|
869
|
+
var fieldValue = value || '';
|
|
870
|
+
return /*#__PURE__*/React.createElement("input", Object.assign({
|
|
871
|
+
value: fieldValue
|
|
872
|
+
}, field, {
|
|
884
873
|
type: "hidden"
|
|
885
|
-
}))
|
|
874
|
+
}));
|
|
886
875
|
},
|
|
887
876
|
name: name,
|
|
888
877
|
control: control,
|
package/index.umd.js
CHANGED
|
@@ -877,14 +877,20 @@
|
|
|
877
877
|
var ReactHookFormHiddenInput = function ReactHookFormHiddenInput(_a) {
|
|
878
878
|
var name = _a.name,
|
|
879
879
|
_b = _a.defaultValue,
|
|
880
|
-
defaultValue = _b === void 0 ?
|
|
880
|
+
defaultValue = _b === void 0 ? '' : _b,
|
|
881
881
|
rules = _a.rules;
|
|
882
882
|
var control = reactHookForm.useFormContext().control;
|
|
883
883
|
return /*#__PURE__*/React__namespace.createElement(reactHookForm.Controller, {
|
|
884
|
-
render: function render(
|
|
885
|
-
|
|
884
|
+
render: function render(_a) {
|
|
885
|
+
var value = _a.value,
|
|
886
|
+
field = __rest(_a, ["value"]);
|
|
887
|
+
|
|
888
|
+
var fieldValue = value || '';
|
|
889
|
+
return /*#__PURE__*/React__namespace.createElement("input", __assign({
|
|
890
|
+
value: fieldValue
|
|
891
|
+
}, field, {
|
|
886
892
|
type: "hidden"
|
|
887
|
-
}))
|
|
893
|
+
}));
|
|
888
894
|
},
|
|
889
895
|
name: name,
|
|
890
896
|
control: control,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactHookFormInput } from './types';
|
|
3
3
|
declare type ReactHookFormHiddenInputProps = ReactHookFormInput<{
|
|
4
|
-
defaultValue?:
|
|
4
|
+
defaultValue?: string | Record<string, any>;
|
|
5
5
|
}>;
|
|
6
6
|
declare const ReactHookFormHiddenInput: React.FC<ReactHookFormHiddenInputProps>;
|
|
7
7
|
export default ReactHookFormHiddenInput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/form-fields",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "GeoWeb form-fields library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"react-hook-form": "^6.12.1",
|
|
16
16
|
"react": "^17.0.2",
|
|
17
17
|
"@mui/material": "^5.10.8",
|
|
18
|
-
"@opengeoweb/theme": "4.
|
|
18
|
+
"@opengeoweb/theme": "4.7.0",
|
|
19
19
|
"moment": "^2.29.0",
|
|
20
20
|
"moment-timezone": "^0.5.31",
|
|
21
21
|
"@mui/x-date-pickers": "^5.0.4",
|