@arquimedes.co/eureka-forms 1.9.116 → 1.9.118-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.
- package/dist/FormComponents/Step/MapperStep/MapperStep.d.ts +2 -3
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +1 -1
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +5 -5
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Mapper } from '../../../@Types/FormStep';
|
|
2
3
|
import { MapperElement } from './MaterialMapperStep/MaterialMapperStep';
|
|
3
4
|
import { StepProps } from '../Step';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
5
|
interface CustomMapperElementModifiers<Type> {
|
|
6
6
|
calcName?: (element: MapperElement<Type>) => string;
|
|
7
7
|
}
|
|
@@ -9,8 +9,7 @@ export interface MapperStepProps<Type> extends StepProps {
|
|
|
9
9
|
/** The MapperStep to display */
|
|
10
10
|
step: Mapper;
|
|
11
11
|
customAdd?: JSX.Element;
|
|
12
|
-
|
|
13
|
-
renderElementButtons?: (element: MapperElement<Type>, index: number) => JSX.Element;
|
|
12
|
+
customElementRender?: (element: MapperElement<Type>, index: number, renderElement: (renderElementButtons?: (element: MapperElement<any>) => JSX.Element) => JSX.Element) => JSX.Element;
|
|
14
13
|
customElementModifiers?: CustomMapperElementModifiers<Type>;
|
|
15
14
|
calcCustomStepProps?: (element: MapperElement<Type>, customStepProps: Record<string, any>) => Record<string, any>;
|
|
16
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MapperStepProps } from '../../../MapperStep';
|
|
3
3
|
import { MapperElementComponentProps } from '../MapperElement';
|
|
4
|
-
declare function PillMapperElement<Type = any>({ step, form, num, loading, element, children, editable, postview, formStyle, handleDelete, widthStats,
|
|
4
|
+
declare function PillMapperElement<Type = any>({ step, form, num, loading, element, children, editable, postview, formStyle, handleDelete, widthStats, customElementModifiers, customElementRender, }: MapperStepProps<Type> & MapperElementComponentProps<Type> & {
|
|
5
5
|
num: number;
|
|
6
6
|
formStyle: {
|
|
7
7
|
textColor: string;
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import styles from './PillMapperElement.module.css';
|
|
14
14
|
import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded';
|
|
15
15
|
function PillMapperElement(_a) {
|
|
16
|
-
var step = _a.step, form = _a.form, num = _a.num, loading = _a.loading, element = _a.element, children = _a.children, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, handleDelete = _a.handleDelete, widthStats = _a.widthStats,
|
|
16
|
+
var step = _a.step, form = _a.form, num = _a.num, loading = _a.loading, element = _a.element, children = _a.children, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, handleDelete = _a.handleDelete, widthStats = _a.widthStats, customElementModifiers = _a.customElementModifiers, customElementRender = _a.customElementRender;
|
|
17
17
|
var size = form.size;
|
|
18
18
|
var calcName = (customElementModifiers !== null && customElementModifiers !== void 0 ? customElementModifiers : {}).calcName;
|
|
19
19
|
var name = calcName
|
|
@@ -21,14 +21,14 @@ function PillMapperElement(_a) {
|
|
|
21
21
|
: step.unitLabel
|
|
22
22
|
? step.unitLabel + ' ' + (num + 1)
|
|
23
23
|
: '';
|
|
24
|
-
var renderElement = function () {
|
|
24
|
+
var renderElement = function (renderElementButtons) {
|
|
25
25
|
var _a, _b;
|
|
26
26
|
return (_jsx("div", __assign({ className: widthStats.isMobile
|
|
27
27
|
? styles.mobileContainer
|
|
28
28
|
: styles.container }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
|
|
29
29
|
width: (size.blockSize + size.spacingSize) *
|
|
30
30
|
((_b = (_a = step.style) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : size.blockNum - 1),
|
|
31
|
-
} }, { children: [name && (_jsx("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: loading ? 'Cargando...' : name + ':' }))), _jsxs("div", __assign({ className: styles.btnsContainer }, { children: [renderElementButtons === null || renderElementButtons === void 0 ? void 0 : renderElementButtons(element
|
|
31
|
+
} }, { children: [name && (_jsx("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: loading ? 'Cargando...' : name + ':' }))), _jsxs("div", __assign({ className: styles.btnsContainer }, { children: [renderElementButtons === null || renderElementButtons === void 0 ? void 0 : renderElementButtons(element), step.deletable !== false && (_jsx("div", __assign({ className: !editable || postview
|
|
32
32
|
? styles.disabledDeleteBtn
|
|
33
33
|
: styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
|
|
34
34
|
if (editable && !postview) {
|
|
@@ -36,8 +36,8 @@ function PillMapperElement(_a) {
|
|
|
36
36
|
}
|
|
37
37
|
} }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })))] })), children] })) })));
|
|
38
38
|
};
|
|
39
|
-
return (_jsx("div", __assign({ className: styles.containerContainer }, { children:
|
|
40
|
-
?
|
|
39
|
+
return (_jsx("div", __assign({ className: styles.containerContainer }, { children: customElementRender
|
|
40
|
+
? customElementRender(element, num, renderElement)
|
|
41
41
|
: renderElement() })));
|
|
42
42
|
}
|
|
43
43
|
export default PillMapperElement;
|
package/package.json
CHANGED