@arquimedes.co/eureka-forms 1.6.3-test → 1.6.6-test
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.
|
@@ -18,14 +18,14 @@ function MaterialRatingStep(_a) {
|
|
|
18
18
|
var step = _a.step, errors = _a.errors, editable = _a.editable, control = _a.control, postview = _a.postview, formStyle = _a.formStyle, widthStats = _a.widthStats;
|
|
19
19
|
return (_jsxs("div", __assign({ className: styles.container, style: {
|
|
20
20
|
paddingBottom: step.description || step.required ? 0 : 15,
|
|
21
|
-
} }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label + (step.required ? ' *' : '') }), void 0), _jsx(Controller, { name: step.id, control: control, defaultValue:
|
|
21
|
+
} }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label + (step.required ? ' *' : '') }), void 0), _jsx(Controller, { name: step.id, control: control, defaultValue: null, rules: {
|
|
22
22
|
required: step.required
|
|
23
23
|
? 'Este campo es obligatorio'
|
|
24
24
|
: undefined,
|
|
25
25
|
}, shouldUnregister: true, render: function (_a) {
|
|
26
26
|
var _b, _c, _d, _e, _f;
|
|
27
27
|
var field = _a.field;
|
|
28
|
-
return (_jsxs(React.Fragment, { children: [_jsx("div", __assign({ className: styles.ratingContainer }, { children: _jsx(Rating, { type: step.ratingType, isMobile: widthStats.isMobile, focusColor: (_b = formStyle.primaryColor) !== null && _b !== void 0 ? _b : '#3d5a7f', unSelectedColor: (_c = formStyle.outlineColor) !== null && _c !== void 0 ? _c : '#b8b8b8', disabled: !editable || postview, value: field.value, onChange: field.onChange, inputRef: field.ref }, void 0) }), void 0), (step.description || step.required) && (_jsx("div", __assign({ className: styles.stepDescriptionLabel, style: {
|
|
28
|
+
return (_jsxs(React.Fragment, { children: [_jsx("div", __assign({ className: styles.ratingContainer }, { children: _jsx(Rating, { name: step.id, type: step.ratingType, isMobile: widthStats.isMobile, focusColor: (_b = formStyle.primaryColor) !== null && _b !== void 0 ? _b : '#3d5a7f', unSelectedColor: (_c = formStyle.outlineColor) !== null && _c !== void 0 ? _c : '#b8b8b8', disabled: !editable || postview, value: field.value, onChange: field.onChange, inputRef: field.ref }, void 0) }), void 0), (step.description || step.required) && (_jsx("div", __assign({ className: styles.stepDescriptionLabel, style: {
|
|
29
29
|
color: !!errors[step.id] &&
|
|
30
30
|
field.value === null
|
|
31
31
|
? (_d = formStyle.errorColor) !== null && _d !== void 0 ? _d : '#cc2936'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RatingProps } from '../Rating';
|
|
3
|
-
declare function ScaleRating({ value, inputRef, disabled, onChange, isMobile, focusColor, unSelectedColor, }: RatingProps): JSX.Element;
|
|
3
|
+
declare function ScaleRating({ value, name, inputRef, disabled, onChange, isMobile, focusColor, unSelectedColor, }: RatingProps): JSX.Element;
|
|
4
4
|
export default ScaleRating;
|
|
@@ -42,7 +42,7 @@ var useRatingStyles = function (props) {
|
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
function ScaleRating(_a) {
|
|
45
|
-
var value = _a.value, inputRef = _a.inputRef, disabled = _a.disabled, onChange = _a.onChange, isMobile = _a.isMobile, focusColor = _a.focusColor, unSelectedColor = _a.unSelectedColor;
|
|
45
|
+
var value = _a.value, name = _a.name, inputRef = _a.inputRef, disabled = _a.disabled, onChange = _a.onChange, isMobile = _a.isMobile, focusColor = _a.focusColor, unSelectedColor = _a.unSelectedColor;
|
|
46
46
|
var ratingClasses = useRatingStyles({
|
|
47
47
|
unSelectedColor: unSelectedColor,
|
|
48
48
|
focusColor: focusColor,
|
|
@@ -50,7 +50,7 @@ function ScaleRating(_a) {
|
|
|
50
50
|
return (_jsxs(React.Fragment, { children: [_jsx("input", { ref: inputRef, className: styles.hiddenInput }, void 0), _jsx(Rating, { value: value, onChange: function (_event, newValue) {
|
|
51
51
|
if (!disabled)
|
|
52
52
|
onChange(newValue);
|
|
53
|
-
}, disabled: disabled, classes: ratingClasses, name:
|
|
53
|
+
}, disabled: disabled, classes: ratingClasses, name: name, size: "large", defaultValue: 0, getLabelText: function (value) { return value + '/5'; }, max: 5, IconContainerComponent: isMobile ? SmallIconContainer : IconContainer }, void 0)] }, void 0));
|
|
54
54
|
}
|
|
55
55
|
function IconContainer(_a) {
|
|
56
56
|
var value = _a.value, other = __rest(_a, ["value"]);
|
package/package.json
CHANGED