@arquimedes.co/eureka-forms 1.3.0-test → 1.4.3-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.
Files changed (66) hide show
  1. package/dist/@Types/CBRFormStep.d.ts +72 -0
  2. package/dist/@Types/CBRFormStep.js +1 -0
  3. package/dist/@Types/Form.d.ts +4 -1
  4. package/dist/@Types/FormStep.d.ts +11 -46
  5. package/dist/@Types/GenericFormSteps.d.ts +58 -0
  6. package/dist/@Types/GenericFormSteps.js +1 -0
  7. package/dist/App.d.ts +3 -1
  8. package/dist/App.js +17 -6
  9. package/dist/App.module.css +1 -0
  10. package/dist/FormComponents/Form/ColumnForm/ColumnForm.d.ts +1 -1
  11. package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +98 -59
  12. package/dist/FormComponents/Form/Form.d.ts +5 -1
  13. package/dist/FormComponents/Form/Form.js +22 -10
  14. package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +2 -1
  15. package/dist/FormComponents/Section/Section.d.ts +4 -1
  16. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +9 -0
  17. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +25 -0
  18. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +8 -0
  19. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +48 -0
  20. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.module.css +60 -0
  21. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +11 -0
  22. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +112 -0
  23. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.module.css +34 -0
  24. package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.d.ts +9 -0
  25. package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +122 -0
  26. package/dist/FormComponents/Step/CBRStepMapper.d.ts +13 -0
  27. package/dist/FormComponents/Step/CBRStepMapper.js +243 -0
  28. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_INMUEBLE.json +13151 -0
  29. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_LOCATIVAS.json +71 -0
  30. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_PROYECTO.json +74 -0
  31. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_TIPO_DOC.json +50 -0
  32. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_TIPO_ESPACIO.json +320 -0
  33. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_TIPO_SOLICITANTE.json +42 -0
  34. package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +2 -2
  35. package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +12 -7
  36. package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +1 -1
  37. package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +7 -5
  38. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +4 -0
  39. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +145 -0
  40. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.module.css +9 -0
  41. package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.d.ts +22 -0
  42. package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +25 -0
  43. package/dist/FormComponents/Step/Step.js +10 -7
  44. package/dist/FormComponents/Step/StepFunctions.d.ts +3 -3
  45. package/dist/FormComponents/Step/StepFunctions.js +5 -5
  46. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +5 -2
  47. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.module.css +1 -2
  48. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -1
  49. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +3 -3
  50. package/dist/FormComponents/Step/TextInputStep/TextInputStep.d.ts +2 -0
  51. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +3 -1
  52. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.module.css +1 -8
  53. package/dist/constants/CBRFormStepTypes.d.ts +20 -0
  54. package/dist/constants/CBRFormStepTypes.js +21 -0
  55. package/dist/constants/FormStepTypes.d.ts +0 -6
  56. package/dist/constants/FormStepTypes.js +0 -7
  57. package/dist/shared/RoundedCheckBox/RoundedCheckBox.d.ts +1 -1
  58. package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +1 -1
  59. package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +1 -1
  60. package/dist/shared/RoundedSelect/RoundedSelect.d.ts +5 -1
  61. package/dist/shared/RoundedSelect/RoundedSelect.js +8 -2
  62. package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +63 -0
  63. package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +172 -0
  64. package/dist/shared/RoundedTextField/RoundedTextField.d.ts +2 -0
  65. package/dist/shared/RoundedTextField/RoundedTextField.js +7 -2
  66. package/package.json +2 -1
