@arquimedes.co/eureka-forms 1.9.67-test → 1.9.68
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/Form.d.ts +1 -0
- package/dist/FormComponents/Form/Form.js +8 -6
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +1 -1
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +1 -1
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +1 -1
- package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +1 -1
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -1
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +2 -2
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.d.ts +0 -1
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +1 -1
- package/dist/constants/InternalFormStyle.js +1 -0
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.d.ts +0 -2
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +3 -7
- package/dist/shared/RoundedSelect/RoundedSelect.d.ts +0 -4
- package/dist/shared/RoundedSelect/RoundedSelect.js +6 -3
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +1 -3
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +7 -6
- package/dist/shared/RoundedTextField/RoundedTextField.d.ts +0 -2
- package/dist/shared/RoundedTextField/RoundedTextField.js +4 -5
- package/package.json +1 -1
package/dist/@Types/Form.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export type FormStyle = MaterialStyle;
|
|
|
43
43
|
export type StyleKeys = keyof Omit<FormStyle, 'type'>;
|
|
44
44
|
export interface MaterialStyle {
|
|
45
45
|
type: FormStyleTypes.MATERIAL;
|
|
46
|
+
standAloneBackgroundColor: string;
|
|
46
47
|
backgroundColor: string;
|
|
47
48
|
primaryColor: string;
|
|
48
49
|
secondaryColor: string;
|
|
@@ -48,10 +48,10 @@ export var getLocale = function () {
|
|
|
48
48
|
navigator.browserLanguage]) !== null && _a !== void 0 ? _a : localeMap.es);
|
|
49
49
|
};
|
|
50
50
|
function FormComponent(_a) {
|
|
51
|
-
var _b, _c, _d, _e, _f, _g;
|
|
51
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
52
52
|
var form = _a.form, isWidget = _a.isWidget, internal = _a.internal, postview = _a.postview, organization = _a.organization, containerRef = _a.containerRef, others = __rest(_a, ["form", "isWidget", "internal", "postview", "organization", "containerRef"]);
|
|
53
|
-
var
|
|
54
|
-
var
|
|
53
|
+
var _k = useState(false), loaded = _k[0], setLoaded = _k[1];
|
|
54
|
+
var _l = useState(undefined), widthStats = _l[0], setWidthStats = _l[1];
|
|
55
55
|
/** Calcs the currentBreakPoint and if is mobile */
|
|
56
56
|
var handleResize = function () {
|
|
57
57
|
var _a;
|
|
@@ -100,12 +100,14 @@ function FormComponent(_a) {
|
|
|
100
100
|
}
|
|
101
101
|
else if (organization && widthStats !== undefined) {
|
|
102
102
|
//Standalone cant have widget
|
|
103
|
-
return (_jsxs(React.Fragment, { children: [_jsx(Navbar, { logo: organization.logoUrl, color: (_d = organization.styles) === null || _d === void 0 ? void 0 : _d.primaryColor }), _jsx("div", __assign({ className: styles.standAloneFormContainer, ref: containerRef
|
|
103
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Navbar, { logo: organization.logoUrl, color: (_d = organization.styles) === null || _d === void 0 ? void 0 : _d.primaryColor }), _jsx("div", __assign({ className: styles.standAloneFormContainer, ref: containerRef, style: {
|
|
104
|
+
background: (_f = (_e = form.style) === null || _e === void 0 ? void 0 : _e.standAloneBackgroundColor) !== null && _f !== void 0 ? _f : '#ffffff',
|
|
105
|
+
} }, { children: _jsx("div", __assign({ className: widthStats.isResponsive
|
|
104
106
|
? styles.fullScreenStandAloneForm
|
|
105
107
|
: styles.standAloneFormCard, style: {
|
|
106
|
-
backgroundColor: (
|
|
108
|
+
backgroundColor: (_h = (_g = form.style) === null || _g === void 0 ? void 0 : _g.backgroundColor) !== null && _h !== void 0 ? _h : InternalFormStyle.backgroundColor,
|
|
107
109
|
visibility: loaded ? 'visible' : 'hidden',
|
|
108
|
-
} }, { children: _jsx(FormTypeComponent, __assign({}, others, { internal: internal, postview: postview, widthStats: widthStats, form: form, formStyle: (
|
|
110
|
+
} }, { children: _jsx(FormTypeComponent, __assign({}, others, { internal: internal, postview: postview, widthStats: widthStats, form: form, formStyle: (_j = form.style) !== null && _j !== void 0 ? _j : InternalFormStyle, organization: organization, handleLoaded: function () {
|
|
109
111
|
setLoaded(true);
|
|
110
112
|
} })) })) }))] }));
|
|
111
113
|
}
|
|
@@ -44,6 +44,6 @@ function IncidentComponent(_a) {
|
|
|
44
44
|
if (others.editable && !others.postview) {
|
|
45
45
|
handleDelete();
|
|
46
46
|
}
|
|
47
|
-
} }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })), _jsx(StepComponent, __assign({}, others, { formStyle: formStyle, form: form, step: spaceStep, level: level + 1 })), _jsx(StepComponent, __assign({}, others, { form: form, formStyle: formStyle, step: elementStep, level: level + 1 })), _jsx(TextAreaStep, __assign({}, others, { form: form,
|
|
47
|
+
} }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })), _jsx(StepComponent, __assign({}, others, { formStyle: formStyle, form: form, step: spaceStep, level: level + 1 })), _jsx(StepComponent, __assign({}, others, { form: form, formStyle: formStyle, step: elementStep, level: level + 1 })), _jsx(TextAreaStep, __assign({}, others, { form: form, formStyle: formStyle, step: commentStep, maxLength: 200, level: level + 1 }))] })) })));
|
|
48
48
|
}
|
|
49
49
|
export default IncidentComponent;
|
|
@@ -73,7 +73,7 @@ function ClassifierSelector(_a) {
|
|
|
73
73
|
(!postview && editable && step.required)
|
|
74
74
|
? '55px'
|
|
75
75
|
: '43px',
|
|
76
|
-
} }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor:
|
|
76
|
+
} }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: (_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) {
|
|
77
77
|
onChange(value);
|
|
78
78
|
sizeChange();
|
|
79
79
|
}, getOptionSelected: function (option, value) {
|
|
@@ -50,7 +50,7 @@ function Selector(_a) {
|
|
|
50
50
|
(!postview && editable && step.required)
|
|
51
51
|
? '55px'
|
|
52
52
|
: '43px',
|
|
53
|
-
} }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: step.options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor:
|
|
53
|
+
} }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: step.options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: (_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) {
|
|
54
54
|
onChange(value);
|
|
55
55
|
}, getOptionSelected: function (option, value) {
|
|
56
56
|
return (option === null || option === void 0 ? void 0 : option.value) === (value === null || value === void 0 ? void 0 : value.value);
|
package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js
CHANGED
|
@@ -199,7 +199,7 @@ function SmartSelect(_a) {
|
|
|
199
199
|
if (options === undefined && !(!editable || postview)) {
|
|
200
200
|
setLoading(true);
|
|
201
201
|
}
|
|
202
|
-
}, disabled: options === null, loading: loading, options: options !== null && options !== void 0 ? options : undefined, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor:
|
|
202
|
+
}, disabled: options === null, loading: loading, options: options !== null && options !== void 0 ? options : undefined, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: (_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) {
|
|
203
203
|
var _a;
|
|
204
204
|
if (dependencyStore[step.id] !== undefined) {
|
|
205
205
|
setDependencyStore(__assign(__assign({}, dependencyStore), (_a = {}, _a[step.id] = value !== null && value !== void 0 ? value : null, _a)));
|
package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface Payload {
|
|
|
7
7
|
text: string;
|
|
8
8
|
draft: any;
|
|
9
9
|
}
|
|
10
|
-
declare function TextAreaStep({ step, errors, partial, control, editable, postview, formStyle, maxLength, originalValues,
|
|
10
|
+
declare function TextAreaStep({ step, errors, partial, control, editable, postview, formStyle, maxLength, originalValues, }: TextAreaStepProps): JSX.Element;
|
|
11
11
|
export default TextAreaStep;
|
|
12
12
|
export declare function stringToDraft(text: string): RawDraftContentState;
|
|
13
13
|
export declare const getRawText: (draft?: RawDraftContentState, text?: string) => RawDraftContentState;
|
|
@@ -31,7 +31,7 @@ import { EditorState } from 'draft-js';
|
|
|
31
31
|
import React, { useState } from 'react';
|
|
32
32
|
import { ClickAwayListener } from '@material-ui/core';
|
|
33
33
|
function TextAreaStep(_a) {
|
|
34
|
-
var step = _a.step, errors = _a.errors, partial = _a.partial, control = _a.control, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, maxLength = _a.maxLength, originalValues = _a.originalValues
|
|
34
|
+
var step = _a.step, errors = _a.errors, partial = _a.partial, control = _a.control, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, maxLength = _a.maxLength, originalValues = _a.originalValues;
|
|
35
35
|
var _b = useState(false), hovering = _b[0], setHovering = _b[1];
|
|
36
36
|
var _c = useState(false), focus = _c[0], setFocus = _c[1];
|
|
37
37
|
var calcStyle = function () {
|
|
@@ -159,7 +159,7 @@ function TextAreaStep(_a) {
|
|
|
159
159
|
}, shouldUnregister: true, render: function (_a) {
|
|
160
160
|
var _b;
|
|
161
161
|
var _c = _a.field, ref = _c.ref, field = __rest(_c, ["ref"]);
|
|
162
|
-
return (_jsxs(React.Fragment, { children: [_jsx("div", __assign({ className: styles.erkTextArea }, { children: _jsx(RoundedTextField, __assign({}, field, { "data-testid": step.id, maxLength: maxLength, label: step.label, inputRef: ref, required: step.required, cantEdit: !canEdit, fontWeight: 400, multiline: true, minRows: postview && partial ? undefined : 4, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor:
|
|
162
|
+
return (_jsxs(React.Fragment, { children: [_jsx("div", __assign({ className: styles.erkTextArea }, { children: _jsx(RoundedTextField, __assign({}, field, { "data-testid": step.id, maxLength: maxLength, label: step.label, inputRef: ref, required: step.required, cantEdit: !canEdit, fontWeight: 400, multiline: true, minRows: postview && partial ? undefined : 4, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.stepBackgroundColor, helperTextColor: formStyle.descriptionTextColor, helperText: errors[step.id]
|
|
163
163
|
? errors[step.id].message
|
|
164
164
|
: (_b = step.description) !== null && _b !== void 0 ? _b : (step.required ? ' ' : null), error: !!errors[step.id] })) })), postview && (_jsxs("div", __assign({ className: styles.print }, { children: [_jsxs("div", { children: [step.label, ":"] }), _jsx("p", __assign({ className: styles.printContainer, style: {
|
|
165
165
|
backgroundColor: formStyle.stepBackgroundColor,
|
package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js
CHANGED
|
@@ -68,7 +68,7 @@ function TextInputStep(_a) {
|
|
|
68
68
|
}, 1000));
|
|
69
69
|
}
|
|
70
70
|
field.onChange(value);
|
|
71
|
-
}, "data-testid": step.id, label: step.label, inputRef: ref, cantEdit: !editable || postview, required: step.required, fontWeight: 400, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.
|
|
71
|
+
}, "data-testid": step.id, label: step.label, inputRef: ref, cantEdit: !editable || postview, required: step.required, fontWeight: 400, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.stepBackgroundColor, helperText: errors[step.id]
|
|
72
72
|
? errors[step.id].message
|
|
73
73
|
: step.description, helperTextColor: formStyle.descriptionTextColor, error: !!errors[step.id], icon: step.showIcon ? icon : undefined })));
|
|
74
74
|
} }) })));
|
|
@@ -18,8 +18,6 @@ interface StyleProps {
|
|
|
18
18
|
contrastColor?: string;
|
|
19
19
|
/** The accent color of the input */
|
|
20
20
|
accentColor?: string;
|
|
21
|
-
/** The color of the inner input */
|
|
22
|
-
innerBackgroundColor?: string;
|
|
23
21
|
/** The borderRadius of the input */
|
|
24
22
|
borderRadius?: number;
|
|
25
23
|
/** If it should display the timePicker */
|
|
@@ -46,7 +46,6 @@ var useDatePickerStyles = function (props) {
|
|
|
46
46
|
return makeStyles(function () { return ({
|
|
47
47
|
root: {
|
|
48
48
|
borderRadius: props.borderRadius,
|
|
49
|
-
backgroundColor: props.backgroundColor,
|
|
50
49
|
cursor: props.cantEdit ? 'default' : 'pointer',
|
|
51
50
|
height: props.height,
|
|
52
51
|
'& input, textarea': {
|
|
@@ -58,7 +57,7 @@ var useDatePickerStyles = function (props) {
|
|
|
58
57
|
'&::placeholder': {
|
|
59
58
|
fontSize: props.fontSize,
|
|
60
59
|
},
|
|
61
|
-
backgroundColor: props.
|
|
60
|
+
backgroundColor: props.backgroundColor,
|
|
62
61
|
borderRadius: props.borderRadius,
|
|
63
62
|
},
|
|
64
63
|
'& .EF-MuiOutlinedInput-notchedOutline': {
|
|
@@ -108,6 +107,7 @@ var useDatePickerLabelStyles = function (props) {
|
|
|
108
107
|
marginTop: props.height != '40px' ? '-4px' : '0px',
|
|
109
108
|
textOverflow: 'ellipsis',
|
|
110
109
|
fontSize: props.fontSize,
|
|
110
|
+
color: props.textColor + '8a',
|
|
111
111
|
'&.Mui-focused': {
|
|
112
112
|
color: props.focusColor,
|
|
113
113
|
},
|
|
@@ -215,7 +215,7 @@ var useDatePickerDialogStyles = function (props) {
|
|
|
215
215
|
}); });
|
|
216
216
|
};
|
|
217
217
|
function CustomDatePicker(_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,
|
|
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, _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", "textColor", "contrastColor", "accentColor", "errorColor", "borderRadius", "padding", "fontSize", "shrunkenFontSize", "helperTextColor", "fontWeight", "height", "cantEdit", "pickTime", "onChange", "required"]);
|
|
219
219
|
var classes = useDatePickerStyles({
|
|
220
220
|
padding: padding,
|
|
221
221
|
cantEdit: cantEdit,
|
|
@@ -224,7 +224,6 @@ function CustomDatePicker(_a) {
|
|
|
224
224
|
hoverColor: focusColor + '0a',
|
|
225
225
|
outlineColor: outlineColor,
|
|
226
226
|
errorColor: errorColor,
|
|
227
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
228
227
|
backgroundColor: backgroundColor,
|
|
229
228
|
borderRadius: borderRadius,
|
|
230
229
|
fontSize: fontSize,
|
|
@@ -241,7 +240,6 @@ function CustomDatePicker(_a) {
|
|
|
241
240
|
hoverColor: focusColor + '0a',
|
|
242
241
|
errorColor: errorColor,
|
|
243
242
|
outlineColor: outlineColor,
|
|
244
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
245
243
|
backgroundColor: backgroundColor,
|
|
246
244
|
borderRadius: borderRadius,
|
|
247
245
|
fontSize: fontSize,
|
|
@@ -261,7 +259,6 @@ function CustomDatePicker(_a) {
|
|
|
261
259
|
hoverColor: focusColor + '0a',
|
|
262
260
|
errorColor: errorColor,
|
|
263
261
|
outlineColor: outlineColor,
|
|
264
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
265
262
|
backgroundColor: backgroundColor,
|
|
266
263
|
borderRadius: borderRadius,
|
|
267
264
|
fontSize: fontSize,
|
|
@@ -276,7 +273,6 @@ function CustomDatePicker(_a) {
|
|
|
276
273
|
focusColor: focusColor,
|
|
277
274
|
errorColor: errorColor,
|
|
278
275
|
outlineColor: outlineColor,
|
|
279
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
280
276
|
backgroundColor: backgroundColor,
|
|
281
277
|
borderRadius: borderRadius,
|
|
282
278
|
fontSize: fontSize,
|
|
@@ -19,8 +19,6 @@ interface StyleProps {
|
|
|
19
19
|
fontSize?: string;
|
|
20
20
|
/** The weight of the font of the value and the placeholder */
|
|
21
21
|
fontWeight?: any;
|
|
22
|
-
/** The color of the inner input */
|
|
23
|
-
innerBackgroundColor?: string;
|
|
24
22
|
/** If input is readOnly */
|
|
25
23
|
readOnly?: boolean;
|
|
26
24
|
/** The color of the helper text when not error */
|
|
@@ -58,8 +56,6 @@ interface RoundedSelectProps extends Omit<SelectProps, 'color'>, StyleProps {
|
|
|
58
56
|
iconComponent?: any;
|
|
59
57
|
/** the components ref */
|
|
60
58
|
ref?: any;
|
|
61
|
-
/** The color of the inner input */
|
|
62
|
-
innerBackgroundColor?: string;
|
|
63
59
|
}
|
|
64
60
|
/**
|
|
65
61
|
* Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
|
|
@@ -62,7 +62,7 @@ var useOutlinedInputStyles = function (props) {
|
|
|
62
62
|
cursor: props.cantEdit ? 'default' : 'default',
|
|
63
63
|
height: props.height,
|
|
64
64
|
borderRadius: props.borderRadius,
|
|
65
|
-
backgroundColor: props.
|
|
65
|
+
backgroundColor: props.backgroundColor,
|
|
66
66
|
fontSize: props.fontSize,
|
|
67
67
|
'& $notchedOutline': {
|
|
68
68
|
borderColor: props.outlineColor,
|
|
@@ -92,6 +92,9 @@ var useOutlinedInputStyles = function (props) {
|
|
|
92
92
|
'&$focused $notchedOutline': {
|
|
93
93
|
borderColor: props.focusColor,
|
|
94
94
|
},
|
|
95
|
+
'& .EF-MuiSelect-icon': {
|
|
96
|
+
color: props.color + '8a',
|
|
97
|
+
},
|
|
95
98
|
'& .EF-MuiSelect-icon.Mui-disabled': {
|
|
96
99
|
color: props.outlineColor,
|
|
97
100
|
},
|
|
@@ -113,6 +116,7 @@ var useLabelInputStyles = function (props) {
|
|
|
113
116
|
color: props.focusColor + ' !important',
|
|
114
117
|
},
|
|
115
118
|
root: {
|
|
119
|
+
color: props.color + '8a',
|
|
116
120
|
fontWeight: props.fontWeight,
|
|
117
121
|
whiteSpace: 'nowrap',
|
|
118
122
|
overflow: 'hidden',
|
|
@@ -143,7 +147,7 @@ var useHelperTextStyles = function (props) {
|
|
|
143
147
|
}); });
|
|
144
148
|
};
|
|
145
149
|
function CustomSelect(_a) {
|
|
146
|
-
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,
|
|
150
|
+
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, _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", "paddingLeft", "cantEdit", "showIcon", "containerMargin", "height", "fontSize", "required", "iconComponent", "error"]);
|
|
147
151
|
var styleProps = {
|
|
148
152
|
color: color,
|
|
149
153
|
height: height,
|
|
@@ -158,7 +162,6 @@ function CustomSelect(_a) {
|
|
|
158
162
|
helperTextColor: helperTextColor,
|
|
159
163
|
backgroundColor: backgroundColor,
|
|
160
164
|
showIcon: showIcon && iconComponent !== undefined,
|
|
161
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
162
165
|
};
|
|
163
166
|
var classes = useStyles();
|
|
164
167
|
var outlinedInputClasses = useOutlinedInputStyles(styleProps)();
|
|
@@ -17,8 +17,6 @@ interface StyleProps {
|
|
|
17
17
|
color?: string;
|
|
18
18
|
/** The fontsize of the content */
|
|
19
19
|
fontSize?: string;
|
|
20
|
-
/** The color of the inner input */
|
|
21
|
-
innerBackgroundColor?: string;
|
|
22
20
|
/** The borderRadius of the input */
|
|
23
21
|
borderRadius?: number;
|
|
24
22
|
/** If input is readOnly */
|
|
@@ -64,5 +62,5 @@ export interface RoundedSmartSelectProps extends Omit<TextFieldProps, 'color' |
|
|
|
64
62
|
changeListener?: (value: any) => void;
|
|
65
63
|
onFocus?: any;
|
|
66
64
|
}
|
|
67
|
-
export default function RoundedSmartSelect({ options, value, handleUpdate, label, getValueString, color, errorColor, focusColor, helperTextColor, outlineColor, backgroundColor, cantEdit, loading, height, fontSize, required, changeListener, error,
|
|
65
|
+
export default function RoundedSmartSelect({ options, value, handleUpdate, label, getValueString, color, errorColor, focusColor, helperTextColor, outlineColor, backgroundColor, cantEdit, loading, height, fontSize, required, changeListener, error, getOptionSelected, helperText, readOnly, borderRadius, fontWeight, icon, searchable, containerMargin, showIcon, inputRef, disabled, creatable, onBlur, name, onFocus, }: RoundedSmartSelectProps): JSX.Element;
|
|
68
66
|
export {};
|
|
@@ -33,7 +33,6 @@ var useTextfieldStyles = function (props) {
|
|
|
33
33
|
return makeStyles(function () { return ({
|
|
34
34
|
root: {
|
|
35
35
|
borderRadius: props.borderRadius,
|
|
36
|
-
backgroundColor: props.backgroundColor,
|
|
37
36
|
'& input, textarea': {
|
|
38
37
|
cursor: props.cantEdit ? 'default' : 'text',
|
|
39
38
|
fontWeight: props.fontWeight,
|
|
@@ -42,7 +41,7 @@ var useTextfieldStyles = function (props) {
|
|
|
42
41
|
'&::placeholder': {
|
|
43
42
|
fontSize: props.fontSize,
|
|
44
43
|
},
|
|
45
|
-
backgroundColor: props.
|
|
44
|
+
backgroundColor: props.backgroundColor,
|
|
46
45
|
borderRadius: props.borderRadius,
|
|
47
46
|
height: props.height,
|
|
48
47
|
marginTop: '0px !important',
|
|
@@ -55,6 +54,7 @@ var useTextfieldStyles = function (props) {
|
|
|
55
54
|
'& label': {
|
|
56
55
|
marginTop: '-4px',
|
|
57
56
|
fontSize: props.fontSize,
|
|
57
|
+
color: props.color + '8a',
|
|
58
58
|
whiteSpace: 'nowrap',
|
|
59
59
|
overflow: 'hidden',
|
|
60
60
|
textOverflow: 'ellipsis',
|
|
@@ -112,8 +112,9 @@ var useTextfieldStyles = function (props) {
|
|
|
112
112
|
'& .EF-MuiOutlinedInput-notchedOutline': {
|
|
113
113
|
borderColor: '#0000003b',
|
|
114
114
|
},
|
|
115
|
-
'.EF-MuiAutocomplete-popupIndicator': {
|
|
115
|
+
'& .EF-MuiAutocomplete-popupIndicator': {
|
|
116
116
|
padding: 0,
|
|
117
|
+
color: props.color + '8a',
|
|
117
118
|
},
|
|
118
119
|
'& .EF-MuiAutocomplete-popupIndicatorOpen': {
|
|
119
120
|
transform: props.showIcon ? 'none' : 'rotate(180deg)',
|
|
@@ -123,19 +124,19 @@ var useTextfieldStyles = function (props) {
|
|
|
123
124
|
},
|
|
124
125
|
'& .EF-MuiAutocomplete-endAdornment': {
|
|
125
126
|
top: 'calc(50% - 13px)',
|
|
127
|
+
color: props.color + '8a',
|
|
126
128
|
},
|
|
127
129
|
},
|
|
128
130
|
}); });
|
|
129
131
|
};
|
|
130
132
|
export default function RoundedSmartSelect(_a) {
|
|
131
|
-
var options = _a.options, _b = _a.value, value = _b === void 0 ? '' : _b, handleUpdate = _a.handleUpdate, label = _a.label, _c = _a.getValueString, getValueString = _c === void 0 ? function (value) { return value.value; } : _c, _d = _a.color, color = _d === void 0 ? '#293241' : _d, _e = _a.errorColor, errorColor = _e === void 0 ? '#cc2936' : _e, _f = _a.focusColor, focusColor = _f === void 0 ? '#3d5a7f' : _f, _g = _a.helperTextColor, helperTextColor = _g === void 0 ? '#989898' : _g, _h = _a.outlineColor, outlineColor = _h === void 0 ? '#b8b8b8' : _h, _j = _a.backgroundColor, backgroundColor = _j === void 0 ? '#ffffff' : _j, _k = _a.cantEdit, cantEdit = _k === void 0 ? false : _k, _l = _a.loading, loading = _l === void 0 ? false : _l, _m = _a.height, height = _m === void 0 ? '31px' : _m, _o = _a.fontSize, fontSize = _o === void 0 ? '1rem' : _o, required = _a.required, changeListener = _a.changeListener, error = _a.error,
|
|
133
|
+
var options = _a.options, _b = _a.value, value = _b === void 0 ? '' : _b, handleUpdate = _a.handleUpdate, label = _a.label, _c = _a.getValueString, getValueString = _c === void 0 ? function (value) { return value.value; } : _c, _d = _a.color, color = _d === void 0 ? '#293241' : _d, _e = _a.errorColor, errorColor = _e === void 0 ? '#cc2936' : _e, _f = _a.focusColor, focusColor = _f === void 0 ? '#3d5a7f' : _f, _g = _a.helperTextColor, helperTextColor = _g === void 0 ? '#989898' : _g, _h = _a.outlineColor, outlineColor = _h === void 0 ? '#b8b8b8' : _h, _j = _a.backgroundColor, backgroundColor = _j === void 0 ? '#ffffff' : _j, _k = _a.cantEdit, cantEdit = _k === void 0 ? false : _k, _l = _a.loading, loading = _l === void 0 ? false : _l, _m = _a.height, height = _m === void 0 ? '31px' : _m, _o = _a.fontSize, fontSize = _o === void 0 ? '1rem' : _o, required = _a.required, changeListener = _a.changeListener, error = _a.error, getOptionSelected = _a.getOptionSelected, helperText = _a.helperText, _p = _a.readOnly, readOnly = _p === void 0 ? false : _p, _q = _a.borderRadius, borderRadius = _q === void 0 ? 10 : _q, _r = _a.fontWeight, fontWeight = _r === void 0 ? '400' : _r, icon = _a.icon, _s = _a.searchable, searchable = _s === void 0 ? false : _s, _t = _a.containerMargin, containerMargin = _t === void 0 ? '0px' : _t, _u = _a.showIcon, showIcon = _u === void 0 ? true : _u, inputRef = _a.inputRef, disabled = _a.disabled, _v = _a.creatable, creatable = _v === void 0 ? false : _v, onBlur = _a.onBlur, name = _a.name, onFocus = _a.onFocus;
|
|
132
134
|
var props = {
|
|
133
135
|
color: color,
|
|
134
136
|
height: height,
|
|
135
137
|
errorColor: errorColor,
|
|
136
138
|
focusColor: focusColor,
|
|
137
139
|
outlineColor: outlineColor,
|
|
138
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
139
140
|
helperTextColor: helperTextColor,
|
|
140
141
|
backgroundColor: backgroundColor,
|
|
141
142
|
borderRadius: borderRadius,
|
|
@@ -208,7 +209,7 @@ export default function RoundedSmartSelect(_a) {
|
|
|
208
209
|
}));
|
|
209
210
|
}, onOpen: function () {
|
|
210
211
|
//Show loading icon if loading
|
|
211
|
-
}, value: getValueString(value), color: color, errorColor: errorColor, focusColor: focusColor, helperTextColor: helperTextColor, backgroundColor: backgroundColor, outlineColor: outlineColor,
|
|
212
|
+
}, value: getValueString(value), color: color, errorColor: errorColor, focusColor: focusColor, helperTextColor: helperTextColor, backgroundColor: backgroundColor, outlineColor: outlineColor, cantEdit: cantEdit, disabled: cantEdit || disabled, label: label, required: required, readOnly: readOnly, helperText: helperText, containerMargin: containerMargin, height: height, fontSize: fontSize, error: error, iconComponent: loading
|
|
212
213
|
? function () { return (_jsx("div", __assign({ style: {
|
|
213
214
|
marginTop: 3,
|
|
214
215
|
marginRight: 8,
|
|
@@ -11,8 +11,6 @@ interface StyleProps {
|
|
|
11
11
|
outlineColor?: string;
|
|
12
12
|
/** The backgroundColor of the input */
|
|
13
13
|
backgroundColor?: string;
|
|
14
|
-
/** The color of the inner input */
|
|
15
|
-
innerBackgroundColor?: string;
|
|
16
14
|
/** The borderRadius of the input */
|
|
17
15
|
borderRadius?: number;
|
|
18
16
|
/** If input is readOnly */
|
|
@@ -43,7 +43,6 @@ var useTextfieldStyles = function (props) {
|
|
|
43
43
|
return makeStyles(function () { return ({
|
|
44
44
|
root: {
|
|
45
45
|
borderRadius: props.borderRadius,
|
|
46
|
-
backgroundColor: props.backgroundColor,
|
|
47
46
|
'& input, textarea': {
|
|
48
47
|
cursor: props.cantEdit ? 'default' : 'text',
|
|
49
48
|
padding: props.multiline ? props.padding : props.padding,
|
|
@@ -53,12 +52,13 @@ var useTextfieldStyles = function (props) {
|
|
|
53
52
|
'&::placeholder': {
|
|
54
53
|
fontSize: props.fontSize,
|
|
55
54
|
},
|
|
56
|
-
backgroundColor: props.
|
|
55
|
+
backgroundColor: props.backgroundColor,
|
|
57
56
|
borderRadius: props.borderRadius,
|
|
58
57
|
},
|
|
59
58
|
'& label': {
|
|
60
59
|
marginTop: props.multiline ? '0px' : '-4px',
|
|
61
60
|
fontSize: props.fontSize,
|
|
61
|
+
color: props.textColor + '8a',
|
|
62
62
|
whiteSpace: 'nowrap',
|
|
63
63
|
overflow: 'hidden',
|
|
64
64
|
textOverflow: 'ellipsis',
|
|
@@ -110,20 +110,19 @@ var useTextfieldStyles = function (props) {
|
|
|
110
110
|
},
|
|
111
111
|
'& .EF-MuiOutlinedInput-multiline': {
|
|
112
112
|
padding: 0,
|
|
113
|
-
backgroundColor: props.
|
|
113
|
+
backgroundColor: props.backgroundColor,
|
|
114
114
|
},
|
|
115
115
|
},
|
|
116
116
|
}); });
|
|
117
117
|
};
|
|
118
118
|
function CustomTextfield(_a) {
|
|
119
|
-
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.helperTextColor, helperTextColor = _c === void 0 ? '#989898' : _c, _d = _a.outlineColor, outlineColor = _d === void 0 ? '#0000003b' : _d, _e = _a.backgroundColor, backgroundColor = _e === void 0 ? '
|
|
119
|
+
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.helperTextColor, helperTextColor = _c === void 0 ? '#989898' : _c, _d = _a.outlineColor, outlineColor = _d === void 0 ? '#0000003b' : _d, _e = _a.backgroundColor, backgroundColor = _e === void 0 ? 'white' : _e, _f = _a.textColor, textColor = _f === void 0 ? '#293241' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.borderRadius, borderRadius = _h === void 0 ? 10 : _h, _j = _a.padding, padding = _j === void 0 ? '6px 12px' : _j, _k = _a.fontSize, fontSize = _k === void 0 ? '1rem' : _k, _l = _a.errorColor, errorColor = _l === void 0 ? '#cc2936' : _l, _m = _a.fontWeight, fontWeight = _m === void 0 ? '300' : _m, _o = _a.multiline, multiline = _o === void 0 ? false : _o, _p = _a.cantEdit, cantEdit = _p === void 0 ? false : _p, maxLength = _a.maxLength, value = _a.value, icon = _a.icon, others = __rest(_a, ["focusColor", "helperTextColor", "outlineColor", "backgroundColor", "textColor", "readOnly", "borderRadius", "padding", "fontSize", "errorColor", "fontWeight", "multiline", "cantEdit", "maxLength", "value", "icon"]);
|
|
120
120
|
var classes = useTextfieldStyles({
|
|
121
121
|
padding: padding,
|
|
122
122
|
textColor: textColor,
|
|
123
123
|
errorColor: errorColor,
|
|
124
124
|
focusColor: focusColor,
|
|
125
125
|
outlineColor: outlineColor,
|
|
126
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
127
126
|
helperTextColor: helperTextColor,
|
|
128
127
|
backgroundColor: backgroundColor,
|
|
129
128
|
borderRadius: borderRadius,
|
package/package.json
CHANGED