@arquimedes.co/eureka-forms 2.0.28 → 2.0.30
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.
|
@@ -55,6 +55,7 @@ export interface FormSelector extends GSteps.GBaseStep {
|
|
|
55
55
|
options: FormSelectorOption[];
|
|
56
56
|
size: 1 | 2 | 3 | 4;
|
|
57
57
|
maxSize?: number;
|
|
58
|
+
defaultValue?: string;
|
|
58
59
|
}
|
|
59
60
|
export type FormSelectorOption = DefaultFormSelectorOption | NestedStepOption | AddSectionOption;
|
|
60
61
|
interface DefaultFormSelectorOption {
|
|
@@ -73,10 +73,13 @@ function StepperForm(_a) {
|
|
|
73
73
|
var handleErrors = handleSubmit(function () { }, function (errors) {
|
|
74
74
|
console.error('Errors:', errors);
|
|
75
75
|
});
|
|
76
|
-
var handlePrevious = useCallback(function () {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
var handlePrevious = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
77
|
+
return __generator(this, function (_a) {
|
|
78
|
+
dispatch(SiteReducer.handlePrevious(getValues()));
|
|
79
|
+
scrollToTop === null || scrollToTop === void 0 ? void 0 : scrollToTop();
|
|
80
|
+
return [2 /*return*/];
|
|
81
|
+
});
|
|
82
|
+
}); }, []);
|
|
80
83
|
var handleNext = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
81
84
|
var valid, state, values, response;
|
|
82
85
|
return __generator(this, function (_a) {
|
|
@@ -111,7 +111,7 @@ export var calcStepWidth = function (stepSize, size) {
|
|
|
111
111
|
return size.blockSize * stepSize + size.spacingSize * (stepSize - 1);
|
|
112
112
|
};
|
|
113
113
|
export var calcDefaultValue = function (step) {
|
|
114
|
-
var _a;
|
|
114
|
+
var _a, _b;
|
|
115
115
|
switch (step.type) {
|
|
116
116
|
case StepTypes.CHECKBOX:
|
|
117
117
|
return (_a = step.defaultValue) !== null && _a !== void 0 ? _a : false;
|
|
@@ -121,6 +121,9 @@ export var calcDefaultValue = function (step) {
|
|
|
121
121
|
description: step.description,
|
|
122
122
|
};
|
|
123
123
|
case StepTypes.SELECTOR:
|
|
124
|
+
if (step.defaultValue)
|
|
125
|
+
return ((_b = step.options.find(function (option) { return option.value === step.defaultValue; })) !== null && _b !== void 0 ? _b : '');
|
|
126
|
+
return '';
|
|
124
127
|
case StepTypes.TEXTINPUT:
|
|
125
128
|
case StepTypes.CLASSIFIER_SELECTOR:
|
|
126
129
|
return '';
|
|
@@ -75,20 +75,14 @@ function CustomBtn(_a) {
|
|
|
75
75
|
}, "data-testid": others['data-testid'], disabled: disabled || loading, onClick: function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
76
76
|
var rect;
|
|
77
77
|
return __generator(this, function (_a) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 200); })];
|
|
87
|
-
case 1:
|
|
88
|
-
_a.sent();
|
|
89
|
-
onClick && onClick(e);
|
|
90
|
-
return [2 /*return*/];
|
|
91
|
-
}
|
|
78
|
+
rect = e.target.getBoundingClientRect();
|
|
79
|
+
setCoords({
|
|
80
|
+
x: e.clientX - rect.left,
|
|
81
|
+
y: e.clientY - rect.top,
|
|
82
|
+
});
|
|
83
|
+
setTimeout(function () { return setCoords(undefined); }, 600);
|
|
84
|
+
onClick && onClick(e);
|
|
85
|
+
return [2 /*return*/];
|
|
92
86
|
});
|
|
93
87
|
}); } }, { children: [coords ? (_jsx("span", { className: styles.ripple, style: {
|
|
94
88
|
backgroundColor: color,
|
|
@@ -36,11 +36,15 @@
|
|
|
36
36
|
@keyframes ripple-effect {
|
|
37
37
|
0% {
|
|
38
38
|
transform: scale(1);
|
|
39
|
-
opacity:
|
|
39
|
+
opacity: 0.6;
|
|
40
40
|
}
|
|
41
41
|
50% {
|
|
42
42
|
transform: scale(10);
|
|
43
|
-
opacity: 0.
|
|
43
|
+
opacity: 0.1;
|
|
44
|
+
}
|
|
45
|
+
60% {
|
|
46
|
+
transform: scale(35);
|
|
47
|
+
opacity: 0;
|
|
44
48
|
}
|
|
45
49
|
100% {
|
|
46
50
|
transform: scale(35);
|