@arquimedes.co/eureka-forms 3.0.34-test → 3.0.35-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App/AppHooks.js +3 -0
- package/dist/Form/Form.d.ts +1 -1
- package/dist/Form/Form.js +5 -2
- package/dist/Form/FormHooks.d.ts +1 -1
- package/dist/Form/FormHooks.js +1 -0
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +2 -0
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +2 -0
- package/dist/Form/Terms/Terms.js +7 -3
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +23 -29
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/addRecursiveElementStep.d.ts +2 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/addRecursiveElementStep.js +22 -0
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +2 -2
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +6 -1
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +8 -9
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +3 -3
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +1 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +44 -42
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +4 -4
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +5 -1
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +10 -4
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +7 -1
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +9 -2
- package/dist/FormSteps/StepHooks.js +11 -4
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +3 -1
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +1 -0
- package/dist/Shared/CustomBtn/CustomBtn.js +1 -0
- package/dist/Shared/{ErkDatePickerRange/ErkDatePickerRange.d.ts → ErkDateRangePicker/ErkDateRangePicker.d.ts} +3 -3
- package/dist/Shared/{ErkDatePickerRange/ErkDatePickerRange.js → ErkDateRangePicker/ErkDateRangePicker.js} +2 -2
- package/dist/Shared/{ErkDatePickerRange/ErkDatePickerRange.stories.d.ts → ErkDateRangePicker/ErkDateRangePicker.stories.d.ts} +2 -2
- package/dist/Shared/{ErkDatePickerRange/ErkDatePickerRange.stories.js → ErkDateRangePicker/ErkDateRangePicker.stories.js} +23 -23
- package/dist/Shared/ErkMenuItem.d.ts +1 -3
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +2 -6
- package/dist/Shared/ErkSelect/ErkSelect.js +1 -0
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +1 -1
- package/dist/Shared/ErkTextField/ErkTextField.js +13 -10
- package/dist/Shared/ErkTimePicker/ErkTimePicker.js +4 -4
- package/dist/Widget.js +3 -3
- package/package.json +73 -66
|
@@ -28,6 +28,7 @@ export const useStepDependency = (step, defaultValue) => {
|
|
|
28
28
|
return () => {
|
|
29
29
|
dispatch(clearDependency(step));
|
|
30
30
|
};
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
32
|
}, [isDependency]);
|
|
32
33
|
const handleStepDep = useCallback((value) => {
|
|
33
34
|
if (!isDependency)
|
|
@@ -36,7 +37,9 @@ export const useStepDependency = (step, defaultValue) => {
|
|
|
36
37
|
step,
|
|
37
38
|
value: value ?? null,
|
|
38
39
|
}));
|
|
39
|
-
},
|
|
40
|
+
},
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
+
[step.id, step.type, isDependency]);
|
|
40
43
|
return {
|
|
41
44
|
handleStepDep,
|
|
42
45
|
isDependency,
|
|
@@ -102,7 +105,9 @@ export const useFormStep = (step, { rules, debounce, sizeChange, defaultValue })
|
|
|
102
105
|
fieldOnChange(value);
|
|
103
106
|
if (sizeChange)
|
|
104
107
|
handleSizeChange?.();
|
|
105
|
-
},
|
|
108
|
+
},
|
|
109
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
110
|
+
[handleStepDep, isDependency, fieldOnChange]);
|
|
106
111
|
return {
|
|
107
112
|
ref,
|
|
108
113
|
value,
|
|
@@ -120,11 +125,13 @@ export const selectDependencies = createSelector([
|
|
|
120
125
|
[idDep]: dependencies[idDep],
|
|
121
126
|
}), {}));
|
|
122
127
|
export const useCondition = (condition) => {
|
|
123
|
-
const ids = useMemo(() => recursivelyCalcConditionSteps(condition), []);
|
|
128
|
+
const ids = useMemo(() => recursivelyCalcConditionSteps(condition), [condition]);
|
|
124
129
|
const dependencies = useAppSelector((state) => selectDependencies(state, ids));
|
|
130
|
+
const dependenciesValues = useMemo(() => ids.map((id) => dependencies[id].value), [dependencies, ids]);
|
|
125
131
|
return useMemo(() => {
|
|
126
132
|
return !condition || evaluateCondition(condition, dependencies);
|
|
127
|
-
|
|
133
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
134
|
+
}, [dependenciesValues]);
|
|
128
135
|
};
|
|
129
136
|
export const calcStepDeps = (step) => {
|
|
130
137
|
const dependencies = [...(step.dependencies ?? [])];
|
|
@@ -35,7 +35,9 @@ function TextAreaStep({ step, editable }) {
|
|
|
35
35
|
}, 1000));
|
|
36
36
|
}
|
|
37
37
|
onChange(value);
|
|
38
|
-
},
|
|
38
|
+
},
|
|
39
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
+
[handleStepDep, isDependency, onChange]);
|
|
39
41
|
const calcStyle = () => {
|
|
40
42
|
const backgroundColor = formStyle.stepBackgroundColor;
|
|
41
43
|
if (focus) {
|
|
@@ -13,6 +13,7 @@ function StepFiller({ step, children }) {
|
|
|
13
13
|
const currentBreakPoint = useAppSelector(selectBreakPoint);
|
|
14
14
|
const handleSizeChange = useCallback(() => {
|
|
15
15
|
setFillerSize(calcFillerSize(step, form.steps, getValues(), form.size));
|
|
16
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
17
|
}, []);
|
|
17
18
|
if (step.maxSize && step.maxSize < form.size.blockNum) {
|
|
18
19
|
return (_jsxs("div", { className: styles.firstLvlContainer, style: {
|
|
@@ -9,6 +9,7 @@ function CustomBtn({ label, onClick, backgroundColor, color, loading = false, di
|
|
|
9
9
|
if (coords)
|
|
10
10
|
setCoords(undefined);
|
|
11
11
|
return () => setMounted(false);
|
|
12
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12
13
|
}, [label]);
|
|
13
14
|
return (_jsxs("button", { className: styles.customBtn, style: {
|
|
14
15
|
width,
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MobileDateRangePickerProps as MuiDateRangePickerProps } from '@mui/x-date-pickers-pro/MobileDateRangePicker';
|
|
3
3
|
import { DateRange } from '@mui/x-date-pickers-pro';
|
|
4
4
|
import { ErkTextFieldProps } from '../ErkTextField/ErkTextField';
|
|
5
|
-
interface
|
|
5
|
+
interface ErkDateRangePickerProps extends Omit<MuiDateRangePickerProps<boolean>, 'ref' | 'onChange' | 'value' | 'slotProps'>, Pick<ErkTextFieldProps, 'error' | 'required' | 'helperText' | 'size'> {
|
|
6
6
|
onChange?: (dateRange: DateRange<Date>) => void;
|
|
7
7
|
value?: DateRange<Date>;
|
|
8
8
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
@@ -12,7 +12,7 @@ interface ErkDatePickerRangeProps extends Omit<MuiDateRangePickerProps<boolean>,
|
|
|
12
12
|
/**
|
|
13
13
|
* Generic datepicker with apps designs. Is class due to the use in the react-hook-forms library
|
|
14
14
|
*/
|
|
15
|
-
declare class
|
|
15
|
+
declare class ErkDateRangePicker extends React.Component<ErkDateRangePickerProps> {
|
|
16
16
|
render(): JSX.Element;
|
|
17
17
|
}
|
|
18
|
-
export default
|
|
18
|
+
export default ErkDateRangePicker;
|
|
@@ -165,9 +165,9 @@ function CustomDatePickerRange({ error, disabled, readOnly, helperText, size = '
|
|
|
165
165
|
/**
|
|
166
166
|
* Generic datepicker with apps designs. Is class due to the use in the react-hook-forms library
|
|
167
167
|
*/
|
|
168
|
-
class
|
|
168
|
+
class ErkDateRangePicker extends React.Component {
|
|
169
169
|
render() {
|
|
170
170
|
return _jsx(CustomDatePickerRange, { ...this.props });
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
export default
|
|
173
|
+
export default ErkDateRangePicker;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import
|
|
2
|
+
import ErkDateRangePicker from './ErkDateRangePicker';
|
|
3
3
|
declare const meta: {
|
|
4
|
-
component: typeof
|
|
4
|
+
component: typeof ErkDateRangePicker;
|
|
5
5
|
tags: string[];
|
|
6
6
|
args: {
|
|
7
7
|
readOnly: false;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import ErkDateRangePicker from './ErkDateRangePicker';
|
|
3
3
|
import { useArgs } from 'storybook/internal/preview-api';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
const meta = {
|
|
6
|
-
component:
|
|
6
|
+
component: ErkDateRangePicker,
|
|
7
7
|
tags: ['autodocs'],
|
|
8
8
|
args: {
|
|
9
9
|
readOnly: false,
|
|
@@ -26,7 +26,7 @@ export const Default = {
|
|
|
26
26
|
},
|
|
27
27
|
render: function Component(args) {
|
|
28
28
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
29
|
-
return _jsx(
|
|
29
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
export const Interactive = {
|
|
@@ -41,7 +41,7 @@ export const Interactive = {
|
|
|
41
41
|
setValue(newValue);
|
|
42
42
|
args.onChange?.(newValue);
|
|
43
43
|
};
|
|
44
|
-
return (_jsxs("div", { children: [_jsx(
|
|
44
|
+
return (_jsxs("div", { children: [_jsx(ErkDateRangePicker, { ...args, value: value, onChange: handleChange }), _jsxs("div", { style: { marginTop: '20px', fontSize: '14px' }, children: [_jsx("strong", { children: "Valor seleccionado:" }), _jsxs("div", { children: ["Inicio: ", value[0]?.toLocaleDateString('es-ES') ?? 'No seleccionado'] }), _jsxs("div", { children: ["Fin: ", value[1]?.toLocaleDateString('es-ES') ?? 'No seleccionado'] })] })] }));
|
|
45
45
|
},
|
|
46
46
|
};
|
|
47
47
|
export const ValueAndLabel = {
|
|
@@ -55,7 +55,7 @@ export const ValueAndLabel = {
|
|
|
55
55
|
args.onChange?.(value);
|
|
56
56
|
setArgs({ value });
|
|
57
57
|
};
|
|
58
|
-
return _jsx(
|
|
58
|
+
return _jsx(ErkDateRangePicker, { ...args, onChange: onValueChange });
|
|
59
59
|
},
|
|
60
60
|
};
|
|
61
61
|
export const Full = {
|
|
@@ -66,7 +66,7 @@ export const Full = {
|
|
|
66
66
|
},
|
|
67
67
|
render: function Component(args) {
|
|
68
68
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
69
|
-
return _jsx(
|
|
69
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
70
70
|
},
|
|
71
71
|
};
|
|
72
72
|
export const Error = {
|
|
@@ -78,7 +78,7 @@ export const Error = {
|
|
|
78
78
|
},
|
|
79
79
|
render: function Component(args) {
|
|
80
80
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
81
|
-
return _jsx(
|
|
81
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
82
82
|
},
|
|
83
83
|
};
|
|
84
84
|
export const Menu = {
|
|
@@ -88,7 +88,7 @@ export const Menu = {
|
|
|
88
88
|
},
|
|
89
89
|
render: function Component(args) {
|
|
90
90
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
91
|
-
return _jsx(
|
|
91
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
92
92
|
},
|
|
93
93
|
play: async ({ canvas, userEvent }) => {
|
|
94
94
|
const selector = canvas.getByTestId('date-picker');
|
|
@@ -107,7 +107,7 @@ export const WithSelectedRange = {
|
|
|
107
107
|
args.onChange?.(value);
|
|
108
108
|
setArgs({ value });
|
|
109
109
|
};
|
|
110
|
-
return _jsx(
|
|
110
|
+
return _jsx(ErkDateRangePicker, { ...args, onChange: onValueChange });
|
|
111
111
|
},
|
|
112
112
|
};
|
|
113
113
|
export const Disabled = {
|
|
@@ -119,7 +119,7 @@ export const Disabled = {
|
|
|
119
119
|
},
|
|
120
120
|
render: function Component(args) {
|
|
121
121
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
122
|
-
return _jsx(
|
|
122
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
123
123
|
},
|
|
124
124
|
};
|
|
125
125
|
export const ReadOnly = {
|
|
@@ -131,7 +131,7 @@ export const ReadOnly = {
|
|
|
131
131
|
},
|
|
132
132
|
render: function Component(args) {
|
|
133
133
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
134
|
-
return _jsx(
|
|
134
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
135
135
|
},
|
|
136
136
|
};
|
|
137
137
|
export const WithError = {
|
|
@@ -143,7 +143,7 @@ export const WithError = {
|
|
|
143
143
|
},
|
|
144
144
|
render: function Component(args) {
|
|
145
145
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
146
|
-
return _jsx(
|
|
146
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
147
147
|
},
|
|
148
148
|
};
|
|
149
149
|
export const Required = {
|
|
@@ -155,7 +155,7 @@ export const Required = {
|
|
|
155
155
|
},
|
|
156
156
|
render: function Component(args) {
|
|
157
157
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
158
|
-
return _jsx(
|
|
158
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
159
159
|
},
|
|
160
160
|
};
|
|
161
161
|
export const SmallSize = {
|
|
@@ -167,7 +167,7 @@ export const SmallSize = {
|
|
|
167
167
|
},
|
|
168
168
|
render: function Component(args) {
|
|
169
169
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
170
|
-
return _jsx(
|
|
170
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
171
171
|
},
|
|
172
172
|
};
|
|
173
173
|
export const MediumSize = {
|
|
@@ -179,7 +179,7 @@ export const MediumSize = {
|
|
|
179
179
|
},
|
|
180
180
|
render: function Component(args) {
|
|
181
181
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
182
|
-
return _jsx(
|
|
182
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
183
183
|
},
|
|
184
184
|
};
|
|
185
185
|
export const CurrentMonth = {
|
|
@@ -190,7 +190,7 @@ export const CurrentMonth = {
|
|
|
190
190
|
},
|
|
191
191
|
render: function Component(args) {
|
|
192
192
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
193
|
-
return _jsx(
|
|
193
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
194
194
|
},
|
|
195
195
|
};
|
|
196
196
|
export const LastWeek = {
|
|
@@ -201,7 +201,7 @@ export const LastWeek = {
|
|
|
201
201
|
},
|
|
202
202
|
render: function Component(args) {
|
|
203
203
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
204
|
-
return _jsx(
|
|
204
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
205
205
|
},
|
|
206
206
|
};
|
|
207
207
|
export const NextMonth = {
|
|
@@ -215,7 +215,7 @@ export const NextMonth = {
|
|
|
215
215
|
},
|
|
216
216
|
render: function Component(args) {
|
|
217
217
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
218
|
-
return _jsx(
|
|
218
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
219
219
|
},
|
|
220
220
|
};
|
|
221
221
|
export const WithMinMaxDates = {
|
|
@@ -228,7 +228,7 @@ export const WithMinMaxDates = {
|
|
|
228
228
|
},
|
|
229
229
|
render: function Component(args) {
|
|
230
230
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
231
|
-
return _jsx(
|
|
231
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
232
232
|
},
|
|
233
233
|
};
|
|
234
234
|
export const YearRange = {
|
|
@@ -239,7 +239,7 @@ export const YearRange = {
|
|
|
239
239
|
},
|
|
240
240
|
render: function Component(args) {
|
|
241
241
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
242
|
-
return _jsx(
|
|
242
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
243
243
|
},
|
|
244
244
|
};
|
|
245
245
|
export const QuarterRange = {
|
|
@@ -250,7 +250,7 @@ export const QuarterRange = {
|
|
|
250
250
|
},
|
|
251
251
|
render: function Component(args) {
|
|
252
252
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
253
|
-
return _jsx(
|
|
253
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
254
254
|
},
|
|
255
255
|
};
|
|
256
256
|
export const EventDuration = {
|
|
@@ -261,7 +261,7 @@ export const EventDuration = {
|
|
|
261
261
|
},
|
|
262
262
|
render: function Component(args) {
|
|
263
263
|
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
264
|
-
return _jsx(
|
|
264
|
+
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
265
265
|
},
|
|
266
266
|
};
|
|
267
267
|
export const MultipleStates = {
|
|
@@ -269,6 +269,6 @@ export const MultipleStates = {
|
|
|
269
269
|
const [range1, setRange1] = useState([null, null]);
|
|
270
270
|
const [range2, setRange2] = useState([new Date('2025-01-01'), new Date('2025-01-31')]);
|
|
271
271
|
const [range3, setRange3] = useState([null, null]);
|
|
272
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '20px' }, children: [_jsx(
|
|
272
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '20px' }, children: [_jsx(ErkDateRangePicker, { label: "Fecha de Inicio del Proyecto", value: range1, onChange: setRange1, helperText: "Seleccione el per\u00EDodo del proyecto" }), _jsx(ErkDateRangePicker, { label: "Per\u00EDodo de Pruebas", value: range2, onChange: setRange2, helperText: "Enero 2025" }), _jsx(ErkDateRangePicker, { label: "Fecha de Entrega", value: range3, onChange: setRange3, error: range3[0] === null, helperText: range3[0] === null ? 'Este campo es obligatorio' : 'Fecha confirmada', required: true })] }));
|
|
273
273
|
},
|
|
274
274
|
};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const Styled: import("@emotion/styled").StyledComponent<import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
2
|
-
ref?: ((instance: HTMLLIElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
3
|
-
}, "children" | "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "dense" | "disableGutters" | "divider" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
1
|
+
declare const Styled: import("@emotion/styled").StyledComponent<import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "children" | "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "dense" | "disableGutters" | "divider" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
4
2
|
export default Styled;
|
|
@@ -5,16 +5,12 @@ export interface SelectorStyleProps {
|
|
|
5
5
|
readOnly?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const StyledSelect: import("@emotion/styled").StyledComponent<(import("@mui/material").FilledSelectProps & import("@mui/material").BaseSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>) | (import("@mui/material").StandardSelectProps & import("@mui/material").BaseSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>) | (import("@mui/material").OutlinedSelectProps & import("@mui/material").BaseSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>), {}, {}>;
|
|
8
|
-
export declare const StyledInputLabel: import("@emotion/styled").StyledComponent<import("@mui/material").InputLabelOwnProps & Pick<import("@mui/material").FormLabelOwnProps, "color" | "filled"> & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
9
|
-
ref?: ((instance: HTMLLabelElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLLabelElement> | null | undefined;
|
|
10
|
-
}, "required" | "size" | "color" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused" | "disableAnimation" | "shrink"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
|
+
export declare const StyledInputLabel: import("@emotion/styled").StyledComponent<import("@mui/material").InputLabelOwnProps & Pick<import("@mui/material").FormLabelOwnProps, "color" | "filled"> & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "required" | "size" | "color" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused" | "disableAnimation" | "shrink"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
11
9
|
component?: React.ElementType;
|
|
12
10
|
} & {
|
|
13
11
|
open: boolean;
|
|
14
12
|
}, {}, {}>;
|
|
15
|
-
export declare const StyledHelperText: import("@emotion/styled").StyledComponent<import("@mui/material").FormHelperTextOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
16
|
-
ref?: ((instance: HTMLParagraphElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLParagraphElement> | null | undefined;
|
|
17
|
-
}, "required" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
13
|
+
export declare const StyledHelperText: import("@emotion/styled").StyledComponent<import("@mui/material").FormHelperTextOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "required" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
18
14
|
component?: React.ElementType;
|
|
19
15
|
}, {}, {}>;
|
|
20
16
|
export type ErkSelectValue<Type extends string | number, Multiple, Clearable> = Multiple extends true ? Type[] : Clearable extends true ? Type | undefined : Type;
|
|
@@ -39,6 +39,7 @@ export const StyledSelect = styled(MuiSelect)(({ theme, size, ...props }) => ({
|
|
|
39
39
|
},
|
|
40
40
|
'& .Mui-disabled, &.Mui-readOnly': {
|
|
41
41
|
cursor: 'default',
|
|
42
|
+
pointerEvents: 'none',
|
|
42
43
|
},
|
|
43
44
|
'&.Erk-MuiInputBase-root.Mui-focused': {
|
|
44
45
|
'& .Erk-MuiOutlinedInput-notchedOutline': {
|
|
@@ -28,7 +28,7 @@ const StyledAutoComplete = styled(MuiAutocomplete)(({ theme, readOnly, ...props
|
|
|
28
28
|
export default function ErkSmartSelect({ options, value = '', onChange, label, getValueString = (value) => value?.value, loading = false, getOptionSelected, IconComponent, size = 'small', disabled = false, readOnly = false, searchable = false, inputRef, ...others }) {
|
|
29
29
|
if (searchable) {
|
|
30
30
|
return (_jsx(StyledAutoComplete, { fullWidth: true, openOnFocus: true, size: size, loading: loading, disabled: disabled || readOnly, readOnly: readOnly, options: options ?? [], loadingText: "Cargando...", onFocus: others.onFocus, "data-testid": "smart-select", noOptionsText: "No hay opciones", value: !loading && value ? value : null, onChange: (_event, newValue) => onChange?.(newValue), popupIcon: loading ? _jsx(CircularProgress, { size: 22 }) : IconComponent ? _jsx(IconComponent, {}) : undefined, filterOptions: (options, params) => {
|
|
31
|
-
if (value
|
|
31
|
+
if (value?.label === params?.inputValue) {
|
|
32
32
|
return options;
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
@@ -100,17 +100,20 @@ function CustomTextfield({ onChange, value = '', IconComponent, size = 'small',
|
|
|
100
100
|
const handleChange = useCallback((event) => {
|
|
101
101
|
onChange?.(event.target.value);
|
|
102
102
|
}, [onChange]);
|
|
103
|
-
const inputProps = useMemo(() =>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
const inputProps = useMemo(() => {
|
|
104
|
+
const mergedInputProps = {
|
|
105
|
+
...others.inputProps,
|
|
106
|
+
spellCheck: true,
|
|
107
|
+
endAdornment: IconComponent,
|
|
108
|
+
readOnly: !!readOnly,
|
|
109
|
+
disabled: !!readOnly || !!disabled,
|
|
110
|
+
};
|
|
111
|
+
if (maxLength) {
|
|
112
|
+
mergedInputProps.inputProps = { maxLength };
|
|
113
|
+
}
|
|
114
|
+
return mergedInputProps;
|
|
115
|
+
}, [others.inputProps, IconComponent, readOnly, disabled, maxLength]);
|
|
110
116
|
const length = maxLength ? value.toString()?.length : null;
|
|
111
|
-
if (maxLength) {
|
|
112
|
-
inputProps.inputProps = { maxLength };
|
|
113
|
-
}
|
|
114
117
|
const helperText = others.helperText ?? (others.error === false && !others.readOnly ? ' ' : undefined);
|
|
115
118
|
return (_jsxs("div", { style: {
|
|
116
119
|
position: 'relative',
|
|
@@ -3,12 +3,12 @@ import { StyledHelperText, StyledInputLabel, StyledSelect } from '../ErkSelect/E
|
|
|
3
3
|
import styles from './ErkTimePicker.module.css';
|
|
4
4
|
import ClockIcon from '../../Icons/ClockIcon';
|
|
5
5
|
import { ClickAwayListener, FormControl, InputAdornment, MenuItem, Popper, useTheme, } from '@mui/material';
|
|
6
|
-
import React, { useCallback,
|
|
6
|
+
import React, { useCallback, useState } from 'react';
|
|
7
7
|
import { StyledTextField } from '../ErkTextField/ErkTextField';
|
|
8
8
|
import ErkToggle from '../Toggle/Toggle';
|
|
9
9
|
function CustomSelect({ value, onChange, label, error, required, pickDays, helperText, readOnly = false, disabled = false, minDays = 0, maxDays, pickHours, minHours = 0, maxHours, pickMinutes, minMinutes = 0, maxMinutes, working, labelMargin = 5, size = 'small', ...others }) {
|
|
10
10
|
const [open, setOpen] = useState(false);
|
|
11
|
-
const
|
|
11
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
12
12
|
const { palette } = useTheme();
|
|
13
13
|
const handleChange = useCallback((value) => {
|
|
14
14
|
const time = { ...value };
|
|
@@ -34,7 +34,7 @@ function CustomSelect({ value, onChange, label, error, required, pickDays, helpe
|
|
|
34
34
|
parts.push('*');
|
|
35
35
|
return parts.join(' ');
|
|
36
36
|
};
|
|
37
|
-
return (_jsxs(_Fragment, { children: [open && (_jsx(ClickAwayListener, { mouseEvent: "onMouseDown", onClickAway: () => setOpen(false), children: _jsx(Popper, { open: true, anchorEl:
|
|
37
|
+
return (_jsxs(_Fragment, { children: [open && (_jsx(ClickAwayListener, { mouseEvent: "onMouseDown", onClickAway: () => setOpen(false), children: _jsx(Popper, { open: true, anchorEl: anchorEl, placement: 'bottom-start', modifiers: [
|
|
38
38
|
{
|
|
39
39
|
name: 'preventOverflow',
|
|
40
40
|
enabled: true,
|
|
@@ -53,7 +53,7 @@ function CustomSelect({ value, onChange, label, error, required, pickDays, helpe
|
|
|
53
53
|
...value,
|
|
54
54
|
working,
|
|
55
55
|
});
|
|
56
|
-
} })] }))] }) }) })), _jsxs(FormControl, { fullWidth: true, size: size, error: error, variant: "outlined", required: required, style: { marginTop: label ? labelMargin : undefined, maxWidth: '100%' }, children: [label && (_jsx(StyledInputLabel, { disabled: disabled, open: open, size: size === 'small' ? 'small' : undefined, children: label })), _jsx(StyledSelect, { ...others, ref:
|
|
56
|
+
} })] }))] }) }) })), _jsxs(FormControl, { fullWidth: true, size: size, error: error, variant: "outlined", required: required, style: { marginTop: label ? labelMargin : undefined, maxWidth: '100%' }, children: [label && (_jsx(StyledInputLabel, { disabled: disabled, open: open, size: size === 'small' ? 'small' : undefined, children: label })), _jsx(StyledSelect, { ...others, ref: setAnchorEl, open: open, size: size, readOnly: readOnly, disabled: disabled, onBlur: () => {
|
|
57
57
|
if (!readOnly && !disabled)
|
|
58
58
|
setOpen(false);
|
|
59
59
|
}, label: label ? calcLabel() : undefined, value: value ? 0 : '', title: calcTimeString(value), IconComponent: () => _jsx(_Fragment, {}), MenuProps: { sx: { visibility: 'hidden' } }, endAdornment: _jsx(InputAdornment, { position: "end", onClick: (e) => {
|
package/dist/Widget.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import App from './App/App';
|
|
4
4
|
import './Utils/MuiClassnameSetup';
|
|
5
5
|
const WIDGET_ID = document.currentScript?.getAttribute('data-id') ?? 'widget:eureka';
|
|
@@ -45,5 +45,5 @@ if (element) {
|
|
|
45
45
|
props.partial = true;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const root = createRoot(document.getElementById(WIDGET_ID));
|
|
49
|
+
root.render(_jsx(App, { isWidget: true, ...props }));
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arquimedes.co/eureka-forms",
|
|
3
3
|
"repository": "git://github.com/Arquimede5/Eureka-Forms.git",
|
|
4
|
-
"version":"3.0.
|
|
4
|
+
"version":"3.0.35-test",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"watch": "
|
|
6
|
+
"watch": "tsgo --noEmit --watch --project tsconfig.app.json",
|
|
7
7
|
"start": "vite",
|
|
8
8
|
"build": "tsc -b && vite build",
|
|
9
9
|
"format": "prettier --write ./src",
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
"build-storybook": "storybook build"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@reduxjs/toolkit": "
|
|
20
|
-
"axios": "
|
|
21
|
-
"date-fns": "
|
|
22
|
-
"draft-js": "
|
|
23
|
-
"i18n-iso-countries": "
|
|
24
|
-
"libphonenumber-js": "
|
|
25
|
-
"logrocket": "
|
|
26
|
-
"nanoid": "
|
|
27
|
-
"react-draft-wysiwyg": "
|
|
28
|
-
"react-google-recaptcha": "
|
|
29
|
-
"react-hook-form": "
|
|
30
|
-
"react-international-phone": "
|
|
31
|
-
"react-redux": "
|
|
32
|
-
"typescript": "
|
|
19
|
+
"@reduxjs/toolkit": "2.11.0",
|
|
20
|
+
"axios": "1.12.2",
|
|
21
|
+
"date-fns": "4.1.0",
|
|
22
|
+
"draft-js": "0.11.7",
|
|
23
|
+
"i18n-iso-countries": "7.14.0",
|
|
24
|
+
"libphonenumber-js": "1.12.31",
|
|
25
|
+
"logrocket": "10.1.1",
|
|
26
|
+
"nanoid": "5.1.6",
|
|
27
|
+
"react-draft-wysiwyg": "1.15.0",
|
|
28
|
+
"react-google-recaptcha": "3.1.0",
|
|
29
|
+
"react-hook-form": "7.68.0",
|
|
30
|
+
"react-international-phone": "4.6.1",
|
|
31
|
+
"react-redux": "9.2.0",
|
|
32
|
+
"typescript": "5.9.3"
|
|
33
33
|
},
|
|
34
34
|
"eslintConfig": {},
|
|
35
35
|
"browserslist": {
|
|
@@ -45,63 +45,70 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@eslint/compat": "
|
|
49
|
-
"@eslint/eslintrc": "
|
|
50
|
-
"@eslint/js": "
|
|
51
|
-
"@faker-js/faker": "
|
|
52
|
-
"@mui/material": "
|
|
53
|
-
"@mui/x-data-grid-pro": "
|
|
54
|
-
"@mui/x-date-pickers": "
|
|
55
|
-
"@mui/x-date-pickers-pro": "
|
|
56
|
-
"@storybook/addon-docs": "^9.1.
|
|
57
|
-
"@storybook/addon-onboarding": "^9.1.
|
|
58
|
-
"@storybook/addon-themes": "^9.1.
|
|
59
|
-
"@storybook/react-vite": "^9.1.
|
|
60
|
-
"@testing-library/dom": "
|
|
61
|
-
"@testing-library/jest-dom": "
|
|
62
|
-
"@testing-library/react": "
|
|
63
|
-
"@testing-library/user-event": "
|
|
64
|
-
"@types/draft-js": "
|
|
65
|
-
"@types/react": "
|
|
66
|
-
"@types/react-dom": "
|
|
67
|
-
"@types/react-draft-wysiwyg": "
|
|
68
|
-
"@types/react-google-recaptcha": "
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "
|
|
70
|
-
"@typescript-eslint/parser": "
|
|
71
|
-
"@vitejs/plugin-react
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"eslint
|
|
77
|
-
"eslint-
|
|
78
|
-
"eslint-plugin-react
|
|
79
|
-
"eslint-plugin-react-
|
|
80
|
-
"eslint-plugin-
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
48
|
+
"@eslint/compat": "1.4.0",
|
|
49
|
+
"@eslint/eslintrc": "3.3.3",
|
|
50
|
+
"@eslint/js": "9.39.1",
|
|
51
|
+
"@faker-js/faker": "10.1.0",
|
|
52
|
+
"@mui/material": "7.3.6",
|
|
53
|
+
"@mui/x-data-grid-pro": "8.21.0",
|
|
54
|
+
"@mui/x-date-pickers": "8.21.0",
|
|
55
|
+
"@mui/x-date-pickers-pro": "8.21.0",
|
|
56
|
+
"@storybook/addon-docs": "^9.1.16",
|
|
57
|
+
"@storybook/addon-onboarding": "^9.1.16",
|
|
58
|
+
"@storybook/addon-themes": "^9.1.16",
|
|
59
|
+
"@storybook/react-vite": "^9.1.16",
|
|
60
|
+
"@testing-library/dom": "10.4.1",
|
|
61
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
62
|
+
"@testing-library/react": "16.3.0",
|
|
63
|
+
"@testing-library/user-event": "14.6.1",
|
|
64
|
+
"@types/draft-js": "0.11.20",
|
|
65
|
+
"@types/react": "19.2.7",
|
|
66
|
+
"@types/react-dom": "19.2.3",
|
|
67
|
+
"@types/react-draft-wysiwyg": "1.13.9",
|
|
68
|
+
"@types/react-google-recaptcha": "2.1.9",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "8.48.1",
|
|
70
|
+
"@typescript-eslint/parser": "8.48.1",
|
|
71
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
72
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
73
|
+
"css-loader": "7.1.2",
|
|
74
|
+
"cypress": "15.7.1",
|
|
75
|
+
"dotenv-webpack": "8.1.1",
|
|
76
|
+
"eslint": "9.39.1",
|
|
77
|
+
"eslint-config-prettier": "10.1.8",
|
|
78
|
+
"eslint-plugin-react": "7.37.5",
|
|
79
|
+
"eslint-plugin-react-hooks": "7.0.1",
|
|
80
|
+
"eslint-plugin-react-refresh": "0.4.24",
|
|
81
|
+
"eslint-plugin-storybook": "9.1.16",
|
|
82
|
+
"globals": "16.4.0",
|
|
83
|
+
"identity-obj-proxy": "3.0.0",
|
|
84
|
+
"jsdom": "27.2.0",
|
|
85
|
+
"prettier": "3.7.4",
|
|
86
|
+
"react": "19.2.1",
|
|
87
|
+
"react-dom": "19.2.1",
|
|
88
|
+
"react-refresh": "0.18.0",
|
|
89
|
+
"storybook": "^9.1.16",
|
|
90
|
+
"style-loader": "4.0.0",
|
|
91
|
+
"vite": "7.1.9",
|
|
92
|
+
"vite-plugin-svgr": "4.5.0",
|
|
93
|
+
"vitest": "3.2.4"
|
|
91
94
|
},
|
|
92
95
|
"peerDependencies": {
|
|
93
|
-
"@emotion/react": "
|
|
94
|
-
"@emotion/styled": "
|
|
95
|
-
"@mui/material": "
|
|
96
|
-
"@mui/x-date-pickers": "
|
|
97
|
-
"react": "
|
|
98
|
-
"react-dom": "
|
|
96
|
+
"@emotion/react": "11.x.x",
|
|
97
|
+
"@emotion/styled": "11.x.x",
|
|
98
|
+
"@mui/material": "7.3.6",
|
|
99
|
+
"@mui/x-date-pickers": "8.21.0",
|
|
100
|
+
"react": "18 || 19",
|
|
101
|
+
"react-dom": "18 || 19"
|
|
99
102
|
},
|
|
100
103
|
"publishConfig": {
|
|
101
104
|
"access": "public"
|
|
102
105
|
},
|
|
106
|
+
"overrides": {
|
|
107
|
+
"react": "$react",
|
|
108
|
+
"react-dom": "$react-dom"
|
|
109
|
+
},
|
|
103
110
|
"main": "./dist/index.lib.js",
|
|
104
111
|
"files": [
|
|
105
112
|
"/dist"
|
|
106
113
|
]
|
|
107
|
-
}
|
|
114
|
+
}
|