@uncinc/uncinc-react-kitchen-sink 2.25.0 → 2.25.2
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,7 +1,8 @@
|
|
|
1
1
|
export function useExtendedFormikContext(): any;
|
|
2
|
-
export function FormikExtendedContextProvider({ children, ...props }: {
|
|
2
|
+
export function FormikExtendedContextProvider({ children, formProps, ...props }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
children: any;
|
|
5
|
+
formProps: any;
|
|
5
6
|
}): React.JSX.Element;
|
|
6
7
|
export default FormikWrapper;
|
|
7
8
|
import React from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["children"],
|
|
3
|
-
_excluded2 = ["initialValues", "onSubmit", "validate", "validateOnChange", "validateOnBlur", "validateOnMount", "onReset", "children", "displayRequiredIndicator"];
|
|
2
|
+
var _excluded = ["children", "formProps"],
|
|
3
|
+
_excluded2 = ["initialValues", "onSubmit", "validate", "validateOnChange", "validateOnBlur", "validateOnMount", "onReset", "children", "displayRequiredIndicator", "formProps"];
|
|
4
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -17,6 +17,7 @@ export var useExtendedFormikContext = function useExtendedFormikContext() {
|
|
|
17
17
|
};
|
|
18
18
|
export var FormikExtendedContextProvider = function FormikExtendedContextProvider(_ref) {
|
|
19
19
|
var children = _ref.children,
|
|
20
|
+
formProps = _ref.formProps,
|
|
20
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
22
|
var formikContext = useFormikContext();
|
|
22
23
|
|
|
@@ -27,7 +28,7 @@ export var FormikExtendedContextProvider = function FormikExtendedContextProvide
|
|
|
27
28
|
}, [formikContext, props]);
|
|
28
29
|
return /*#__PURE__*/React.createElement(CustomFormikContext.Provider, {
|
|
29
30
|
value: value
|
|
30
|
-
}, /*#__PURE__*/React.createElement(Form,
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Form, formProps, children));
|
|
31
32
|
};
|
|
32
33
|
var FormikWrapper = function FormikWrapper(props) {
|
|
33
34
|
var initialValues = props.initialValues,
|
|
@@ -39,6 +40,7 @@ var FormikWrapper = function FormikWrapper(props) {
|
|
|
39
40
|
onReset = props.onReset,
|
|
40
41
|
children = props.children,
|
|
41
42
|
displayRequiredIndicator = props.displayRequiredIndicator,
|
|
43
|
+
formProps = props.formProps,
|
|
42
44
|
restProps = _objectWithoutProperties(props, _excluded2);
|
|
43
45
|
return /*#__PURE__*/React.createElement(Formik, _extends({
|
|
44
46
|
initialValues: initialValues || {},
|
|
@@ -50,7 +52,8 @@ var FormikWrapper = function FormikWrapper(props) {
|
|
|
50
52
|
onReset: onReset
|
|
51
53
|
}, restProps), function () {
|
|
52
54
|
return /*#__PURE__*/React.createElement(FormikExtendedContextProvider, {
|
|
53
|
-
displayRequiredIndicator: displayRequiredIndicator
|
|
55
|
+
displayRequiredIndicator: displayRequiredIndicator,
|
|
56
|
+
formProps: formProps
|
|
54
57
|
}, children);
|
|
55
58
|
});
|
|
56
59
|
};
|
|
@@ -41,6 +41,7 @@ var NavigationScroll = function NavigationScroll(props) {
|
|
|
41
41
|
return element.offsetHeight - deductHeight;
|
|
42
42
|
};
|
|
43
43
|
var handleScroll = function handleScroll() {
|
|
44
|
+
if (!node.current) return;
|
|
44
45
|
var scrollPos = getScrollPos(window);
|
|
45
46
|
var elementHeight = getElementHeight(node.current);
|
|
46
47
|
var newPos = 0;
|