@arquimedes.co/eureka-forms 1.9.105 → 1.9.106-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/App.js CHANGED
@@ -353,7 +353,9 @@ var mapOriginalValues = function (originalValues, form) {
353
353
  }
354
354
  for (var _b = 0, _c = Object.values(form.steps); _b < _c.length; _b++) {
355
355
  var step = _c[_b];
356
- if (step.type !== StepTypes.MAPPER || newValues[step.id])
356
+ if (step.type !== StepTypes.MAPPER ||
357
+ newValues[step.id] ||
358
+ !step.required)
357
359
  continue;
358
360
  addInitialMapper(newValues, step);
359
361
  }
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { Mapper } from '../../../@Types/FormStep';
3
2
  import { MapperElement } from './MaterialMapperStep/MaterialMapperStep';
4
3
  import { StepProps } from '../Step';
4
+ import { ReactNode } from 'react';
5
5
  interface CustomMapperElementModifiers<Type> {
6
6
  calcName?: (element: MapperElement<Type>) => string;
7
7
  }
@@ -9,6 +9,8 @@ export interface MapperStepProps<Type> extends StepProps {
9
9
  /** The MapperStep to display */
10
10
  step: Mapper;
11
11
  customAdd?: JSX.Element;
12
+ renderElementWrapper?: (element: ReactNode) => JSX.Element;
13
+ renderElementButtons?: (element: MapperElement<Type>, index: number) => JSX.Element;
12
14
  customElementModifiers?: CustomMapperElementModifiers<Type>;
13
15
  calcCustomStepProps?: (element: MapperElement<Type>, customStepProps: Record<string, any>) => Record<string, any>;
14
16
  }
@@ -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, customElementModifiers, }: MapperStepProps<Type> & MapperElementComponentProps<Type> & {
4
+ declare function PillMapperElement<Type = any>({ step, form, num, loading, element, children, editable, postview, formStyle, handleDelete, widthStats, renderElementButtons, customElementModifiers, renderElementWrapper, }: MapperStepProps<Type> & MapperElementComponentProps<Type> & {
5
5
  num: number;
6
6
  formStyle: {
7
7
  textColor: string;
@@ -13,8 +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 _b, _c;
17
- 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;
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, renderElementButtons = _a.renderElementButtons, customElementModifiers = _a.customElementModifiers, renderElementWrapper = _a.renderElementWrapper;
18
17
  var size = form.size;
19
18
  var calcName = (customElementModifiers !== null && customElementModifiers !== void 0 ? customElementModifiers : {}).calcName;
20
19
  var name = calcName
@@ -22,15 +21,23 @@ function PillMapperElement(_a) {
22
21
  : step.unitLabel
23
22
  ? step.unitLabel + ' ' + (num + 1).toString()
24
23
  : '';
25
- return (_jsx("div", __assign({ className: widthStats.isMobile ? styles.mobileContainer : styles.container }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
26
- width: (size.blockSize + size.spacingSize) *
27
- ((_c = (_b = step.style) === null || _b === void 0 ? void 0 : _b.size) !== null && _c !== void 0 ? _c : size.blockNum - 1),
28
- } }, { children: [_jsx("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: loading ? '' : name })), step.deletable !== false && (_jsx("div", __assign({ className: !editable || postview
29
- ? styles.disabledDeleteBtn
30
- : styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
31
- if (editable && !postview) {
32
- handleDelete === null || handleDelete === void 0 ? void 0 : handleDelete();
33
- }
34
- } }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) }))), children] })) })));
24
+ var renderElement = function () {
25
+ var _a, _b;
26
+ return (_jsx("div", __assign({ className: widthStats.isMobile
27
+ ? styles.mobileContainer
28
+ : styles.container }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
29
+ width: (size.blockSize + size.spacingSize) *
30
+ ((_b = (_a = step.style) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : size.blockNum - 1),
31
+ } }, { children: [_jsx("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: loading ? '' : name })), _jsxs("div", __assign({ className: styles.btnsContainer }, { children: [renderElementButtons === null || renderElementButtons === void 0 ? void 0 : renderElementButtons(element, num), step.deletable !== false && (_jsx("div", __assign({ className: !editable || postview
32
+ ? styles.disabledDeleteBtn
33
+ : styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
34
+ if (editable && !postview) {
35
+ handleDelete === null || handleDelete === void 0 ? void 0 : handleDelete();
36
+ }
37
+ } }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })))] })), children] })) })));
38
+ };
39
+ return (_jsx("div", __assign({ className: styles.containerContainer }, { children: renderElementWrapper
40
+ ? renderElementWrapper(renderElement())
41
+ : renderElement() })));
35
42
  }
36
43
  export default PillMapperElement;
@@ -1,3 +1,7 @@
1
+ .containerContainer {
2
+ margin-top: 10px;
3
+ }
4
+
1
5
  .container,
2
6
  .mobileContainer {
3
7
  background-color: #f0f0f0;
@@ -5,13 +9,11 @@
5
9
  width: fit-content;
6
10
  border-radius: 20px;
7
11
  margin-bottom: 10px;
8
- margin-top: 10px;
9
12
  margin-left: auto;
10
13
  margin-right: auto;
11
- padding-top: 20px;
12
- padding-bottom: 20px;
13
14
  position: relative;
14
15
  }
16
+
15
17
  .container {
16
18
  max-width: calc(100% - 112px);
17
19
  padding-right: 55px;
@@ -45,16 +47,25 @@
45
47
  max-width: 100%;
46
48
  overflow-x: hidden;
47
49
  overflow-y: hidden;
50
+ padding-top: 20px;
51
+ padding-bottom: 20px;
48
52
  }
49
53
 
50
- .deleteBtn,
51
- .disabledDeleteBtn {
52
- font-size: 24px;
54
+ .btnsContainer {
53
55
  position: absolute;
54
56
  right: 15px;
55
57
  top: 15px;
58
+ display: flex;
59
+ flex-direction: row;
60
+ gap: 5px;
61
+ }
62
+
63
+ .deleteBtn,
64
+ .disabledDeleteBtn {
65
+ font-size: 24px;
56
66
  }
57
67
 
58
68
  .deleteBtn {
59
69
  cursor: pointer;
70
+ height: 24px;
60
71
  }
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": "1.9.105",
4
+ "version":"1.9.106-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",