@arquimedes.co/eureka-forms 1.9.4-test → 1.9.5-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/@Types/AYFFormStep.d.ts +9 -0
- package/dist/@Types/AYFFormStep.js +1 -0
- package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +2 -10
- package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +1 -8
- package/dist/FormComponents/Step/AYFStepMapper.d.ts +12 -0
- package/dist/FormComponents/Step/AYFStepMapper.js +100 -0
- package/dist/FormComponents/Step/CBRStepMapper.js +8 -20
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +1 -1
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +2 -2
- package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +3 -3
- package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.d.ts +0 -2
- package/dist/FormComponents/Step/Step.js +4 -0
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -1
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +2 -2
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.d.ts +2 -0
- package/dist/constants/AYFFormStepTypes.d.ts +9 -0
- package/dist/constants/AYFFormStepTypes.js +10 -0
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.d.ts +2 -0
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +18 -4
- package/dist/shared/RoundedSelect/RoundedSelect.d.ts +9 -3
- package/dist/shared/RoundedSelect/RoundedSelect.js +18 -10
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +5 -5
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +38 -7
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import AYFFormStepTypes from '../constants/AYFFormStepTypes';
|
|
2
|
+
import { GSmartSelect, GTextInput } from './GenericFormSteps';
|
|
3
|
+
export declare type AYFFormStep = AYFListStep | AYFBillNumStep;
|
|
4
|
+
export interface AYFListStep extends Omit<GSmartSelect, 'searchable'> {
|
|
5
|
+
type: AYFFormStepTypes.AYF_START_MONTH | AYFFormStepTypes.AYF_END_MONTH | AYFFormStepTypes.AYF_YEAR | AYFFormStepTypes.AYF_START_YEAR | AYFFormStepTypes.AYF_END_YEAR;
|
|
6
|
+
}
|
|
7
|
+
export interface AYFBillNumStep extends GTextInput {
|
|
8
|
+
type: AYFFormStepTypes.AYF_BILL_NUM;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -64,7 +64,7 @@ function CBRLocativasStep(props) {
|
|
|
64
64
|
else {
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
|
-
}
|
|
67
|
+
} }, { children: _jsx(LocativasSubStepRenderer, {}, void 0) }), void 0));
|
|
68
68
|
}
|
|
69
69
|
export default CBRLocativasStep;
|
|
70
70
|
function LocativasSubStepRenderer(_a) {
|
|
@@ -84,15 +84,7 @@ function LocativasSubStepRenderer(_a) {
|
|
|
84
84
|
marginTop: 2,
|
|
85
85
|
} }, void 0), calcInvalidDeps: calcInvalidDependencies, getOptions: getLocativasOptions, calcDepError: calcDepError, getOptionSelected: function (option, value) {
|
|
86
86
|
return option.id === value.id;
|
|
87
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }
|
|
88
|
-
}
|
|
89
|
-
function LeakIconComponent(props) {
|
|
90
|
-
return (_jsx(Leak, { className: props.className, fill: "#757575", style: {
|
|
91
|
-
display: 'flex',
|
|
92
|
-
height: 23,
|
|
93
|
-
width: 23,
|
|
94
|
-
marginTop: 2,
|
|
95
|
-
} }, void 0));
|
|
87
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }, { children: _jsx(LocativasSubStepRenderer, {}, void 0) }), void 0));
|
|
96
88
|
}
|
|
97
89
|
var getLocativasOptions = function (idOrganization, step, dependencyStore) { return __awaiter(void 0, void 0, void 0, function () {
|
|
98
90
|
var idProyecto, response, father_1;
|
|
@@ -117,7 +117,7 @@ function CBRPropertyStepComponent(props) {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
: undefined,
|
|
120
|
+
: undefined, getOptions: getInmueblesOptions }), void 0), showWarning !== undefined && (_jsx(Dialog, __assign({ PaperProps: {
|
|
121
121
|
style: {
|
|
122
122
|
borderRadius: '20px',
|
|
123
123
|
maxWidth: '100vw',
|
|
@@ -130,11 +130,4 @@ function CBRPropertyStepComponent(props) {
|
|
|
130
130
|
} }, void 0) }), void 0)] }), void 0)] }), void 0) }), void 0))] }, void 0));
|
|
131
131
|
}
|
|
132
132
|
export default CBRPropertyStepComponent;
|
|
133
|
-
function PropertyIconComponent(props) {
|
|
134
|
-
return (_jsx(PropertyIcon, { className: props.className, fill: "#757575", style: {
|
|
135
|
-
display: 'flex',
|
|
136
|
-
height: 23,
|
|
137
|
-
width: 23,
|
|
138
|
-
} }, void 0));
|
|
139
|
-
}
|
|
140
133
|
var PropertyIcon = function (props) { return (_jsx("svg", __assign({ fill: props.fill, className: props.class, style: props.style, height: "512", viewBox: "0 0 512 512", width: "512", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("g", __assign({ id: "_01-home", "data-name": "01-home" }, { children: _jsxs("g", __assign({ id: "glyph" }, { children: [_jsx("path", { d: "m256 4c-108.075 0-196 87.925-196 196 0 52.5 31.807 119.92 94.537 200.378a1065.816 1065.816 0 0 0 93.169 104.294 12 12 0 0 0 16.588 0 1065.816 1065.816 0 0 0 93.169-104.294c62.73-80.458 94.537-147.878 94.537-200.378 0-108.075-87.925-196-196-196zm0 336c-77.2 0-140-62.8-140-140s62.8-140 140-140 140 62.8 140 140-62.8 140-140 140z" }, void 0), _jsx("path", { d: "m352.072 183.121-88-80a12 12 0 0 0 -16.144 0l-88 80a12.006 12.006 0 0 0 -2.23 15.039 12.331 12.331 0 0 0 10.66 5.84h11.642v76a12 12 0 0 0 12 12h28a12 12 0 0 0 12-12v-44a12 12 0 0 1 12-12h24a12 12 0 0 1 12 12v44a12 12 0 0 0 12 12h28a12 12 0 0 0 12-12v-76h11.642a12.331 12.331 0 0 0 10.66-5.84 12.006 12.006 0 0 0 -2.23-15.039z" }, void 0)] }), void 0) }), void 0) }), void 0)); };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AYFFormStep } from '../../@Types/AYFFormStep';
|
|
3
|
+
import { StepProps } from './Step';
|
|
4
|
+
interface AYFStepProps extends Omit<StepProps, 'step'> {
|
|
5
|
+
step: AYFFormStep;
|
|
6
|
+
}
|
|
7
|
+
export interface StepOptions {
|
|
8
|
+
id: string | number;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
declare function AYFStepMapper(props: AYFStepProps): JSX.Element;
|
|
12
|
+
export default AYFStepMapper;
|
|
@@ -0,0 +1,100 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
49
|
+
import AYFFormStepTypes from '../../constants/AYFFormStepTypes';
|
|
50
|
+
import TextInputStep from './TextInputStep/TextInputStep';
|
|
51
|
+
import SmartSelectStep from './SmartSelectStep/SmartSelectStep';
|
|
52
|
+
import CalendarTodayRoundedIcon from '@material-ui/icons/CalendarTodayRounded';
|
|
53
|
+
import DescriptionIcon from '@material-ui/icons/Description';
|
|
54
|
+
function AYFStepMapper(props) {
|
|
55
|
+
var _this = this;
|
|
56
|
+
var getMonths = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
return [2 /*return*/, [
|
|
59
|
+
{ id: '1', label: 'Enero' },
|
|
60
|
+
{ id: '2', label: 'Febrero' },
|
|
61
|
+
{ id: '3', label: 'Marzo' },
|
|
62
|
+
{ id: '4', label: 'Abril' },
|
|
63
|
+
{ id: '5', label: 'Mayo' },
|
|
64
|
+
{ id: '6', label: 'Junio' },
|
|
65
|
+
{ id: '7', label: 'Julio' },
|
|
66
|
+
{ id: '8', label: 'Agosto' },
|
|
67
|
+
{ id: '9', label: 'Septiembre' },
|
|
68
|
+
{ id: '10', label: 'Octubre' },
|
|
69
|
+
{ id: '11', label: 'Noviembre ' },
|
|
70
|
+
{ id: '12', label: 'Diciembre' },
|
|
71
|
+
]];
|
|
72
|
+
});
|
|
73
|
+
}); };
|
|
74
|
+
switch (props.step.type) {
|
|
75
|
+
case AYFFormStepTypes.AYF_START_MONTH:
|
|
76
|
+
case AYFFormStepTypes.AYF_END_MONTH:
|
|
77
|
+
return (_jsx(SmartSelectStep, __assign({}, props, { step: props.step, getOptions: getMonths, getOptionSelected: function (option, value) {
|
|
78
|
+
return option.id === value.id;
|
|
79
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }, icon: _jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
80
|
+
color: '#757575',
|
|
81
|
+
fontSize: 20,
|
|
82
|
+
marginRight: 4,
|
|
83
|
+
marginTop: 2,
|
|
84
|
+
} }, void 0) }), void 0));
|
|
85
|
+
case AYFFormStepTypes.AYF_YEAR:
|
|
86
|
+
case AYFFormStepTypes.AYF_START_YEAR:
|
|
87
|
+
case AYFFormStepTypes.AYF_END_YEAR:
|
|
88
|
+
return (_jsx(TextInputStep, __assign({}, props, { step: props.step, defaultValue: new Date().getFullYear().toString(), icon: _jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
89
|
+
color: '#757575',
|
|
90
|
+
fontSize: 20,
|
|
91
|
+
marginRight: 4,
|
|
92
|
+
marginTop: 2,
|
|
93
|
+
} }, void 0) }), void 0));
|
|
94
|
+
case AYFFormStepTypes.AYF_BILL_NUM:
|
|
95
|
+
return (_jsx(TextInputStep, __assign({}, props, { step: props.step, icon: _jsx(DescriptionIcon, { style: { color: '#757575', fontSize: 23 } }, void 0) }), void 0));
|
|
96
|
+
default:
|
|
97
|
+
return _jsx("div", {}, void 0);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export default AYFStepMapper;
|
|
@@ -138,9 +138,9 @@ function CBRStepMapper(props) {
|
|
|
138
138
|
case CBRFormStepTypes.CBR_MACRO_PROYECTO:
|
|
139
139
|
return (_jsx(SmartSelectStep, __assign({}, props, { step: props.step, icon: _jsx(ProjectIcon, { fill: "#757575", style: {
|
|
140
140
|
display: 'flex',
|
|
141
|
-
height:
|
|
142
|
-
width:
|
|
143
|
-
} }, void 0),
|
|
141
|
+
height: 23,
|
|
142
|
+
width: 23,
|
|
143
|
+
} }, void 0), getOptions: getMacroProyectoOptions, getOptionSelected: function (option, value) {
|
|
144
144
|
return option.id === value.id;
|
|
145
145
|
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }), void 0));
|
|
146
146
|
case CBRFormStepTypes.CBR_PROYECTO:
|
|
@@ -148,7 +148,7 @@ function CBRStepMapper(props) {
|
|
|
148
148
|
display: 'flex',
|
|
149
149
|
height: 24,
|
|
150
150
|
width: 24,
|
|
151
|
-
} }, void 0),
|
|
151
|
+
} }, void 0), getOptions: getProyectoOptions, getOptionSelected: function (option, value) {
|
|
152
152
|
return option.id === value.id;
|
|
153
153
|
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }), void 0));
|
|
154
154
|
case CBRFormStepTypes.CBR_INMUEBLE:
|
|
@@ -158,7 +158,9 @@ function CBRStepMapper(props) {
|
|
|
158
158
|
display: 'flex',
|
|
159
159
|
height: 23,
|
|
160
160
|
width: 23,
|
|
161
|
-
|
|
161
|
+
marginRight: 3,
|
|
162
|
+
marginTop: 1,
|
|
163
|
+
} }, void 0), getOptions: getTipoSolicitanteOptions, getOptionSelected: function (option, value) {
|
|
162
164
|
return option.id === value.id;
|
|
163
165
|
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }), void 0));
|
|
164
166
|
case CBRFormStepTypes.CBR_TIPO_ESPACIO:
|
|
@@ -166,7 +168,7 @@ function CBRStepMapper(props) {
|
|
|
166
168
|
display: 'flex',
|
|
167
169
|
height: 23,
|
|
168
170
|
width: 23,
|
|
169
|
-
} }, void 0),
|
|
171
|
+
} }, void 0), getOptions: getTipoEspaciosOptions, calcDepError: function (types) {
|
|
170
172
|
for (var _i = 0, _a = types; _i < _a.length; _i++) {
|
|
171
173
|
var type = _a[_i];
|
|
172
174
|
if (type === CBRFormStepTypes.CBR_PROYECTO) {
|
|
@@ -188,13 +190,6 @@ function CBRStepMapper(props) {
|
|
|
188
190
|
}
|
|
189
191
|
}
|
|
190
192
|
export default CBRStepMapper;
|
|
191
|
-
function ProjectIconComponent(props) {
|
|
192
|
-
return (_jsx(ProjectIcon, { className: props.className, fill: "#757575", style: {
|
|
193
|
-
display: 'flex',
|
|
194
|
-
height: 23,
|
|
195
|
-
width: 23,
|
|
196
|
-
} }, void 0));
|
|
197
|
-
}
|
|
198
193
|
function DocumentIconComponent(props) {
|
|
199
194
|
return (_jsx("div", __assign({ style: {
|
|
200
195
|
marginRight: 2,
|
|
@@ -204,13 +199,6 @@ function DocumentIconComponent(props) {
|
|
|
204
199
|
width: 23,
|
|
205
200
|
} }, void 0) }), void 0));
|
|
206
201
|
}
|
|
207
|
-
function SpaceTypeIconComponent(props) {
|
|
208
|
-
return (_jsx(SpaceTypeIcon, { className: props.className, fill: "#757575", style: {
|
|
209
|
-
display: 'flex',
|
|
210
|
-
height: 23,
|
|
211
|
-
width: 23,
|
|
212
|
-
} }, void 0));
|
|
213
|
-
}
|
|
214
202
|
var SpaceTypeIcon = function (props) { return (_jsxs("svg", __assign({ fill: props.fill, className: props.class, style: props.style, width: "512pt", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64" }, { children: [_jsx("title", { children: "SpaceType" }, void 0), _jsxs("g", __assign({ id: "space_type", "data-name": "space type" }, { children: [_jsx("path", { d: "M29.74,39A10.21,10.21,0,0,0,27.61,39,1.63,1.63,0,0,0,26,40.61V53.35A1.63,1.63,0,0,0,27.61,55h1.74A1.63,1.63,0,0,0,31,53.35V40.61A1.63,1.63,0,0,0,29.74,39Z" }, void 0), _jsx("path", { d: "M57.35,39a10.27,10.27,0,0,0-2.13.05A1.63,1.63,0,0,0,54,40.61V53.35A1.63,1.63,0,0,0,55.61,55h1.74A1.63,1.63,0,0,0,59,53.35V40.61A1.63,1.63,0,0,0,57.35,39Z" }, void 0), _jsx("path", { d: "M33,54a1,1,0,0,0,1,1H51a1,1,0,0,0,1-1V49H33Z" }, void 0), _jsx("path", { d: "M49,42H36a3,3,0,0,0-3,3v2H52V45A3,3,0,0,0,49,42Z" }, void 0), _jsx("path", { d: "M54,31a5,5,0,0,0-5-5H36a5,5,0,0,0-5,5v6.39a3.62,3.62,0,0,1,1.86,2.24A4.68,4.68,0,0,1,33,41c1.37-1.37,4.2-1,16-1a5,5,0,0,1,2.68.78c.64.39.07.39.46-1.15a3.65,3.65,0,0,1,1.43-2C54.15,37.19,54,38.41,54,31Z" }, void 0), _jsx("path", { d: "M17,32c-5.85,0-4.33,0-4-.05a7.06,7.06,0,0,0,6-7,7,7,0,0,0-4.47,1.59,7.08,7.08,0,0,0-2.07-5.05,7.06,7.06,0,0,0-2.07,5.05,7,7,0,0,0-4.47-1.59,7.07,7.07,0,0,0,6,7c.36.08,1.89.05-4,.05l1.71,6H3V55H5V50H20v5h2V38H15.26ZM15,45H10V43h5Z" }, void 0), _jsx("path", { d: "M26,21h6L31,10H19L18,21h6V40.61a3.63,3.63,0,0,1,2-3.24Z" }, void 0)] }), void 0)] }), void 0)); };
|
|
215
203
|
var DocumentIcon = function (props) { return (_jsx("svg", __assign({ fill: props.fill, className: props.class, style: props.style, id: "bold", enableBackground: "new 0 0 24 24", height: "512", viewBox: "0 0 24 24", width: "512", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "m21.25 3h-18.5c-1.517 0-2.75 1.233-2.75 2.75v12.5c0 1.517 1.233 2.75 2.75 2.75h18.5c1.517 0 2.75-1.233 2.75-2.75v-12.5c0-1.517-1.233-2.75-2.75-2.75zm-13.75 4c1.378 0 2.5 1.122 2.5 2.5s-1.122 2.5-2.5 2.5-2.5-1.122-2.5-2.5 1.122-2.5 2.5-2.5zm4.5 9.25c0 .414-.336.75-.75.75h-7.5c-.414 0-.75-.336-.75-.75v-.5c0-1.517 1.233-2.75 2.75-2.75h3.5c1.517 0 2.75 1.233 2.75 2.75zm8.25.75h-5.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h5.5c.414 0 .75.336.75.75s-.336.75-.75.75zm0-4h-5.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h5.5c.414 0 .75.336.75.75s-.336.75-.75.75zm0-4h-5.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h5.5c.414 0 .75.336.75.75s-.336.75-.75.75z" }, void 0) }), void 0)); };
|
|
216
204
|
var ProjectIcon = function (props) { return (_jsx("svg", __assign({ fill: props.fill, className: props.class, style: props.style, height: "480pt", viewBox: "0 -8 480 480", width: "480pt", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "m440 448v-49.960938c10.546875-6.214843 16.726562-17.816406 16-30.039062 0-17.671875-10.742188-32-24-32s-24 14.328125-24 32c-.726562 12.222656 5.453125 23.824219 16 30.039062v49.960938h-56v-243.054688l-48-24v43.054688h24v16h-24v32h24v16h-24v32h24v16h-24v32h24v16h-24v32h24v16h-24v16h-16v-321.96875l-96-27.421875v29.390625h56v16h-56v32h56v16h-56v32h56v16h-56v32h56v16h-56v32h56v16h-56v32h56v16h-56v32h56v16h-56v16h-16v-448h-144v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v16h-48v16h480v-16zm0 0" }, void 0) }), void 0)); };
|
|
@@ -70,7 +70,7 @@ function ClassifierSelector(_a) {
|
|
|
70
70
|
? '100%'
|
|
71
71
|
: calcStepWidth(step.size, form.size),
|
|
72
72
|
minHeight: step.description || step.required ? '55px' : '43px',
|
|
73
|
-
} }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: "transparent", innerBackgroundColor: (_a = formStyle.stepBackgroundColor) !== null && _a !== void 0 ? _a : 'white', label: step.label ? step.label : classifier.name, required: step.required, height: '31px', searchable: step.searchable, icon: undefined,
|
|
73
|
+
} }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: "transparent", innerBackgroundColor: (_a = formStyle.stepBackgroundColor) !== null && _a !== void 0 ? _a : 'white', label: step.label ? step.label : classifier.name, required: step.required, height: '31px', searchable: step.searchable, icon: undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", handleUpdate: function (value) {
|
|
74
74
|
onChange(value);
|
|
75
75
|
sizeChange();
|
|
76
76
|
}, getOptionSelected: function (option, value) {
|
|
@@ -47,10 +47,10 @@ function Selector(_a) {
|
|
|
47
47
|
? '100%'
|
|
48
48
|
: calcStepWidth(step.size, form.size),
|
|
49
49
|
minHeight: step.description || step.required ? '55px' : '43px',
|
|
50
|
-
} }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: step.options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: "transparent", innerBackgroundColor: (_a = formStyle.stepBackgroundColor) !== null && _a !== void 0 ? _a : 'white', label: step.label, required: step.required, height: '31px', searchable: step.searchable, icon: undefined,
|
|
50
|
+
} }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: step.options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: "transparent", innerBackgroundColor: (_a = formStyle.stepBackgroundColor) !== null && _a !== void 0 ? _a : 'white', label: step.label, required: step.required, height: '31px', searchable: step.searchable, icon: undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", handleUpdate: function (value) {
|
|
51
51
|
onChange(value);
|
|
52
52
|
}, getOptionSelected: function (option, value) {
|
|
53
|
-
return option.value === (value === null || value === void 0 ? void 0 : value.value);
|
|
53
|
+
return (option === null || option === void 0 ? void 0 : option.value) === (value === null || value === void 0 ? void 0 : value.value);
|
|
54
54
|
}, helperText: errors[step.id]
|
|
55
55
|
? errors[step.id].message
|
|
56
56
|
: step.description, error: !!errors[step.id] }, void 0) }), void 0));
|
package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js
CHANGED
|
@@ -66,7 +66,7 @@ import React from 'react';
|
|
|
66
66
|
function SmartSelect(_a) {
|
|
67
67
|
var _this = this;
|
|
68
68
|
var _b, _c, _d, _e;
|
|
69
|
-
var icon = _a.icon, step = _a.step, form = _a.form, value = _a.value, onBlur = _a.onBlur, errors = _a.errors, trigger = _a.trigger, children = _a.children, editable = _a.editable, onChange = _a.onChange, inputRef = _a.inputRef, postview = _a.postview, formStyle = _a.formStyle, getOptions = _a.getOptions, widthStats = _a.widthStats, organization = _a.organization, calcDepError = _a.calcDepError,
|
|
69
|
+
var icon = _a.icon, step = _a.step, form = _a.form, value = _a.value, onBlur = _a.onBlur, errors = _a.errors, trigger = _a.trigger, children = _a.children, editable = _a.editable, onChange = _a.onChange, inputRef = _a.inputRef, postview = _a.postview, formStyle = _a.formStyle, getOptions = _a.getOptions, widthStats = _a.widthStats, organization = _a.organization, calcDepError = _a.calcDepError, valueOverwrite = _a.valueOverwrite, getValueString = _a.getValueString, originalValues = _a.originalValues, changeListener = _a.changeListener, dependencyStore = _a.dependencyStore, _f = _a.calcInvalidDeps, calcInvalidDeps = _f === void 0 ? function (step, depStore) {
|
|
70
70
|
var _a;
|
|
71
71
|
var missingDeps = [];
|
|
72
72
|
for (var _i = 0, _b = (_a = step.dependencies) !== null && _a !== void 0 ? _a : []; _i < _b.length; _i++) {
|
|
@@ -76,7 +76,7 @@ function SmartSelect(_a) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
return missingDeps;
|
|
79
|
-
} : _f, getValueWarning = _a.getValueWarning, getOptionSelected = _a.getOptionSelected, setDependencyStore = _a.setDependencyStore, others = __rest(_a, ["icon", "step", "form", "value", "onBlur", "errors", "trigger", "children", "editable", "onChange", "inputRef", "postview", "formStyle", "getOptions", "widthStats", "organization", "calcDepError", "
|
|
79
|
+
} : _f, getValueWarning = _a.getValueWarning, getOptionSelected = _a.getOptionSelected, setDependencyStore = _a.setDependencyStore, others = __rest(_a, ["icon", "step", "form", "value", "onBlur", "errors", "trigger", "children", "editable", "onChange", "inputRef", "postview", "formStyle", "getOptions", "widthStats", "organization", "calcDepError", "valueOverwrite", "getValueString", "originalValues", "changeListener", "dependencyStore", "calcInvalidDeps", "getValueWarning", "getOptionSelected", "setDependencyStore"]);
|
|
80
80
|
var _g = useState(true), first = _g[0], setFirst = _g[1];
|
|
81
81
|
var _h = useState(), options = _h[0], setOptions = _h[1];
|
|
82
82
|
var _j = useState(), error = _j[0], setError = _j[1];
|
|
@@ -176,7 +176,7 @@ function SmartSelect(_a) {
|
|
|
176
176
|
if (options === undefined && !(!editable || postview)) {
|
|
177
177
|
setLoading(true);
|
|
178
178
|
}
|
|
179
|
-
}, "data-testid": step.id }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: options === null, loading: loading, options: options !== null && options !== void 0 ? options : [], inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: "transparent", innerBackgroundColor: (_d = formStyle.stepBackgroundColor) !== null && _d !== void 0 ? _d : 'white', label: step.label, required: step.required, height: '31px', changeListener: changeListener, searchable: step.searchable, icon: step.showIcon ? icon : undefined,
|
|
179
|
+
}, "data-testid": step.id }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: options === null, loading: loading, options: options !== null && options !== void 0 ? options : [], inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: "transparent", innerBackgroundColor: (_d = formStyle.stepBackgroundColor) !== null && _d !== void 0 ? _d : 'white', label: step.label, required: step.required, height: '31px', changeListener: changeListener, searchable: step.searchable, icon: step.showIcon ? icon : undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", handleUpdate: function (value) {
|
|
180
180
|
var _a;
|
|
181
181
|
if (dependencyStore[step.id] !== undefined) {
|
|
182
182
|
setDependencyStore(__assign(__assign({}, dependencyStore), (_a = {}, _a[step.id] = value, _a)));
|
|
@@ -7,8 +7,6 @@ export interface SmartSelectStepProps extends Omit<StepProps, 'step'> {
|
|
|
7
7
|
step: GSmartSelect;
|
|
8
8
|
/** The icon to display */
|
|
9
9
|
icon?: React.ReactNode;
|
|
10
|
-
/** The iconComponent to display in the selector */
|
|
11
|
-
iconComponent?: any;
|
|
12
10
|
/** Function to call to get the options of the selector, return null if dependency is not met */
|
|
13
11
|
getOptions: (idOrganization: string, step: GSmartSelect, dependencyStore: Record<string, any>) => Promise<any[] | null>;
|
|
14
12
|
/** Function to determine the currently selected option */
|
|
@@ -33,6 +33,7 @@ import FileUploadStep from './FileUploadStep/FileUploadStep';
|
|
|
33
33
|
import CheckBoxStep from './CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep';
|
|
34
34
|
import CBRStepMapper from './CBRStepMapper';
|
|
35
35
|
import RatingStep from './RatingStep/RatingStep';
|
|
36
|
+
import AYFStepMapper from './AYFStepMapper';
|
|
36
37
|
function StepComponent(_a) {
|
|
37
38
|
var _b;
|
|
38
39
|
var step = _a.step, props = __rest(_a, ["step"]);
|
|
@@ -77,6 +78,9 @@ function StepComponent(_a) {
|
|
|
77
78
|
if (step.type.startsWith('CBR')) {
|
|
78
79
|
return _jsx(CBRStepMapper, __assign({}, props, { step: step }), void 0);
|
|
79
80
|
}
|
|
81
|
+
else if (step.type.startsWith('AYF')) {
|
|
82
|
+
return _jsx(AYFStepMapper, __assign({}, props, { step: step }), void 0);
|
|
83
|
+
}
|
|
80
84
|
return _jsx("div", {}, void 0);
|
|
81
85
|
}
|
|
82
86
|
export default StepComponent;
|
package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextInputStepProps } from '../TextInputStep';
|
|
3
|
-
declare function TextInputStep({ icon, step, form, control, editable, postview, formStyle, widthStats,
|
|
3
|
+
declare function TextInputStep({ icon, step, form, errors, control, editable, postview, formStyle, widthStats, defaultValue, }: TextInputStepProps): JSX.Element;
|
|
4
4
|
export default TextInputStep;
|
package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js
CHANGED
|
@@ -15,7 +15,7 @@ import styles from './MaterialTextInputStep.module.css';
|
|
|
15
15
|
import { Controller } from 'react-hook-form';
|
|
16
16
|
import { calcStepWidth } from '../../StepFunctions';
|
|
17
17
|
function TextInputStep(_a) {
|
|
18
|
-
var icon = _a.icon, step = _a.step, form = _a.form, control = _a.control, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, widthStats = _a.widthStats,
|
|
18
|
+
var icon = _a.icon, step = _a.step, form = _a.form, errors = _a.errors, control = _a.control, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, widthStats = _a.widthStats, _b = _a.defaultValue, defaultValue = _b === void 0 ? '' : _b;
|
|
19
19
|
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
20
20
|
width: widthStats.currentBreakPoint <= step.size
|
|
21
21
|
? '100%'
|
|
@@ -23,7 +23,7 @@ function TextInputStep(_a) {
|
|
|
23
23
|
minHeight: step.description || step.required || step.validation
|
|
24
24
|
? '55px'
|
|
25
25
|
: '43px',
|
|
26
|
-
} }, { children: _jsx(Controller, { name: step.id, control: control, defaultValue:
|
|
26
|
+
} }, { children: _jsx(Controller, { name: step.id, control: control, defaultValue: defaultValue, rules: {
|
|
27
27
|
required: step.required
|
|
28
28
|
? 'Este campo es obligatorio'
|
|
29
29
|
: undefined,
|
|
@@ -6,6 +6,8 @@ export interface TextInputStepProps extends StepProps {
|
|
|
6
6
|
step: TextInput;
|
|
7
7
|
/** The icon to display */
|
|
8
8
|
icon?: React.ReactNode;
|
|
9
|
+
/** Default value to display */
|
|
10
|
+
defaultValue?: string;
|
|
9
11
|
}
|
|
10
12
|
declare function TextInputStep(props: TextInputStepProps): JSX.Element;
|
|
11
13
|
export default TextInputStep;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum AYFFormStepTypes {
|
|
2
|
+
AYF_START_MONTH = "AYF_START_MONTH",
|
|
3
|
+
AYF_END_MONTH = "AYF_END_MONTH",
|
|
4
|
+
AYF_YEAR = "AYF_YEAR",
|
|
5
|
+
AYF_BILL_NUM = "AYF_BILL_NUM",
|
|
6
|
+
AYF_START_YEAR = "AYF_START_YEAR",
|
|
7
|
+
AYF_END_YEAR = "AYF_END_YEAR"
|
|
8
|
+
}
|
|
9
|
+
export default AYFFormStepTypes;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var AYFFormStepTypes;
|
|
2
|
+
(function (AYFFormStepTypes) {
|
|
3
|
+
AYFFormStepTypes["AYF_START_MONTH"] = "AYF_START_MONTH";
|
|
4
|
+
AYFFormStepTypes["AYF_END_MONTH"] = "AYF_END_MONTH";
|
|
5
|
+
AYFFormStepTypes["AYF_YEAR"] = "AYF_YEAR";
|
|
6
|
+
AYFFormStepTypes["AYF_BILL_NUM"] = "AYF_BILL_NUM";
|
|
7
|
+
AYFFormStepTypes["AYF_START_YEAR"] = "AYF_START_YEAR";
|
|
8
|
+
AYFFormStepTypes["AYF_END_YEAR"] = "AYF_END_YEAR";
|
|
9
|
+
})(AYFFormStepTypes || (AYFFormStepTypes = {}));
|
|
10
|
+
export default AYFFormStepTypes;
|
|
@@ -48,6 +48,7 @@ var useDatePickerStyles = function (props) {
|
|
|
48
48
|
borderRadius: props.borderRadius,
|
|
49
49
|
backgroundColor: props.backgroundColor,
|
|
50
50
|
cursor: props.cantEdit ? 'default' : 'pointer',
|
|
51
|
+
height: props.height,
|
|
51
52
|
'& input, textarea': {
|
|
52
53
|
cursor: props.cantEdit ? 'default' : 'pointer',
|
|
53
54
|
padding: props.padding,
|
|
@@ -86,6 +87,9 @@ var useDatePickerStyles = function (props) {
|
|
|
86
87
|
padding: 16,
|
|
87
88
|
},
|
|
88
89
|
},
|
|
90
|
+
'&.Erk-MuiOutlinedInput-adornedEnd': {
|
|
91
|
+
paddingRight: 11,
|
|
92
|
+
},
|
|
89
93
|
'& .Mui-error': {
|
|
90
94
|
color: props.errorColor,
|
|
91
95
|
},
|
|
@@ -101,7 +105,7 @@ var useDatePickerLabelStyles = function (props) {
|
|
|
101
105
|
whiteSpace: 'nowrap',
|
|
102
106
|
overflow: 'hidden',
|
|
103
107
|
maxWidth: 'calc(100% - 50px)',
|
|
104
|
-
marginTop: '-4px',
|
|
108
|
+
marginTop: props.height != '40px' ? '-4px' : '0px',
|
|
105
109
|
textOverflow: 'ellipsis',
|
|
106
110
|
fontSize: props.fontSize,
|
|
107
111
|
'&.Mui-focused': {
|
|
@@ -211,7 +215,7 @@ var useDatePickerDialogStyles = function (props) {
|
|
|
211
215
|
}); });
|
|
212
216
|
};
|
|
213
217
|
function CustomDatePicker(_a) {
|
|
214
|
-
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.secondaryColor, secondaryColor = _c === void 0 ? '#98c1d9' : _c, _d = _a.outlineColor, outlineColor = _d === void 0 ? '#0000003b' : _d, _e = _a.backgroundColor, backgroundColor = _e === void 0 ? 'white' : _e, innerBackgroundColor = _a.innerBackgroundColor, _f = _a.textColor, textColor = _f === void 0 ? '#293241' : _f, _g = _a.contrastColor, contrastColor = _g === void 0 ? '#ee6c4d' : _g, _h = _a.accentColor, accentColor = _h === void 0 ? '#293241' : _h, _j = _a.errorColor, errorColor = _j === void 0 ? '#cc2936' : _j, _k = _a.borderRadius, borderRadius = _k === void 0 ? 10 : _k, _l = _a.padding, padding = _l === void 0 ? '6px 0px 6px 12px' : _l, _m = _a.fontSize, fontSize = _m === void 0 ? '1rem' : _m, _o = _a.shrunkenFontSize, shrunkenFontSize = _o === void 0 ? '1rem' : _o, _p = _a.helperTextColor, helperTextColor = _p === void 0 ? '#989898' : _p, _q = _a.fontWeight, fontWeight = _q === void 0 ? '300' : _q, _r = _a.
|
|
218
|
+
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.secondaryColor, secondaryColor = _c === void 0 ? '#98c1d9' : _c, _d = _a.outlineColor, outlineColor = _d === void 0 ? '#0000003b' : _d, _e = _a.backgroundColor, backgroundColor = _e === void 0 ? 'white' : _e, innerBackgroundColor = _a.innerBackgroundColor, _f = _a.textColor, textColor = _f === void 0 ? '#293241' : _f, _g = _a.contrastColor, contrastColor = _g === void 0 ? '#ee6c4d' : _g, _h = _a.accentColor, accentColor = _h === void 0 ? '#293241' : _h, _j = _a.errorColor, errorColor = _j === void 0 ? '#cc2936' : _j, _k = _a.borderRadius, borderRadius = _k === void 0 ? 10 : _k, _l = _a.padding, padding = _l === void 0 ? '6px 0px 6px 12px' : _l, _m = _a.fontSize, fontSize = _m === void 0 ? '1rem' : _m, _o = _a.shrunkenFontSize, shrunkenFontSize = _o === void 0 ? '1rem' : _o, _p = _a.helperTextColor, helperTextColor = _p === void 0 ? '#989898' : _p, _q = _a.fontWeight, fontWeight = _q === void 0 ? '300' : _q, _r = _a.height, height = _r === void 0 ? '31px' : _r, _s = _a.cantEdit, cantEdit = _s === void 0 ? false : _s, _t = _a.pickTime, pickTime = _t === void 0 ? false : _t, onChange = _a.onChange, required = _a.required, others = __rest(_a, ["focusColor", "secondaryColor", "outlineColor", "backgroundColor", "innerBackgroundColor", "textColor", "contrastColor", "accentColor", "errorColor", "borderRadius", "padding", "fontSize", "shrunkenFontSize", "helperTextColor", "fontWeight", "height", "cantEdit", "pickTime", "onChange", "required"]);
|
|
215
219
|
var classes = useDatePickerStyles({
|
|
216
220
|
padding: padding,
|
|
217
221
|
cantEdit: cantEdit,
|
|
@@ -227,6 +231,7 @@ function CustomDatePicker(_a) {
|
|
|
227
231
|
shrunkenFontSize: shrunkenFontSize,
|
|
228
232
|
fontWeight: fontWeight,
|
|
229
233
|
helperTextColor: helperTextColor,
|
|
234
|
+
height: height,
|
|
230
235
|
})();
|
|
231
236
|
var labelClasses = useDatePickerLabelStyles({
|
|
232
237
|
padding: padding,
|
|
@@ -243,6 +248,7 @@ function CustomDatePicker(_a) {
|
|
|
243
248
|
shrunkenFontSize: shrunkenFontSize,
|
|
244
249
|
fontWeight: fontWeight,
|
|
245
250
|
helperTextColor: helperTextColor,
|
|
251
|
+
height: height,
|
|
246
252
|
})();
|
|
247
253
|
var datePicker = useDatePickerDialogStyles({
|
|
248
254
|
padding: padding,
|
|
@@ -262,6 +268,7 @@ function CustomDatePicker(_a) {
|
|
|
262
268
|
shrunkenFontSize: shrunkenFontSize,
|
|
263
269
|
fontWeight: fontWeight,
|
|
264
270
|
helperTextColor: helperTextColor,
|
|
271
|
+
height: height,
|
|
265
272
|
})().datePicker;
|
|
266
273
|
var helperTextStyles = useDatePickerHelperTextStyles({
|
|
267
274
|
padding: padding,
|
|
@@ -276,6 +283,7 @@ function CustomDatePicker(_a) {
|
|
|
276
283
|
shrunkenFontSize: shrunkenFontSize,
|
|
277
284
|
fontWeight: fontWeight,
|
|
278
285
|
helperTextColor: helperTextColor,
|
|
286
|
+
height: height,
|
|
279
287
|
})();
|
|
280
288
|
if (pickTime) {
|
|
281
289
|
return (_jsx(DateTimePicker, __assign({}, others, { inputVariant: "outlined", size: "small", disabled: cantEdit, fullWidth: true, onChange: onChange, placeholder: format(new Date(), 'Pp', { locale: getLocale() }), format: "Pp", required: required, InputLabelProps: { classes: labelClasses }, DialogProps: {
|
|
@@ -287,7 +295,10 @@ function CustomDatePicker(_a) {
|
|
|
287
295
|
required: required,
|
|
288
296
|
classes: classes,
|
|
289
297
|
disabled: cantEdit,
|
|
290
|
-
endAdornment: (_jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
298
|
+
endAdornment: (_jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
299
|
+
color: '#757575',
|
|
300
|
+
fontSize: 20,
|
|
301
|
+
} }, void 0)),
|
|
291
302
|
}, FormHelperTextProps: {
|
|
292
303
|
classes: helperTextStyles,
|
|
293
304
|
}, renderDay: function (day, selectedDate, dayInCurrentMonth, dayComponent) {
|
|
@@ -309,7 +320,10 @@ function CustomDatePicker(_a) {
|
|
|
309
320
|
required: required,
|
|
310
321
|
classes: classes,
|
|
311
322
|
disabled: cantEdit,
|
|
312
|
-
endAdornment: (_jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
323
|
+
endAdornment: (_jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
324
|
+
color: '#757575',
|
|
325
|
+
fontSize: 20,
|
|
326
|
+
} }, void 0)),
|
|
313
327
|
}, FormHelperTextProps: {
|
|
314
328
|
classes: helperTextStyles,
|
|
315
329
|
}, renderDay: function (day, selectedDate, dayInCurrentMonth, dayComponent) {
|
|
@@ -17,6 +17,8 @@ interface StyleProps {
|
|
|
17
17
|
color?: string;
|
|
18
18
|
/** The fontsize of the content */
|
|
19
19
|
fontSize?: string;
|
|
20
|
+
/** The weight of the font of the value and the placeholder */
|
|
21
|
+
fontWeight?: any;
|
|
20
22
|
/** The color of the inner input */
|
|
21
23
|
innerBackgroundColor?: string;
|
|
22
24
|
/** If input is readOnly */
|
|
@@ -25,7 +27,9 @@ interface StyleProps {
|
|
|
25
27
|
helperTextColor?: string;
|
|
26
28
|
/** The borderRadius of the input */
|
|
27
29
|
borderRadius?: number;
|
|
28
|
-
/**
|
|
30
|
+
/** The padding to the left of the input */
|
|
31
|
+
paddingLeft?: number;
|
|
32
|
+
/** If custom icon exists and should be displayed */
|
|
29
33
|
showIcon?: boolean;
|
|
30
34
|
}
|
|
31
35
|
interface RoundedSelectProps extends Omit<SelectProps, 'color'>, StyleProps {
|
|
@@ -38,8 +42,8 @@ interface RoundedSelectProps extends Omit<SelectProps, 'color'>, StyleProps {
|
|
|
38
42
|
name?: string | undefined;
|
|
39
43
|
value: any;
|
|
40
44
|
}>, child?: React.ReactNode) => void;
|
|
41
|
-
/**
|
|
42
|
-
label
|
|
45
|
+
/** String to place in the label */
|
|
46
|
+
label?: string;
|
|
43
47
|
/** Minimum width in px of the component */
|
|
44
48
|
minWidth?: number;
|
|
45
49
|
/** The color of the outline when selected and hovered on */
|
|
@@ -52,6 +56,8 @@ interface RoundedSelectProps extends Omit<SelectProps, 'color'>, StyleProps {
|
|
|
52
56
|
containerMargin?: string;
|
|
53
57
|
/** The icon to display */
|
|
54
58
|
iconComponent?: any;
|
|
59
|
+
/** the components ref */
|
|
60
|
+
ref?: any;
|
|
55
61
|
/** The color of the inner input */
|
|
56
62
|
innerBackgroundColor?: string;
|
|
57
63
|
}
|
|
@@ -85,12 +85,18 @@ var useOutlinedInputStyles = function (props) {
|
|
|
85
85
|
'&.Mui-error .EF-MuiOutlinedInput-notchedOutline': {
|
|
86
86
|
borderColor: props.outlineColor,
|
|
87
87
|
},
|
|
88
|
+
'& .EF-MuiSelect-root': {
|
|
89
|
+
paddingLeft: props.paddingLeft,
|
|
90
|
+
},
|
|
88
91
|
'&$focused $notchedOutline': {
|
|
89
92
|
borderColor: props.focusColor,
|
|
90
93
|
},
|
|
91
94
|
'& .EF-MuiSelect-icon.Mui-disabled': {
|
|
92
95
|
color: props.outlineColor,
|
|
93
96
|
},
|
|
97
|
+
'& .EF-MuiSelect-icon.iconOutlined': {
|
|
98
|
+
right: 8,
|
|
99
|
+
},
|
|
94
100
|
'& .EF-MuiSelect-iconOpen': {
|
|
95
101
|
transform: props.showIcon ? 'none' : 'rotate(180deg)',
|
|
96
102
|
},
|
|
@@ -106,6 +112,7 @@ var useLabelInputStyles = function (props) {
|
|
|
106
112
|
color: props.focusColor + ' !important',
|
|
107
113
|
},
|
|
108
114
|
root: {
|
|
115
|
+
fontWeight: props.fontWeight,
|
|
109
116
|
whiteSpace: 'nowrap',
|
|
110
117
|
overflow: 'hidden',
|
|
111
118
|
maxWidth: 'calc(100% - 45px)',
|
|
@@ -135,26 +142,27 @@ var useHelperTextStyles = function (props) {
|
|
|
135
142
|
}); });
|
|
136
143
|
};
|
|
137
144
|
function CustomSelect(_a) {
|
|
138
|
-
var children = _a.children, _b = _a.value, value = _b === void 0 ? '' : _b, handleUpdate = _a.handleUpdate, label = _a.label, minWidth = _a.minWidth, helperText = _a.helperText, _c = _a.color, color = _c === void 0 ? '#293241' : _c, _d = _a.errorColor, errorColor = _d === void 0 ? '#cc2936' : _d, _e = _a.focusColor, focusColor = _e === void 0 ? '#3d5a7f' : _e, _f = _a.
|
|
139
|
-
var
|
|
145
|
+
var children = _a.children, _b = _a.value, value = _b === void 0 ? '' : _b, handleUpdate = _a.handleUpdate, label = _a.label, minWidth = _a.minWidth, helperText = _a.helperText, _c = _a.color, color = _c === void 0 ? '#293241' : _c, _d = _a.errorColor, errorColor = _d === void 0 ? '#cc2936' : _d, _e = _a.focusColor, focusColor = _e === void 0 ? '#3d5a7f' : _e, _f = _a.outlineColor, outlineColor = _f === void 0 ? '#0000003b' : _f, _g = _a.helperTextColor, helperTextColor = _g === void 0 ? '#989898' : _g, _h = _a.backgroundColor, backgroundColor = _h === void 0 ? '#ffffff' : _h, _j = _a.readOnly, readOnly = _j === void 0 ? false : _j, _k = _a.borderRadius, borderRadius = _k === void 0 ? 10 : _k, innerBackgroundColor = _a.innerBackgroundColor, _l = _a.paddingLeft, paddingLeft = _l === void 0 ? 14 : _l, _m = _a.cantEdit, cantEdit = _m === void 0 ? false : _m, _o = _a.showIcon, showIcon = _o === void 0 ? true : _o, _p = _a.containerMargin, containerMargin = _p === void 0 ? '8px' : _p, _q = _a.height, height = _q === void 0 ? '40px' : _q, _r = _a.fontSize, fontSize = _r === void 0 ? '1rem' : _r, required = _a.required, iconComponent = _a.iconComponent, error = _a.error, others = __rest(_a, ["children", "value", "handleUpdate", "label", "minWidth", "helperText", "color", "errorColor", "focusColor", "outlineColor", "helperTextColor", "backgroundColor", "readOnly", "borderRadius", "innerBackgroundColor", "paddingLeft", "cantEdit", "showIcon", "containerMargin", "height", "fontSize", "required", "iconComponent", "error"]);
|
|
146
|
+
var styleProps = {
|
|
140
147
|
color: color,
|
|
141
148
|
height: height,
|
|
149
|
+
readOnly: readOnly,
|
|
150
|
+
fontSize: fontSize,
|
|
151
|
+
cantEdit: cantEdit,
|
|
142
152
|
errorColor: errorColor,
|
|
143
153
|
focusColor: focusColor,
|
|
154
|
+
paddingLeft: paddingLeft,
|
|
144
155
|
outlineColor: outlineColor,
|
|
145
|
-
|
|
156
|
+
borderRadius: borderRadius,
|
|
146
157
|
helperTextColor: helperTextColor,
|
|
147
158
|
backgroundColor: backgroundColor,
|
|
148
|
-
borderRadius: borderRadius,
|
|
149
|
-
readOnly: readOnly,
|
|
150
|
-
fontSize: fontSize,
|
|
151
|
-
cantEdit: cantEdit,
|
|
152
159
|
showIcon: showIcon && iconComponent !== undefined,
|
|
160
|
+
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
153
161
|
};
|
|
154
162
|
var classes = useStyles();
|
|
155
|
-
var outlinedInputClasses = useOutlinedInputStyles(
|
|
156
|
-
var labelClasses = useLabelInputStyles(
|
|
157
|
-
var helperTextClasses = useHelperTextStyles(
|
|
163
|
+
var outlinedInputClasses = useOutlinedInputStyles(styleProps)();
|
|
164
|
+
var labelClasses = useLabelInputStyles(styleProps)();
|
|
165
|
+
var helperTextClasses = useHelperTextStyles(styleProps)();
|
|
158
166
|
return (_jsxs(FormControl, __assign({ variant: "outlined", className: classes.formControl, size: "small", style: minWidth !== undefined
|
|
159
167
|
? { minWidth: minWidth, outlineColor: outlineColor, margin: containerMargin }
|
|
160
168
|
: {
|
|
@@ -27,7 +27,7 @@ interface StyleProps {
|
|
|
27
27
|
fontWeight?: number | string;
|
|
28
28
|
/** The color of the helper text when not error */
|
|
29
29
|
helperTextColor?: string;
|
|
30
|
-
/** If custom
|
|
30
|
+
/** If custom icon exists and should be displayed */
|
|
31
31
|
showIcon?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export interface RoundedSmartSelectProps extends Omit<TextFieldProps, 'color'>, StyleProps {
|
|
@@ -41,7 +41,7 @@ export interface RoundedSmartSelectProps extends Omit<TextFieldProps, 'color'>,
|
|
|
41
41
|
handleUpdate?: (event: React.ChangeEvent<{
|
|
42
42
|
name?: string | undefined;
|
|
43
43
|
value: any;
|
|
44
|
-
}
|
|
44
|
+
}> | string, child?: React.ReactNode) => void;
|
|
45
45
|
/** Strig to place in the label */
|
|
46
46
|
label: string;
|
|
47
47
|
/** Minimum width in px of the component */
|
|
@@ -52,10 +52,10 @@ export interface RoundedSmartSelectProps extends Omit<TextFieldProps, 'color'>,
|
|
|
52
52
|
containerMargin?: string;
|
|
53
53
|
/** The icon to display */
|
|
54
54
|
icon?: React.ReactNode;
|
|
55
|
-
/** The iconComponent to display in the selector */
|
|
56
|
-
iconComponent?: any;
|
|
57
55
|
/** If the options are searchable */
|
|
58
56
|
searchable?: boolean;
|
|
57
|
+
/** If can create new option */
|
|
58
|
+
creatable?: boolean;
|
|
59
59
|
/** Function to determine the currently selected option */
|
|
60
60
|
getOptionSelected?: (option: any, value: any) => boolean;
|
|
61
61
|
/** Function to determine the current value in string format */
|
|
@@ -63,5 +63,5 @@ export interface RoundedSmartSelectProps extends Omit<TextFieldProps, 'color'>,
|
|
|
63
63
|
/** Function called on each value change */
|
|
64
64
|
changeListener?: (value: any) => void;
|
|
65
65
|
}
|
|
66
|
-
export default function RoundedSmartSelect({ options, value, handleUpdate, label, getValueString, color, errorColor, focusColor, helperTextColor, outlineColor, backgroundColor, cantEdit, loading, height, fontSize, required, changeListener, error, innerBackgroundColor, getOptionSelected, helperText, readOnly, borderRadius, fontWeight, icon,
|
|
66
|
+
export default function RoundedSmartSelect({ options, value, handleUpdate, label, getValueString, color, errorColor, focusColor, helperTextColor, outlineColor, backgroundColor, cantEdit, loading, height, fontSize, required, changeListener, error, innerBackgroundColor, getOptionSelected, helperText, readOnly, borderRadius, fontWeight, icon, searchable, containerMargin, showIcon, inputRef, disabled, creatable, onBlur, name, }: RoundedSmartSelectProps): JSX.Element;
|
|
67
67
|
export {};
|
|
@@ -24,6 +24,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
24
24
|
import Autocomplete, { createFilterOptions, } from '@material-ui/lab/Autocomplete';
|
|
25
25
|
import { makeStyles } from '@material-ui/core/styles';
|
|
26
26
|
import TextField from '@material-ui/core/TextField';
|
|
27
|
+
import { cloneElement } from 'react';
|
|
27
28
|
import { MenuItem, Popper } from '@material-ui/core';
|
|
28
29
|
import RoundedSelect from '../RoundedSelect/RoundedSelect';
|
|
29
30
|
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
@@ -124,7 +125,7 @@ var useTextfieldStyles = function (props) {
|
|
|
124
125
|
}); });
|
|
125
126
|
};
|
|
126
127
|
export default function RoundedSmartSelect(_a) {
|
|
127
|
-
var _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.value, value = _c === void 0 ? '' : _c, handleUpdate = _a.handleUpdate, label = _a.label, _d = _a.getValueString, getValueString = _d === void 0 ? function (value) { return value.value; } : _d, _e = _a.color, color = _e === void 0 ? '#293241' : _e, _f = _a.errorColor, errorColor = _f === void 0 ? '#cc2936' : _f, _g = _a.focusColor, focusColor = _g === void 0 ? '#3d5a7f' : _g, _h = _a.helperTextColor, helperTextColor = _h === void 0 ? '#989898' : _h, _j = _a.outlineColor, outlineColor = _j === void 0 ? '#b8b8b8' : _j, _k = _a.backgroundColor, backgroundColor = _k === void 0 ? '#ffffff' : _k, _l = _a.cantEdit, cantEdit = _l === void 0 ? false : _l, _m = _a.loading, loading = _m === void 0 ? false : _m, _o = _a.height, height = _o === void 0 ? '31px' : _o, _p = _a.fontSize, fontSize = _p === void 0 ? '1rem' : _p, required = _a.required, changeListener = _a.changeListener, error = _a.error, innerBackgroundColor = _a.innerBackgroundColor, getOptionSelected = _a.getOptionSelected, helperText = _a.helperText, _q = _a.readOnly, readOnly = _q === void 0 ? false : _q, _r = _a.borderRadius, borderRadius = _r === void 0 ? 10 : _r, _s = _a.fontWeight, fontWeight = _s === void 0 ? '400' : _s, icon = _a.icon,
|
|
128
|
+
var _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.value, value = _c === void 0 ? '' : _c, handleUpdate = _a.handleUpdate, label = _a.label, _d = _a.getValueString, getValueString = _d === void 0 ? function (value) { return value.value; } : _d, _e = _a.color, color = _e === void 0 ? '#293241' : _e, _f = _a.errorColor, errorColor = _f === void 0 ? '#cc2936' : _f, _g = _a.focusColor, focusColor = _g === void 0 ? '#3d5a7f' : _g, _h = _a.helperTextColor, helperTextColor = _h === void 0 ? '#989898' : _h, _j = _a.outlineColor, outlineColor = _j === void 0 ? '#b8b8b8' : _j, _k = _a.backgroundColor, backgroundColor = _k === void 0 ? '#ffffff' : _k, _l = _a.cantEdit, cantEdit = _l === void 0 ? false : _l, _m = _a.loading, loading = _m === void 0 ? false : _m, _o = _a.height, height = _o === void 0 ? '31px' : _o, _p = _a.fontSize, fontSize = _p === void 0 ? '1rem' : _p, required = _a.required, changeListener = _a.changeListener, error = _a.error, innerBackgroundColor = _a.innerBackgroundColor, getOptionSelected = _a.getOptionSelected, helperText = _a.helperText, _q = _a.readOnly, readOnly = _q === void 0 ? false : _q, _r = _a.borderRadius, borderRadius = _r === void 0 ? 10 : _r, _s = _a.fontWeight, fontWeight = _s === void 0 ? '400' : _s, icon = _a.icon, _t = _a.searchable, searchable = _t === void 0 ? false : _t, _u = _a.containerMargin, containerMargin = _u === void 0 ? '0px' : _u, _v = _a.showIcon, showIcon = _v === void 0 ? true : _v, inputRef = _a.inputRef, disabled = _a.disabled, _w = _a.creatable, creatable = _w === void 0 ? false : _w, onBlur = _a.onBlur, name = _a.name;
|
|
128
129
|
var props = {
|
|
129
130
|
color: color,
|
|
130
131
|
height: height,
|
|
@@ -143,7 +144,7 @@ export default function RoundedSmartSelect(_a) {
|
|
|
143
144
|
};
|
|
144
145
|
var textFieldClasses = useTextfieldStyles(props)();
|
|
145
146
|
if (searchable) {
|
|
146
|
-
return (_jsx(Autocomplete, { size: "small", fullWidth: true, openOnFocus: true, disabled: cantEdit || disabled, popupIcon: loading ? (_jsx(CircularProgress, { size: 22, style: { color: '#757575' } }, void 0)) : showIcon && icon ? (icon) : undefined, onOpen: function () { }, loading: loading, loadingText: 'Cargando...', closeIcon: false, options: options, getOptionLabel: function (option) {
|
|
147
|
+
return (_jsx(Autocomplete, { size: "small", fullWidth: true, openOnFocus: true, freeSolo: creatable, disabled: cantEdit || disabled, popupIcon: loading ? (_jsx(CircularProgress, { size: 22, style: { color: '#757575' } }, void 0)) : showIcon && icon ? (icon) : undefined, onOpen: function () { }, loading: loading, loadingText: 'Cargando...', closeIcon: false, options: options, getOptionLabel: function (option) {
|
|
147
148
|
var _a, _b;
|
|
148
149
|
// Value selected with enter, right from the input
|
|
149
150
|
if (typeof option === 'string') {
|
|
@@ -160,16 +161,42 @@ export default function RoundedSmartSelect(_a) {
|
|
|
160
161
|
var style = _a.style, props = __rest(_a, ["style"]);
|
|
161
162
|
return (_jsx(Popper, __assign({}, props, { style: __assign(__assign({}, style), { zIndex: 1305 }) }), void 0));
|
|
162
163
|
}, value: value ? value : null, onChange: function (event, newValue) {
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
if (creatable) {
|
|
165
|
+
if (typeof newValue === 'string') {
|
|
166
|
+
changeListener === null || changeListener === void 0 ? void 0 : changeListener(newValue);
|
|
167
|
+
handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(newValue);
|
|
168
|
+
}
|
|
169
|
+
else if (newValue && newValue.inputValue) {
|
|
170
|
+
changeListener === null || changeListener === void 0 ? void 0 : changeListener(newValue.inputValue);
|
|
171
|
+
handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(newValue.inputValue); // Create a new value from the user input
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
changeListener === null || changeListener === void 0 ? void 0 : changeListener(newValue === null || newValue === void 0 ? void 0 : newValue.label);
|
|
175
|
+
handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(newValue === null || newValue === void 0 ? void 0 : newValue.label);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
changeListener === null || changeListener === void 0 ? void 0 : changeListener(newValue);
|
|
180
|
+
handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(newValue);
|
|
181
|
+
}
|
|
165
182
|
}, filterOptions: function (options, params) {
|
|
166
183
|
if (value && value.label === (params === null || params === void 0 ? void 0 : params.inputValue)) {
|
|
167
184
|
return options;
|
|
168
185
|
}
|
|
169
186
|
else {
|
|
170
|
-
|
|
187
|
+
var filtered = filter(options, params);
|
|
188
|
+
// Suggest the creation of a new value
|
|
189
|
+
if (creatable && params.inputValue !== '') {
|
|
190
|
+
filtered.push({
|
|
191
|
+
inputValue: params.inputValue,
|
|
192
|
+
label: "Crear \"" + params.inputValue + "\"",
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
return filtered;
|
|
171
196
|
}
|
|
172
|
-
}, renderOption: function (option) {
|
|
197
|
+
}, renderOption: function (option) {
|
|
198
|
+
return typeof option === 'string' ? option : option.label;
|
|
199
|
+
}, renderInput: function (params) { return (_jsx(TextField, __assign({ classes: textFieldClasses }, params, { inputRef: inputRef, onBlur: onBlur, name: name, variant: "outlined", label: label, required: required, error: error, helperText: helperText }), void 0)); }, style: { pointerEvents: 'none' }, noOptionsText: "No hay opciones" }, void 0));
|
|
173
200
|
}
|
|
174
201
|
else {
|
|
175
202
|
return (_jsxs(RoundedSelect, __assign({ onBlur: onBlur, inputRef: inputRef, name: name, fullWidth: true, handleUpdate: function (event) {
|
|
@@ -178,6 +205,10 @@ export default function RoundedSmartSelect(_a) {
|
|
|
178
205
|
}));
|
|
179
206
|
}, onOpen: function () {
|
|
180
207
|
//Show loading icon if loading
|
|
181
|
-
}, value: getValueString(value), color: color, errorColor: errorColor, focusColor: focusColor, helperTextColor: helperTextColor,
|
|
208
|
+
}, value: getValueString(value), color: color, errorColor: errorColor, focusColor: focusColor, helperTextColor: helperTextColor, backgroundColor: backgroundColor, outlineColor: outlineColor, innerBackgroundColor: innerBackgroundColor, cantEdit: cantEdit, label: label, required: required, readOnly: readOnly, helperText: helperText, containerMargin: containerMargin, height: height, fontSize: fontSize, error: error, iconComponent: icon
|
|
209
|
+
? function (props) {
|
|
210
|
+
return cloneElement(icon, props);
|
|
211
|
+
}
|
|
212
|
+
: undefined, showIcon: showIcon }, { children: [_jsx(MenuItem, __assign({ value: '', style: { whiteSpace: 'normal' } }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), options.map(function (option) { return (_jsx(MenuItem, __assign({ value: getValueString(option), style: { whiteSpace: 'normal' } }, { children: option.label }), getValueString(option))); })] }), void 0));
|
|
182
213
|
}
|
|
183
214
|
}
|
package/package.json
CHANGED