@arquimedes.co/eureka-forms 1.9.29-test → 1.9.31-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.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Form } from './@Types/Form';
3
- import { FormStep } from './@Types/FormStep';
4
3
  export interface AppProps {
5
4
  /** If the app is currently a widget */
6
5
  isWidget?: boolean;
@@ -38,7 +37,7 @@ export interface AppProps {
38
37
  export interface CustomStep {
39
38
  componentProps?: Record<string, any>;
40
39
  component: ReactNode;
41
- calcValue?: (step: FormStep, value: any) => any;
40
+ calcValue?: (step: any, value: any) => any;
42
41
  }
43
42
  declare function App({ apiKey, domain, preview, partial, formData, postview, editable, isWidget, internal, valuesData, customSend, customSteps, handleConfirmed, ...others }: AppProps): JSX.Element;
44
43
  export default App;
@@ -1,11 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { FormStep } from '../../../../../@Types/FormStep';
3
2
  import { MapperStepProps } from '../../MapperStep';
4
3
  import { MapperElement } from '../MaterialMapperStep';
5
- declare function MapperElementComponent({ step, form, index, level, element, formStyle, handleDelete, ...others }: MapperStepProps & {
4
+ declare function MapperElementComponent({ step, form, level, element, handleDelete, ...others }: MapperStepProps & {
6
5
  index: number;
7
6
  element: MapperElement;
8
7
  handleDelete: Function;
9
- steps: Record<string, FormStep>;
10
8
  }): JSX.Element;
11
9
  export default MapperElementComponent;
@@ -21,29 +21,17 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { createElement as _createElement } from "react";
24
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
- import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded';
26
- import styles from './MapperElement.module.css';
24
+ import { jsx as _jsx } from "react/jsx-runtime";
27
25
  import StepComponent from '../../../Step';
26
+ import PillElementContainer from './PillElementContainer/PillElementContainer';
28
27
  function MapperElementComponent(_a) {
29
- var step = _a.step, form = _a.form, index = _a.index, level = _a.level, element = _a.element, formStyle = _a.formStyle, handleDelete = _a.handleDelete, others = __rest(_a, ["step", "form", "index", "level", "element", "formStyle", "handleDelete"]);
28
+ var step = _a.step, form = _a.form, level = _a.level, element = _a.element, handleDelete = _a.handleDelete, others = __rest(_a, ["step", "form", "level", "element", "handleDelete"]);
30
29
  if (element.deleted) {
31
30
  return _jsx("div", {});
32
31
  }
33
- return (_jsx("div", __assign({ className: others.widthStats.isMobile || form.size.blockNum < 3
34
- ? styles.mobileContainer
35
- : styles.container }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
36
- width: (form.size.blockSize + form.size.spacingSize) *
37
- (form.size.blockNum - 1),
38
- } }, { children: [_jsxs("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: [step.unitLabel + ' ' + index + 1, ":"] })), _jsx("div", __assign({ className: !others.editable || others.postview
39
- ? styles.disabledDeleteBtn
40
- : styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
41
- if (others.editable && !others.postview) {
42
- handleDelete();
43
- }
44
- } }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })), step.rootSteps.map(function (idSubStep, index) {
45
- var subStep = form.steps[idSubStep];
46
- return (_createElement(StepComponent, __assign({}, others, { formStyle: formStyle, form: form, step: subStep, key: index, level: level + 1 })));
47
- })] })) })));
32
+ return (_jsx(PillElementContainer, __assign({ handleDelete: handleDelete }, others, { step: step, size: form.size }, { children: step.rootSteps.map(function (idSubStep, index) {
33
+ var subStep = form.steps[idSubStep];
34
+ return (_createElement(StepComponent, __assign({}, others, { form: form, step: subStep, key: index, level: level + 1 })));
35
+ }) })));
48
36
  }
49
37
  export default MapperElementComponent;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { MapperStepProps } from '../../../MapperStep';
