@arquimedes.co/eureka-forms 2.0.94 → 2.0.96
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/dist/FormSteps/MapperStep/MapperStep.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +20 -10
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +1 -1
- package/dist/Shared/Rating/Rating.d.ts +0 -1
- package/dist/Shared/Rating/Rating.stories.js +0 -6
- package/package.json +2 -2
|
@@ -4,6 +4,7 @@ import { StepProps } from '../Step';
|
|
|
4
4
|
import { MapperElement } from '../../@Types/MapperElement';
|
|
5
5
|
interface CustomMapperElementModifiers<Type> {
|
|
6
6
|
calcName?: (element: MapperElement<Type>) => string;
|
|
7
|
+
isDeleted?: (element: MapperElement<Type>) => boolean;
|
|
7
8
|
}
|
|
8
9
|
export interface MapperStepProps<Type> extends StepProps {
|
|
9
10
|
/** The MapperStep to display */
|
package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js
CHANGED
|
@@ -10,32 +10,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useContext } from 'react';
|
|
13
|
+
import { useContext, useMemo } from 'react';
|
|
14
14
|
import styles from './PillMapperElement.module.css';
|
|
15
15
|
import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded';
|
|
16
16
|
import FormContext from '../../../../../Contexts/FormContext';
|
|
17
17
|
import { useAppSelector } from '../../../../../hooks';
|
|
18
18
|
function PillMapperElement(_a) {
|
|
19
|
-
var _b;
|
|
19
|
+
var _b, _c, _d;
|
|
20
20
|
var step = _a.step, num = _a.num, loading = _a.loading, element = _a.element, children = _a.children, editable = _a.editable, handleDelete = _a.handleDelete, customElementModifiers = _a.customElementModifiers, customElementRender = _a.customElementRender;
|
|
21
21
|
var deletable = (_b = step.deletable) !== null && _b !== void 0 ? _b : true;
|
|
22
22
|
var size = useContext(FormContext).size;
|
|
23
|
-
var
|
|
23
|
+
var _e = useAppSelector(function (state) { return state.global; }), formStyle = _e.formStyle, postview = _e.postview;
|
|
24
24
|
var widthStats = useAppSelector(function (state) { return state.widthStats; });
|
|
25
25
|
var calcName = (customElementModifiers !== null && customElementModifiers !== void 0 ? customElementModifiers : {}).calcName;
|
|
26
|
-
var name =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
var name = useMemo(function () {
|
|
27
|
+
return calcName
|
|
28
|
+
? calcName(element)
|
|
29
|
+
: step.unitLabel
|
|
30
|
+
? step.unitLabel + ' ' + (num + 1)
|
|
31
|
+
: '';
|
|
32
|
+
}, [calcName, element, num, step.unitLabel]);
|
|
33
|
+
var isDeleted = (_d = (_c = customElementModifiers === null || customElementModifiers === void 0 ? void 0 : customElementModifiers.isDeleted) === null || _c === void 0 ? void 0 : _c.call(customElementModifiers, element)) !== null && _d !== void 0 ? _d : false;
|
|
31
34
|
var renderElement = function (renderElementButtons) {
|
|
32
35
|
var _a, _b;
|
|
33
36
|
return (_jsx("div", __assign({ className: widthStats.isMobile
|
|
34
37
|
? styles.mobileContainer
|
|
35
|
-
: styles.container
|
|
38
|
+
: styles.container, style: {
|
|
39
|
+
opacity: isDeleted ? 0.5 : 1,
|
|
40
|
+
} }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
|
|
36
41
|
width: (size.blockSize + size.spacingSize) *
|
|
37
42
|
((_b = (_a = step.style) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : size.blockNum - 1),
|
|
38
|
-
} }, { children: [name && (_jsx("div", __assign({ className: styles.titleLbl, style: {
|
|
43
|
+
} }, { children: [name && (_jsx("div", __assign({ className: styles.titleLbl, style: {
|
|
44
|
+
color: formStyle.textColor,
|
|
45
|
+
textDecoration: isDeleted
|
|
46
|
+
? 'line-through'
|
|
47
|
+
: 'none',
|
|
48
|
+
} }, { children: loading ? 'Cargando...' : name + ':' }))), _jsxs("div", __assign({ className: styles.btnsContainer }, { children: [renderElementButtons === null || renderElementButtons === void 0 ? void 0 : renderElementButtons(element), (deletable || !element.isOriginal) && (_jsx("div", __assign({ className: !editable || postview
|
|
39
49
|
? styles.disabledDeleteBtn
|
|
40
50
|
: styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
|
|
41
51
|
if (editable && !postview) {
|
|
@@ -50,7 +50,7 @@ function RatingStep(_a) {
|
|
|
50
50
|
};
|
|
51
51
|
return (_jsxs(React.Fragment, { children: [_jsxs("div", __assign({ className: styles.container, style: {
|
|
52
52
|
paddingBottom: step.description || step.required ? 0 : 15,
|
|
53
|
-
} }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label + (step.required ? ' *' : '') })), _jsx("div", __assign({ className: styles.ratingContainer }, { children: _jsx(Rating, {
|
|
53
|
+
} }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label + (step.required ? ' *' : '') })), _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: value, onChange: onChange, inputRef: ref }) })), (step.description || step.required) && (_jsx("div", __assign({ className: styles.stepDescriptionLabel, style: {
|
|
54
54
|
color: !!error && value === null
|
|
55
55
|
? (_d = formStyle.errorColor) !== null && _d !== void 0 ? _d : '#cc2936'
|
|
56
56
|
: (_e = formStyle.descriptionTextColor) !== null && _e !== void 0 ? _e : '#989898',
|
|
@@ -9,7 +9,6 @@ export default meta;
|
|
|
9
9
|
export var ScaleRating = {
|
|
10
10
|
args: {
|
|
11
11
|
type: RatingTypes.SCALE,
|
|
12
|
-
name: 'Rating',
|
|
13
12
|
focusColor: '#3d5a7f',
|
|
14
13
|
unSelectedColor: '#d8d8d8',
|
|
15
14
|
},
|
|
@@ -17,7 +16,6 @@ export var ScaleRating = {
|
|
|
17
16
|
export var ScaleRatingWidthValue = {
|
|
18
17
|
args: {
|
|
19
18
|
type: RatingTypes.SCALE,
|
|
20
|
-
name: 'Rating',
|
|
21
19
|
focusColor: '#3d5a7f',
|
|
22
20
|
unSelectedColor: '#d8d8d8',
|
|
23
21
|
value: 4,
|
|
@@ -26,7 +24,6 @@ export var ScaleRatingWidthValue = {
|
|
|
26
24
|
export var LikeRating = {
|
|
27
25
|
args: {
|
|
28
26
|
type: RatingTypes.LIKE,
|
|
29
|
-
name: 'Rating',
|
|
30
27
|
focusColor: '#3d5a7f',
|
|
31
28
|
unSelectedColor: '#d8d8d8',
|
|
32
29
|
},
|
|
@@ -34,7 +31,6 @@ export var LikeRating = {
|
|
|
34
31
|
export var LikeRatingWithValue = {
|
|
35
32
|
args: {
|
|
36
33
|
type: RatingTypes.LIKE,
|
|
37
|
-
name: 'Rating',
|
|
38
34
|
focusColor: '#3d5a7f',
|
|
39
35
|
unSelectedColor: '#d8d8d8',
|
|
40
36
|
value: 1,
|
|
@@ -43,7 +39,6 @@ export var LikeRatingWithValue = {
|
|
|
43
39
|
export var SatisfactionRating = {
|
|
44
40
|
args: {
|
|
45
41
|
type: RatingTypes.SATISFACTION,
|
|
46
|
-
name: 'Rating',
|
|
47
42
|
focusColor: '#3d5a7f',
|
|
48
43
|
unSelectedColor: '#d8d8d8',
|
|
49
44
|
},
|
|
@@ -51,7 +46,6 @@ export var SatisfactionRating = {
|
|
|
51
46
|
export var SatisfactionRatingWidthValue = {
|
|
52
47
|
args: {
|
|
53
48
|
type: RatingTypes.SATISFACTION,
|
|
54
|
-
name: 'Rating',
|
|
55
49
|
focusColor: '#3d5a7f',
|
|
56
50
|
unSelectedColor: '#d8d8d8',
|
|
57
51
|
value: 3,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arquimedes.co/eureka-forms",
|
|
3
3
|
"repository": "git://github.com/Arquimede5/Eureka-Forms.git",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.96",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "react-scripts start",
|
|
7
7
|
"build": "react-scripts build",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"\\.(scss|sass|css)$": "identity-obj-proxy"
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
-
"proxy": "https://api.forms.
|
|
123
|
+
"proxy": "https://api.forms.capta.co"
|
|
124
124
|
}
|