@@ -27,7 +27,8 @@ import styles from './MaterialSection.module.css';
27
27
  function MaterialSection(_a) {
28
28
  var section = _a.section, form = _a.form, others = __rest(_a, ["section", "form"]);
29
29
  return (_jsx("div", __assign({ className: styles.container, style: {
30
- width: (form.blockSize + form.spacingSize) * form.blockNum,
30
+ width: (form.size.blockSize + form.size.spacingSize) *
31
+ form.size.blockNum,
31
32
  } }, { children: section.steps.map(function (idStep, index) {
32
33
  var step = form.steps[idStep];
33
34
  if (step) {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Control, FieldValues, UseFormGetValues } from 'react-hook-form';
2
+ import { Control, FieldValues, UseFormGetValues, UseFormTrigger } from 'react-hook-form';
3
3
  import { Form, FormStyle, Section } from '../../@Types/Form';
4
4
  import { CustomStep } from '../../App';
5
5
  import { WidthStats } from '../Form/Form';
@@ -17,6 +17,9 @@ export interface RecursiveData {
17
17
  customSteps: Record<string, CustomStep>;
18
18
  /** Function to call on postview to fetch the download url of a file */
19
19
  fetchDownloadUrl?: (S3Key: string, fileName: string) => Promise<string>;
20
+ dependencyStore: Record<string, any>;
21
+ setDependencyStore: (values: Record<string, any>) => void;
22
+ trigger: UseFormTrigger<any>;
20
23
  }
21
24
  export interface SectionComponentProps extends RecursiveData {
22
25
  section: Section;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { CBRIncidentsStep as CBRIncidentsStepType } from '../../../../@Types/CBRFormStep';
3
+ import { StepProps } from '../../Step';
4
+ export interface CBRIncidentsStepProps extends Omit<StepProps, 'step'> {
5
+ /** The CBRIncidentsStep to display */
6
+ step: CBRIncidentsStepType;
7
+ }
8
+ declare function CBRIncidentsStep(props: CBRIncidentsStepProps): JSX.Element;
9
+ export default CBRIncidentsStep;
@@ -0,0 +1,25 @@
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 { jsx as _jsx } from "react/jsx-runtime";
13
+ import { FormStyleTypes } from '../../../../constants/FormStepTypes';
14
+ import MaterialCBRIncidentsStep from './MaterialCBRIncidentsStep/MaterialCBRIncidentsStep';
15
+ function CBRIncidentsStep(props) {
16
+ switch (props.formStyle.type) {
17
+ case FormStyleTypes.MATERIAL: {
18
+ return _jsx(MaterialCBRIncidentsStep, __assign({}, props), void 0);
19
+ }
20
+ default: {
21
+ return _jsx(MaterialCBRIncidentsStep, __assign({}, props), void 0);
22
+ }
23
+ }
24
+ }
25
+ export default CBRIncidentsStep;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { CBRIncidentsStepProps } from '../../CBRIncidentsStep';
3
+ import { Incident } from '../MaterialCBRIncidentsStep';
4
+ declare function IncidentComponent({ step, form, level, incident, formStyle, handleDelete, ...others }: CBRIncidentsStepProps & {
5
+ incident: Incident;
6
+ handleDelete: Function;
7
+ }): JSX.Element;
8
+ export default IncidentComponent;
@@ -0,0 +1,48 @@
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
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import styles from './Incident.module.css';
25
+ import StepComponent from '../../../../Step';
26
+ import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded';
27
+ function IncidentComponent(_a) {
28
+ var step = _a.step, form = _a.form, level = _a.level, incident = _a.incident, formStyle = _a.formStyle, handleDelete = _a.handleDelete, others = __rest(_a, ["step", "form", "level", "incident", "formStyle", "handleDelete"]);
29
+ var spaceStep = form.steps[incident.idSpaceStep];
30
+ var elementStep = form.steps[incident.idElementStep];
31
+ var commentStep = form.steps[incident.idCommentStep];
32
+ if (incident.deleted) {
33
+ return _jsx("div", {}, void 0);
34
+ }
35
+ return (_jsx("div", __assign({ className: others.widthStats.isMobile
36
+ ? styles.mobileContainer
37
+ : styles.container }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
38
+ width: (form.size.blockSize + form.size.spacingSize) *
39
+ (form.size.blockNum - 1),
40
+ } }, { children: [_jsxs("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: [step.unitLabel + ' ' + incident.num, ":"] }), void 0), _jsx("div", __assign({ className: others.postview
41
+ ? styles.disabledDeleteBtn
42
+ : styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
43
+ if (!others.postview) {
44
+ handleDelete();
45
+ }
46
+ } }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }, void 0) }), void 0), _jsx(StepComponent, __assign({}, others, { formStyle: formStyle, form: form, step: spaceStep, handleSizeChange: function () { }, level: level + 1 }), void 0), _jsx(StepComponent, __assign({}, others, { form: form, formStyle: formStyle, step: elementStep, handleSizeChange: function () { }, level: level + 1 }), void 0), _jsx(StepComponent, __assign({}, others, { form: form, formStyle: formStyle, step: commentStep, handleSizeChange: function () { }, level: level + 1 }), void 0)] }), void 0) }), void 0));
47
+ }
48
+ export default IncidentComponent;
@@ -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
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { CBRIncidentsStepProps } from '../CBRIncidentsStep';
3
+ export interface Incident {
4
+ idSpaceStep: string;
5
+ idElementStep: string;
6
+ idCommentStep: string;
7
+ deleted?: boolean;
8
+ num: number;
9
+ }
10
+ declare function CBRIncidentsStep(props: CBRIncidentsStepProps): JSX.Element;
11
+ export default CBRIncidentsStep;
@@ -0,0 +1,112 @@
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
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
24
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25
+ if (ar || !(i in from)) {
26
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
27
+ ar[i] = from[i];
28
+ }
29
+ }
30
+ return to.concat(ar || Array.prototype.slice.call(from));
31
+ };
32
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
33
+ /* eslint-disable no-console */
34
+ import { useState } from 'react';
35
+ import { Controller } from 'react-hook-form';
36
+ import CBRFormStepTypes from '../../../../../constants/CBRFormStepTypes';
37
+ import IncidentComponent from './Incident/Incident';
38
+ import styles from './MaterialCBRIncidentsStep.module.css';
39
+ import { nanoid } from 'nanoid';
40
+ import RoundedButton from '../../../../../shared/RoundedButton/RoundedButton';
41
+ function Incidents(_a) {
42
+ var step = _a.step, form = _a.form, btnRef = _a.btnRef, onChange = _a.onChange, incidents = _a.incidents, formStyle = _a.formStyle, postview = _a.postview, dependencyStore = _a.dependencyStore, setDependencyStore = _a.setDependencyStore, others = __rest(_a, ["step", "form", "btnRef", "onChange", "incidents", "formStyle", "postview", "dependencyStore", "setDependencyStore"]);
43
+ /** Form to pass down with aditional steps */
44
+ var _b = useState(__assign(__assign({}, form), { steps: __assign({}, form.steps) })), localForm = _b[0], setLocalForm = _b[1];
45
+ var handleAddIncident = function () {
46
+ var _a, _b;
47
+ var current = incidents.filter(function (incident) { return !incident.deleted; });
48
+ var newIncident = {
49
+ idSpaceStep: CBRFormStepTypes.CBR_TIPO_ESPACIO + '-' + nanoid(),
50
+ idCommentStep: CBRFormStepTypes.CBR_COMENTARIO + '-' + nanoid(),
51
+ idElementStep: CBRFormStepTypes.CBR_LOCATIVAS + '-' + nanoid(),
52
+ num: current.length + 1,
53
+ };
54
+ var newSteps = __assign({}, localForm.steps);
55
+ newSteps[newIncident.idSpaceStep] = __assign({ id: newIncident.idSpaceStep, type: CBRFormStepTypes.CBR_TIPO_ESPACIO, dependencies: step.dependencies }, step.spaceStep);
56
+ newSteps[newIncident.idCommentStep] = __assign({ id: newIncident.idCommentStep, type: CBRFormStepTypes.CBR_COMENTARIO }, step.commentStep);
57
+ var deps = __assign({}, dependencyStore);
58
+ addRecursiveElementStep(newIncident.idElementStep, step.elementStep, null, newSteps, deps, (_b = (_a = step.dependencies) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '');
59
+ onChange(__spreadArray(__spreadArray([], incidents, true), [newIncident], false));
60
+ setLocalForm(__assign(__assign({}, localForm), { steps: newSteps }));
61
+ setDependencyStore(deps);
62
+ };
63
+ var addRecursiveElementStep = function (idStep, step, idParent, steps, dependencyStore, idProjectDep) {
64
+ var _a, _b;
65
+ var idSubStep = CBRFormStepTypes.CBR_LOCATIVAS + '-' + nanoid();
66
+ var newSubStep = step.subStep ? __assign({}, step.subStep) : undefined;
67
+ var newStep = __assign(__assign({}, step), { id: idStep, type: CBRFormStepTypes.CBR_LOCATIVAS, parentStep: idParent, dependencies: [idProjectDep], subStep: null });
68
+ if (newSubStep) {
69
+ newStep.subStep = idSubStep;
70
+ }
71
+ if (idParent) {
72
+ dependencyStore[idParent] = null;
73
+ (_b = (_a = newStep.dependencies) === null || _a === void 0 ? void 0 : _a.push) === null || _b === void 0 ? void 0 : _b.call(_a, idParent);
74
+ }
75
+ steps[idStep] = newStep;
76
+ if (newSubStep) {
77
+ addRecursiveElementStep(idSubStep, newSubStep, idStep, steps, dependencyStore, idProjectDep);
78
+ }
79
+ };
80
+ return (_jsxs("div", __assign({ className: styles.container, style: { color: formStyle.textColor } }, { children: [_jsx("div", __assign({ className: styles.titleLbl }, { children: step.label }), void 0), step.description && (_jsx("p", __assign({ className: styles.descriptionPar, style: {
81
+ margin: step.description
82
+ ? '10px 0px'
83
+ : '0px 0px 5px 0px',
84
+ } }, { children: step.description }), void 0)), incidents.map(function (incident, index) { return (_jsx(IncidentComponent, __assign({ incident: incident, formStyle: formStyle, step: step, form: localForm, postview: postview, dependencyStore: dependencyStore, setDependencyStore: setDependencyStore, handleDelete: function () {
85
+ var tempIncidents = __spreadArray([], incidents, true);
86
+ tempIncidents[index].deleted = true;
87
+ var n = 1;
88
+ for (var _i = 0, tempIncidents_1 = tempIncidents; _i < tempIncidents_1.length; _i++) {
89
+ var inc = tempIncidents_1[_i];
90
+ if (!inc.deleted) {
91
+ inc.num = n;
92
+ n++;
93
+ }
94
+ }
95
+ onChange(tempIncidents);
96
+ } }, others), index)); }), _jsxs("div", __assign({ className: styles.btnContainer }, { children: [_jsx("input", { ref: btnRef, className: styles.hiddenInput }, void 0), _jsx(RoundedButton, { disabled: postview, text: step.addBtnLabel, color: formStyle.primaryContrastColor, backgroundColor: formStyle.primaryColor, fontSize: '1rem', padding: '5px 15px 5px 15px', onClick: function () {
97
+ if (!postview) {
98
+ handleAddIncident();
99
+ }
100
+ } }, void 0)] }), void 0)] }), void 0));
101
+ }
102
+ function CBRIncidentsStep(props) {
103
+ return (_jsx(Controller, { name: props.step.id, control: props.control, defaultValue: [], rules: {
104
+ required: props.step.required
105
+ ? 'Este campo es obligatorio'
106
+ : undefined,
107
+ }, shouldUnregister: true, render: function (_a) {
108
+ var field = _a.field;
109
+ return (_jsx(Incidents, __assign({}, props, { incidents: field.value, onChange: field.onChange, btnRef: field.ref }), void 0));
110
+ } }, void 0));
111
+ }
112
+ export default CBRIncidentsStep;
@@ -0,0 +1,34 @@
1
+ .container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: calc(100% - 20px);
5
+ max-width: calc(100% - 20px);
6
+ padding: 5px 10px;
7
+ }
8
+
9
+ .titleLbl {
10
+ font-size: 24px;
11
+ font-weight: 600;
12
+ white-space: nowrap;
13
+ overflow: hidden;
14
+ text-overflow: ellipsis;
15
+ cursor: default;
16
+ }
17
+
18
+ .descriptionPar {
19
+ font-size: 16px;
20
+ white-space: pre-wrap;
21
+ cursor: default;
22
+ }
23
+ .btnContainer {
24
+ margin-top: 15px;
25
+ margin-left: 15px;
26
+ margin-bottom: 3px;
27
+ width: fit-content;
28
+ }
29
+ .hiddenInput {
30
+ height: 0;
31
+ width: 0;
32
+ padding: 0;
33
+ border-width: 0;
34
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { SmartSelectStepProps } from '../../SmartSelectStep/SmartSelectStep';
3
+ import { StepProps } from '../../Step';
4
+ import { CBRElementStep } from '../../../../@Types/CBRFormStep';
5
+ declare function CBRLocativasStep(props: SmartSelectStepProps): JSX.Element;
6
+ export default CBRLocativasStep;
7
+ export interface LocativasSubStepRendererProps extends Omit<StepProps, 'step'> {
8
+ step: CBRElementStep;
9
+ }
@@ -0,0 +1,122 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
+ import SmartSelectStep from '../../SmartSelectStep/SmartSelectStep';
50
+ import LocativasData from '../../CBRStepValuesTemp/CBR_LOCATIVAS.json';
51
+ import CBRFormStepTypes from '../../../../constants/CBRFormStepTypes';
52
+ function CBRLocativasStep(props) {
53
+ return (_jsx(SmartSelectStep, __assign({}, props, { step: props.step, icon: _jsx(Leak, { fill: "#757575", style: {
54
+ display: 'flex',
55
+ height: 23,
56
+ width: 23,
57
+ marginTop: 2,
58
+ } }, void 0), getOptions: getLocativasOptions, getOptionSelected: function (option, value) {
59
+ return option.id === value.id;
60
+ }, iconComponent: LeakIconComponent }, { children: _jsx(LocativasSubStepRenderer, {}, void 0) }), void 0));
61
+ }
62
+ export default CBRLocativasStep;
63
+ function LocativasSubStepRenderer(_a) {
64
+ var _b;
65
+ var value = _a.value, stepProps = _a.stepProps;
66
+ if (!value || stepProps == undefined) {
67
+ return _jsx("div", {}, void 0);
68
+ }
69
+ var subStep = stepProps === null || stepProps === void 0 ? void 0 : stepProps.form.steps[(_b = stepProps.step.subStep) !== null && _b !== void 0 ? _b : ''];
70
+ if ((subStep === null || subStep === void 0 ? void 0 : subStep.type) !== CBRFormStepTypes.CBR_LOCATIVAS) {
71
+ return _jsx("div", {}, void 0);
72
+ }
73
+ return (_jsx(SmartSelectStep, __assign({}, stepProps, { step: subStep, level: stepProps.level + 1, icon: _jsx(Leak, { fill: "#757575", style: {
74
+ display: 'flex',
75
+ height: 23,
76
+ width: 23,
77
+ marginTop: 2,
78
+ } }, void 0), getOptions: getLocativasOptions, getOptionSelected: function (option, value) {
79
+ return option.id === value.id;
80
+ }, iconComponent: LeakIconComponent }, { children: _jsx(LocativasSubStepRenderer, {}, void 0) }), void 0));
81
+ }
82
+ function LeakIconComponent(props) {
83
+ return (_jsx(Leak, { className: props.className, fill: "#757575", style: {
84
+ display: 'flex',
85
+ height: 23,
86
+ width: 23,
87
+ marginTop: 2,
88
+ } }, void 0));
89
+ }
90
+ var getLocativasOptions = function (step, dependencyStore) { return __awaiter(void 0, void 0, void 0, function () {
91
+ var idProyecto, response, father_1, locativasList;
92
+ var _a, _b;
93
+ return __generator(this, function (_c) {
94
+ if (step.dependencies) {
95
+ idProyecto = (_a = dependencyStore[step.dependencies[0]]) === null || _a === void 0 ? void 0 : _a.id;
96
+ if (!idProyecto) {
97
+ return [2 /*return*/, null]; //null para indicar que falta la depedency
98
+ }
99
+ response = LocativasData;
100
+ father_1 = (_b = dependencyStore[step.dependencies[1]]) === null || _b === void 0 ? void 0 : _b.id;
101
+ locativasList = response.lstLocativas.TipoLocativas.filter(function (locativa) {
102
+ if (father_1) {
103
+ return (locativa.Id.startsWith(father_1) && locativa.Id !== father_1);
104
+ }
105
+ else {
106
+ return locativa.Id.length === 2;
107
+ }
108
+ });
109
+ return [2 /*return*/, locativasList.map(function (option) {
110
+ return {
111
+ label: option.Descripcion,
112
+ id: option.Id,
113
+ };
114
+ })];
115
+ }
116
+ else {
117
+ return [2 /*return*/, null];
118
+ }
119
+ return [2 /*return*/];
120
+ });
121
+ }); };
122
+ var Leak = function (props) { return (_jsxs("svg", __assign({ fill: props.fill, className: props.class, style: props.style, height: "512pt", viewBox: "0 -86 512.00056 512", width: "512pt", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "m203.484375 196.359375c2.402344 0 4.753906-.867187 6.601563-2.492187l26.621093-23.394532c3.03125-2.664062 4.164063-6.890625 2.871094-10.714844l-9.21875-27.257812 21.613281-18.996094c3.03125-2.664062 4.164063-6.890625 2.871094-10.714844l-11.359375-33.570312c-1.070313-3.167969-3.652344-5.589844-6.882813-6.457031l-57.925781-15.519531c-5.335937-1.433594-10.816406 1.734374-12.246093 7.070312-1.429688 5.335938 1.734374 10.820312 7.070312 12.25l52.753906 14.132812 7.507813 22.1875-21.613281 18.996094c-3.03125 2.664063-4.164063 6.890625-2.871094 10.714844l9.21875 27.257812-17.59375 15.460938-130.027344-34.839844 30.992188-115.667968c.6875-2.5625.328124-5.292969-.996094-7.589844-1.328125-2.296875-3.511719-3.972656-6.074219-4.660156l-45.574219-12.210938c-5.332031-1.429688-10.816406 1.734375-12.246094 7.070312l-36.636718 136.722657c-.6875 2.5625-.324219 5.292969 1 7.589843 1.324218 2.292969 3.511718 3.972657 6.070312 4.65625l45.574219 12.210938c.867187.234375 1.738281.34375 2.597656.34375 4.414063 0 8.453125-2.945312 9.652344-7.414062l.464844-1.734376 135.199219 36.226563c.851562.230469 1.722656.34375 2.585937.34375zm-181.238281-56.703125 31.460937-117.40625 26.253907 7.035156-31.457032 117.40625zm0 0" }, void 0), _jsx("path", { d: "m511.660156 144.136719-36.636718-136.722657c-1.429688-5.332031-6.910157-8.5-12.246094-7.070312l-45.574219 12.210938c-2.5625.6875-4.746094 2.363281-6.070313 4.660156-1.328124 2.296875-1.6875 5.023437-1 7.585937l.464844 1.734375-135.199218 36.226563c-3.28125.878906-5.894532 3.367187-6.933594 6.605469-1.039063 3.238281-.363282 6.777343 1.796875 9.40625l19.121093 23.265624-5.867187 25.070313c-.796875 3.40625.242187 6.980469 2.738281 9.425781l19.386719 18.988282-6.847656 28.496093c-.824219 3.429688.21875 7.039063 2.742187 9.5 1.894532 1.84375 4.40625 2.839844 6.980469 2.839844.863281 0 1.730469-.113281 2.585937-.34375l57.925782-15.519531c5.335937-1.429688 8.5-6.914063 7.070312-12.25-1.429687-5.332032-6.914062-8.5-12.246094-7.070313l-41.683593 11.171875 4.246093-17.664062c.820313-3.421875-.214843-7.023438-2.726562-9.484375l-19.417969-19.015625 5.714844-24.398438c.710937-3.035156-.035156-6.222656-2.011719-8.628906l-12.40625-15.09375 120.207032-32.207031 30.992187 115.667969c1.199219 4.46875 5.238281 7.414062 9.65625 7.414062.855469 0 1.726563-.109375 2.59375-.339844l45.574219-12.210937c2.5625-.6875 4.746094-2.363281 6.070312-4.660157 1.328125-2.296874 1.6875-5.027343 1-7.589843zm-48.160156 2.554687-30.996094-115.667968s0 0 0-.003907v-.003906l-.464844-1.730469 26.257813-7.035156 31.457031 117.40625zm0 0" }, void 0), _jsx("path", { d: "m263.386719 203.265625c-1.894531-2.078125-4.574219-3.261719-7.386719-3.261719-2.808594 0-5.492188 1.183594-7.386719 3.261719-.78125.855469-1.640625 1.789063-2.570312 2.792969-14.488281 15.730468-44.640625 48.457031-44.640625 79.34375 0 30.105468 24.492187 54.601562 54.597656 54.601562s54.597656-24.496094 54.597656-54.601562c0-30.886719-30.148437-63.613282-44.640625-79.339844-.925781-1.007812-1.789062-1.941406-2.570312-2.796875zm-7.386719 116.738281c-19.078125 0-34.597656-15.523437-34.597656-34.601562 0-20.492188 20.960937-45.539063 34.597656-60.601563 13.636719 15.0625 34.597656 40.109375 34.597656 60.601563 0 19.078125-15.519531 34.601562-34.597656 34.601562zm0 0" }, void 0), _jsx("path", { d: "m129.878906 54.871094c.917969.261718 1.839844.386718 2.75.386718 4.351563 0 8.355469-2.863281 9.609375-7.253906 1.519531-5.3125-1.554687-10.847656-6.867187-12.363281h-.007813c-5.308593-1.519531-10.839843 1.554687-12.359375 6.867187-1.515625 5.308594 1.5625 10.847657 6.875 12.363282zm0 0" }, void 0), _jsx("path", { d: "m407.335938 149.527344-.007813.003906c-5.335937 1.421875-8.507813 6.898438-7.082031 12.238281 1.191406 4.472657 5.238281 7.421875 9.65625 7.421875.855468 0 1.722656-.109375 2.585937-.339844 5.335938-1.421874 8.507813-6.902343 7.085938-12.238281-1.425781-5.335937-6.90625-8.511719-12.238281-7.085937zm0 0" }, void 0)] }), void 0)); };
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { CBRFormStep } from '../../@Types/CBRFormStep';
3
+ import { StepProps } from './Step';
4
+ interface CBRStepProps extends Omit<StepProps, 'step'> {
5
+ step: CBRFormStep;
6
+ }
7
+ export interface StepOptions {
8
+ id: string | number;
9
+ label: string;
10
+ idMacroProyecto?: number;
11
+ }
12
+ declare function CBRStepMapper(props: CBRStepProps): JSX.Element;
13
+ export default CBRStepMapper;