3
+ import { Form } from '../../../../../../@Types';
4
+ import { Mapper } from '../../../../../../@Types/FormStep';
5
+ declare function PillElementContainer({ step, size, index, children, editable, postview, formStyle, handleDelete, widthStats, }: Pick<MapperStepProps, 'editable' | 'postview' | 'widthStats'> & {
6
+ step: Mapper;
7
+ index: number;
8
+ formStyle: {
9
+ textColor: string;
10
+ };
11
+ size: Form['size'];
12
+ handleDelete?: Function;
13
+ /** children to render */
14
+ children?: any;
15
+ }): JSX.Element;
16
+ export default PillElementContainer;
@@ -0,0 +1,30 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
+ import styles from './PillElementContainer.modules.css';
14
+ import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded';
15
+ function PillElementContainer(_a) {
16
+ var step = _a.step, size = _a.size, index = _a.index, children = _a.children, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, handleDelete = _a.handleDelete, widthStats = _a.widthStats;
17
+ return (_jsx("div", __assign({ className: widthStats.isMobile || size.blockNum < 3
18
+ ? styles.mobileContainer
19
+ : styles.container }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
20
+ width: (size.blockSize + size.spacingSize) *
21
+ (size.blockNum - 1),
22
+ } }, { children: [_jsxs("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: [step.unitLabel + ' ' + index + 1, ":"] })), _jsx("div", __assign({ className: !editable || postview
23
+ ? styles.disabledDeleteBtn
24
+ : styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
25
+ if (editable && !postview) {
26
+ handleDelete === null || handleDelete === void 0 ? void 0 : handleDelete();
27
+ }
28
+ } }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })), children && { children: children }] })) })));
29
+ }
30
+ export default PillElementContainer;
@@ -0,0 +1,60 @@
1
+ .container,
2
+ .mobileContainer {
3
+ background-color: #f0f0f0;
4
+ border: 1px solid #d6d6d6;
5
+ width: fit-content;
6
+ border-radius: 20px;
7
+ margin-bottom: 10px;
8
+ margin-top: 10px;
9
+ margin-left: auto;
10
+ margin-right: auto;
11
+ padding-top: 20px;
12
+ padding-bottom: 20px;
13
+ position: relative;
14
+ }
15
+ .container {
16
+ max-width: calc(100% - 112px);
17
+ padding-right: 55px;
18
+ padding-left: 55px;
19
+ }
20
+
21
+ .mobileContainer {
22
+ max-width: calc(100% - 42px);
23
+ padding-right: 20px;
24
+ padding-left: 20px;
25
+ }
26
+
27
+ .titleLbl {
28
+ width: 100%;
29
+ font-size: 20px;
30
+ font-weight: 600;
31
+ white-space: nowrap;
32
+ overflow: hidden;
33
+ text-overflow: ellipsis;
34
+ cursor: default;
35
+ margin-left: 10px;
36
+ margin-bottom: 10px;
37
+ }
38
+
39
+ .contentContainer {
40
+ margin-left: auto;
41
+ margin-right: auto;
42
+ display: flex;
43
+ flex-flow: row wrap;
44
+ height: fit-content;
45
+ max-width: 100%;
46
+ overflow-x: hidden;
47
+ overflow-y: hidden;
48
+ }
49
+
50
+ .deleteBtn,
51
+ .disabledDeleteBtn {
52
+ font-size: 24px;
53
+ position: absolute;
54
+ right: 15px;
55
+ top: 15px;
56
+ }
57
+
58
+ .deleteBtn {
59
+ cursor: pointer;
60
+ }
@@ -101,7 +101,7 @@ function Elements(_a) {
101
101
  margin: step.description
102
102
  ? '10px 0px'
103
103
  : '0px 0px 5px 0px',
104
- } }, { children: step.description }))), elements.map(function (incident, index) { return (_jsx(MapperElementComponent, __assign({ index: index, element: incident, formStyle: formStyle, step: step, form: form, steps: step.steps, editable: editable, postview: postview, dependencyStore: dependencyStore, setDependencyStore: setDependencyStore, handleDelete: function () {
104
+ } }, { children: step.description }))), elements.map(function (incident, index) { return (_jsx(MapperElementComponent, __assign({ index: index, element: incident, formStyle: formStyle, step: step, form: __assign(__assign({}, form), { steps: step.steps }), editable: editable, postview: postview, dependencyStore: dependencyStore, setDependencyStore: setDependencyStore, handleDelete: function () {
105
105
  var tempElements = __spreadArray([], elements, true);
106
106
  tempElements[index].deleted = true;
107
107
  onChange(tempElements);
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.29-test",
4
+ "version":"1.9.31-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",