@ssplib/react-components 0.0.65 → 0.0.66
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.
|
@@ -83,8 +83,6 @@ function DatePicker(_a) {
|
|
|
83
83
|
},
|
|
84
84
|
shouldUnregister: true,
|
|
85
85
|
}), { fullWidth: true }))) }),
|
|
86
|
-
react_1.default.createElement(material_1.Typography, { sx: { color: '#a51c30', fontSize:
|
|
87
|
-
(_b = (0, lodash_get_1.default)(context.errors, name)) === null || _b === void 0 ? void 0 : _b.message,
|
|
88
|
-
"dsadsadsa")))));
|
|
86
|
+
react_1.default.createElement(material_1.Typography, { sx: { color: '#a51c30', fontSize: 14, paddingLeft: 1 } }, (_b = (0, lodash_get_1.default)(context.errors, name)) === null || _b === void 0 ? void 0 : _b.message)))));
|
|
89
87
|
}
|
|
90
88
|
exports.default = DatePicker;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import { FieldValues } from 'react-hook-form';
|
|
3
|
-
export declare function Stepper(props: {
|
|
3
|
+
export declare function Stepper({ debugLog, ...props }: {
|
|
4
4
|
children: ReactElement | ReactElement[];
|
|
5
5
|
debugData?: (data: FieldValues) => void;
|
|
6
|
+
debugLog?: boolean;
|
|
6
7
|
}): JSX.Element;
|
|
7
8
|
declare const _default: React.MemoExoticComponent<typeof Stepper>;
|
|
8
9
|
export default _default;
|
|
@@ -31,6 +31,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
35
|
+
var t = {};
|
|
36
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37
|
+
t[p] = s[p];
|
|
38
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
39
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
40
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
41
|
+
t[p[i]] = s[p[i]];
|
|
42
|
+
}
|
|
43
|
+
return t;
|
|
44
|
+
};
|
|
34
45
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
47
|
};
|
|
@@ -53,7 +64,8 @@ const getKeys = (values, id) => {
|
|
|
53
64
|
keys = [...keys, ...Object.keys(values.files).map((x) => `files.${x}`)];
|
|
54
65
|
return keys;
|
|
55
66
|
};
|
|
56
|
-
function Stepper(
|
|
67
|
+
function Stepper(_a) {
|
|
68
|
+
var { debugLog = false } = _a, props = __rest(_a, ["debugLog"]);
|
|
57
69
|
const length = Array.isArray(props.children) ? props.children.length : 1;
|
|
58
70
|
const context = (0, react_1.useContext)(form_1.FormContext);
|
|
59
71
|
const theme = (0, material_1.useTheme)();
|
|
@@ -65,6 +77,8 @@ function Stepper(props) {
|
|
|
65
77
|
});
|
|
66
78
|
const maxSteps = length;
|
|
67
79
|
const handleNext = () => __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
if (debugLog)
|
|
81
|
+
console.log(context.formGetValues());
|
|
68
82
|
const result = yield context.formTrigger(getKeys(context.formGetValues(), activeStep));
|
|
69
83
|
if (!result) {
|
|
70
84
|
setCanPass(true);
|