@arquimedes.co/eureka-forms 3.0.69 → 3.0.71-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/README +1 -33
- package/dist/@Types/FormStep.d.ts +2 -7
- package/dist/@Types/FormStep.js +1 -2
- package/dist/App/App.stories.d.ts +0 -10
- package/dist/App/App.stories.js +0 -189
- package/dist/App/AppHooks.js +0 -8
- package/dist/App/AppHooks.test.js +0 -8
- package/dist/Form/Form.js +6 -7
- package/dist/Form/FormFunctions.d.ts +0 -17
- package/dist/Form/FormFunctions.js +0 -22
- package/dist/Form/FormFunctions.test.js +1 -28
- package/dist/FormSteps/AYFStepMapper.js +2 -24
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.mobileLabel.test.js +12 -20
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +13 -6
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css +13 -2
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +1 -3
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +26 -26
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +11 -1
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.staleOptions.test.js +100 -0
- package/dist/FormSteps/Step.js +0 -16
- package/dist/FormSteps/StepFunctions.js +0 -14
- package/dist/FormSteps/StepFunctions.test.js +0 -54
- package/dist/FormSteps/StepHooks.d.ts +0 -21
- package/dist/FormSteps/StepHooks.js +8 -55
- package/dist/FormSteps/ciudadesICAQuery.d.ts +8 -0
- package/dist/FormSteps/ciudadesICAQuery.js +31 -0
- package/dist/FormSteps/ciudadesICAQuery.test.js +39 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +3 -1
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.d.ts +3 -2
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +2 -1
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +4 -14
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.test.js +21 -1
- package/dist/Utils/AxiosWidget.js +1 -9
- package/dist/constants/FormStepTypes.d.ts +1 -5
- package/dist/constants/FormStepTypes.js +0 -4
- package/dist/index.lib.d.ts +2 -4
- package/dist/index.lib.js +1 -3
- package/package.json +1 -2
- package/dist/@Types/AvailabilityFormStep.d.ts +0 -48
- package/dist/@Types/AvailabilityFormStep.js +0 -24
- package/dist/@Types/BankAccountFormStep.d.ts +0 -67
- package/dist/@Types/BankAccountFormStep.js +0 -14
- package/dist/@Types/BookingFormStep.d.ts +0 -197
- package/dist/@Types/BookingFormStep.js +0 -44
- package/dist/@Types/CalendarFormStep.d.ts +0 -209
- package/dist/@Types/CalendarFormStep.js +0 -55
- package/dist/@Types/CommunicationChannelFormStep.d.ts +0 -51
- package/dist/@Types/CommunicationChannelFormStep.js +0 -15
- package/dist/@Types/ConsentFormStep.d.ts +0 -36
- package/dist/@Types/ConsentFormStep.js +0 -8
- package/dist/@Types/EntityFormFormStep.d.ts +0 -66
- package/dist/@Types/EntityFormFormStep.js +0 -20
- package/dist/@Types/EventFormStep.d.ts +0 -52
- package/dist/@Types/EventFormStep.js +0 -13
- package/dist/@Types/ExternalReferenceFormStep.d.ts +0 -74
- package/dist/@Types/ExternalReferenceFormStep.js +0 -20
- package/dist/@Types/LocationFormStep.d.ts +0 -159
- package/dist/@Types/LocationFormStep.js +0 -46
- package/dist/@Types/NumericFormSteps.d.ts +0 -108
- package/dist/@Types/NumericFormSteps.js +0 -20
- package/dist/@Types/PredefinedSelectorFormStep.d.ts +0 -51
- package/dist/@Types/PredefinedSelectorFormStep.js +0 -39
- package/dist/@Types/StepRef.d.ts +0 -135
- package/dist/@Types/StepRef.js +0 -49
- package/dist/FormSteps/AvailabilityStep/AvailabilityStep.d.ts +0 -7
- package/dist/FormSteps/AvailabilityStep/AvailabilityStep.js +0 -14
- package/dist/FormSteps/AvailabilityStep/MaterialAvailabilityStep/MaterialAvailabilityStep.d.ts +0 -8
- package/dist/FormSteps/AvailabilityStep/MaterialAvailabilityStep/MaterialAvailabilityStep.js +0 -32
- package/dist/FormSteps/BookingStep/BookingStep.d.ts +0 -17
- package/dist/FormSteps/BookingStep/BookingStep.js +0 -14
- package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.d.ts +0 -14
- package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.js +0 -129
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.lateClassifiers.test.js +0 -70
- package/dist/FormSteps/EntityValueStep/entityValueDependencyValue.d.ts +0 -12
- package/dist/FormSteps/EntityValueStep/entityValueDependencyValue.js +0 -35
- package/dist/FormSteps/EntityValueStep/entityValueDependencyValue.test.js +0 -31
- package/dist/FormSteps/EntityValueStep/entityValuePickerWatchedSteps.d.ts +0 -27
- package/dist/FormSteps/EntityValueStep/entityValuePickerWatchedSteps.js +0 -64
- package/dist/FormSteps/EntityValueStep/entityValuePickerWatchedSteps.test.d.ts +0 -1
- package/dist/FormSteps/EntityValueStep/entityValuePickerWatchedSteps.test.js +0 -95
- package/dist/FormSteps/LocationStep/LocationStep.d.ts +0 -10
- package/dist/FormSteps/LocationStep/LocationStep.js +0 -14
- package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.d.ts +0 -3
- package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.js +0 -54
- package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.module.css +0 -18
- package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.d.ts +0 -3
- package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.js +0 -170
- package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.module.css +0 -96
- package/dist/FormSteps/NumberStep/NumberStep.d.ts +0 -10
- package/dist/FormSteps/NumberStep/NumberStep.js +0 -14
- package/dist/FormSteps/StepHooks.test.d.ts +0 -1
- package/dist/FormSteps/StepHooks.test.js +0 -92
- package/dist/FormSteps/isStepHiddenByCondition.test.d.ts +0 -1
- package/dist/FormSteps/isStepHiddenByCondition.test.js +0 -42
- package/dist/Icons/AddIcon.d.ts +0 -3
- package/dist/Icons/AddIcon.js +0 -7
- package/dist/Icons/EditIcon.d.ts +0 -3
- package/dist/Icons/EditIcon.js +0 -7
- package/dist/Icons/RemoveIcon.d.ts +0 -3
- package/dist/Icons/RemoveIcon.js +0 -7
- package/dist/Icons/ViewDayIcon.d.ts +0 -3
- package/dist/Icons/ViewDayIcon.js +0 -7
- package/dist/Icons/ViewWeekIcon.d.ts +0 -3
- package/dist/Icons/ViewWeekIcon.js +0 -7
- package/dist/Services/BookingService.d.ts +0 -79
- package/dist/Services/BookingService.js +0 -66
- package/dist/Services/BookingService.test.d.ts +0 -1
- package/dist/Services/BookingService.test.js +0 -57
- package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.d.ts +0 -19
- package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.js +0 -80
- package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.module.css +0 -88
- package/dist/Shared/ErkAddressAutocomplete/googlePlaces.d.ts +0 -29
- package/dist/Shared/ErkAddressAutocomplete/googlePlaces.js +0 -139
- package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.d.ts +0 -25
- package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.js +0 -112
- package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.module.css +0 -88
- package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.test.d.ts +0 -1
- package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.test.js +0 -73
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.d.ts +0 -52
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.js +0 -292
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.module.css +0 -608
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.stories.d.ts +0 -28
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.stories.js +0 -117
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.stories.test.d.ts +0 -1
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.stories.test.js +0 -49
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.test.d.ts +0 -1
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.test.js +0 -157
- package/dist/Shared/ErkIconButton/ErkIconButton.d.ts +0 -17
- package/dist/Shared/ErkIconButton/ErkIconButton.js +0 -11
- package/dist/Shared/ErkIconButton/ErkIconButton.module.css +0 -41
- package/dist/Shared/ErkLocationField/ErkLocationField.d.ts +0 -24
- package/dist/Shared/ErkLocationField/ErkLocationField.js +0 -128
- package/dist/Shared/ErkLocationField/ErkLocationField.module.css +0 -164
- package/dist/Shared/ErkLocationField/ErkLocationField.test.d.ts +0 -1
- package/dist/Shared/ErkLocationField/ErkLocationField.test.js +0 -82
- package/dist/Shared/ErkLocationField/addressFields.d.ts +0 -12
- package/dist/Shared/ErkLocationField/addressFields.js +0 -34
- package/dist/Shared/ErkLocationField/locationRestrictions.d.ts +0 -6
- package/dist/Shared/ErkLocationField/locationRestrictions.js +0 -51
- package/dist/Shared/ErkLocationInput/ErkLocationInput.d.ts +0 -15
- package/dist/Shared/ErkLocationInput/ErkLocationInput.js +0 -502
- package/dist/Shared/ErkLocationInput/ErkLocationInput.module.css +0 -128
- package/dist/Shared/ErkNumberField/ErkNumberField.d.ts +0 -42
- package/dist/Shared/ErkNumberField/ErkNumberField.js +0 -169
- /package/dist/FormSteps/{ClassifierSelectorStep/ClassifierSelectorStep.lateClassifiers.test.d.ts → SmartSelectStep/SmartSelectStep.staleOptions.test.d.ts} +0 -0
- /package/dist/FormSteps/{EntityValueStep/entityValueDependencyValue.test.d.ts → ciudadesICAQuery.test.d.ts} +0 -0
|
@@ -5,6 +5,8 @@ import { StyledTextField } from '../ErkTextField/ErkTextField';
|
|
|
5
5
|
import ErkMenuItem from '../ErkMenuItem';
|
|
6
6
|
import ErkAutocompleteOption from '../ErkAutocompleteOption';
|
|
7
7
|
const filter = createFilterOptions();
|
|
8
|
+
/** Options are either `{ label }` objects or plain strings that are their own label (e.g. the ICA cities). */
|
|
9
|
+
const calcOptionLabel = (option) => (typeof option === 'string' ? option : (option?.label ?? ''));
|
|
8
10
|
const StyledAutoComplete = styled(MuiAutocomplete)(({ theme, readOnly, ...props }) => ({
|
|
9
11
|
'& .Erk-MuiInputBase-root': {
|
|
10
12
|
cursor: props.disabled || readOnly ? 'default' : 'text',
|
|
@@ -35,21 +37,9 @@ export default function ErkSmartSelect({ options, value = '', onChange, label, g
|
|
|
35
37
|
else {
|
|
36
38
|
return filter(options, params);
|
|
37
39
|
}
|
|
38
|
-
}, renderOption: ({ key, ...props }, option, state) => (_jsx(ErkAutocompleteOption, { ...props, selected: state.selected, children: option
|
|
39
|
-
// Value selected with enter, right from the input
|
|
40
|
-
if (typeof option === 'string') {
|
|
41
|
-
return option;
|
|
42
|
-
}
|
|
43
|
-
else if (option?.inputValue) {
|
|
44
|
-
return option.inputValue ?? '';
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
// Regular option
|
|
48
|
-
return option?.label ?? '';
|
|
49
|
-
}
|
|
50
|
-
}, slotProps: { popper: { sx: { zIndex: 1305 } } }, renderInput: (params) => (_jsx(StyledTextField, { ...params, size: size, label: label, labelMargin: 0, name: others.name, readOnly: readOnly, disabled: disabled, inputRef: inputRef, error: others.error, onBlur: others.onBlur, required: others.required, helperText: others.helperText })) }));
|
|
40
|
+
}, renderOption: ({ key, ...props }, option, state) => (_jsx(ErkAutocompleteOption, { ...props, selected: state.selected, children: calcOptionLabel(option) }, key)), getOptionKey: (option) => getValueString(option), getOptionLabel: (option) => option?.inputValue ?? calcOptionLabel(option), slotProps: { popper: { sx: { zIndex: 1305 } } }, renderInput: (params) => (_jsx(StyledTextField, { ...params, size: size, label: label, labelMargin: 0, name: others.name, readOnly: readOnly, disabled: disabled, inputRef: inputRef, error: others.error, onBlur: others.onBlur, required: others.required, helperText: others.helperText })) }));
|
|
51
41
|
}
|
|
52
42
|
else {
|
|
53
|
-
return (_jsxs(ErkSelect, { ...others, labelMargin: 0, disabled: disabled, readOnly: readOnly, inputRef: inputRef, onChange: (value) => onChange?.(options?.find((option) => getValueString(option) === value)), value: loading ? '' : getValueString(value), label: label, IconComponent: loading ? () => _jsx(CircularProgress, { size: 22 }) : IconComponent, children: [options?.map((option) => (_jsx(ErkMenuItem, { value: getValueString(option), "data-testid": 'smart-select-' + getValueString(option), children: option
|
|
43
|
+
return (_jsxs(ErkSelect, { ...others, labelMargin: 0, disabled: disabled, readOnly: readOnly, inputRef: inputRef, onChange: (value) => onChange?.(options?.find((option) => getValueString(option) === value)), value: loading ? '' : getValueString(value), label: label, IconComponent: loading ? () => _jsx(CircularProgress, { size: 22 }) : IconComponent, children: [options?.map((option) => (_jsx(ErkMenuItem, { value: getValueString(option), "data-testid": 'smart-select-' + getValueString(option), children: calcOptionLabel(option) }, getValueString(option)))), options === undefined && value && !loading && (_jsx(ErkMenuItem, { value: getValueString(value), children: calcOptionLabel(value) }, getValueString(value)))] }));
|
|
54
44
|
}
|
|
55
45
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
4
|
import { describe, expect, it, vi } from 'vitest';
|
|
5
5
|
import '@testing-library/jest-dom';
|
|
@@ -31,3 +31,23 @@ describe('ErkSmartSelect (searchable)', () => {
|
|
|
31
31
|
expect(await screen.findByRole('option', { name: 'Uno' })).toHaveAttribute('aria-selected', 'true');
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
+
/** Steps such as the ICA city selector feed plain strings; the string is both the value and the label. */
|
|
35
|
+
const cities = ['BELLO', 'MEDELLIN'];
|
|
36
|
+
const cityString = (value) => value;
|
|
37
|
+
describe('ErkSmartSelect with plain-string options', () => {
|
|
38
|
+
it('searchable: shows each string as the option text', async () => {
|
|
39
|
+
const user = userEvent.setup();
|
|
40
|
+
render(_jsx(MaterialProviders, { formStyle: InternalFormStyle, children: _jsx(ErkSmartSelect, { searchable: true, label: "Ciudad", options: cities, value: "", onChange: () => { }, getValueString: cityString }) }));
|
|
41
|
+
await user.click(screen.getByRole('combobox'));
|
|
42
|
+
expect(await screen.findByRole('option', { name: 'BELLO' })).toBeInTheDocument();
|
|
43
|
+
expect(screen.getByRole('option', { name: 'MEDELLIN' })).toBeInTheDocument();
|
|
44
|
+
});
|
|
45
|
+
it('non-searchable: shows each string as the option text', () => {
|
|
46
|
+
render(_jsx(MaterialProviders, { formStyle: InternalFormStyle, children: _jsx(ErkSmartSelect, { searchable: false, label: "Ciudad", options: cities, value: "", onChange: () => { }, getValueString: cityString }) }));
|
|
47
|
+
// The inline (disablePortal) menu marks the rest of the tree aria-hidden while open, so the
|
|
48
|
+
// options are read from the raw DOM instead of through role queries.
|
|
49
|
+
fireEvent.mouseDown(document.querySelector('[role=combobox]'));
|
|
50
|
+
expect(document.querySelector('[role=option][data-value=BELLO]')).toHaveTextContent('BELLO');
|
|
51
|
+
expect(document.querySelector('[role=option][data-value=MEDELLIN]')).toHaveTextContent('MEDELLIN');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
const headers = {};
|
|
3
|
-
/**
|
|
4
|
-
* Embedded mode calls the API by absolute URL, because the form runs inside a page that is not ours.
|
|
5
|
-
* Against local lambdas there is no such host: the dev server proxies `/api`, so the request has to come
|
|
6
|
-
* back through it — same-origin, with no CORS allowlist to satisfy.
|
|
7
|
-
*/
|
|
8
|
-
const baseURL = import.meta.env.VITE_LOCAL_LAMBDAS
|
|
9
|
-
? '/api'
|
|
10
|
-
: `https://api.forms.${import.meta.env.VITE_REACT_APP_DOMAIN}/api`;
|
|
11
3
|
const widgetInstance = axios.create({
|
|
12
|
-
baseURL
|
|
4
|
+
baseURL: `https://api.forms.${import.meta.env.VITE_REACT_APP_DOMAIN}/api`,
|
|
13
5
|
timeout: 30000,
|
|
14
6
|
headers,
|
|
15
7
|
});
|
|
@@ -21,11 +21,7 @@ export declare enum FormStepTypes {
|
|
|
21
21
|
COLLAPSIBLE = "COLLAPSIBLE",
|
|
22
22
|
MAPPER = "MAPPER",
|
|
23
23
|
ENTITYVALUEPICKER = "ENTITYVALUEPICKER",
|
|
24
|
-
API_SELECTOR = "API_SELECTOR"
|
|
25
|
-
LOCATION = "LOCATION",
|
|
26
|
-
NUMBER = "NUMBER",
|
|
27
|
-
AVAILABILITY = "AVAILABILITY",
|
|
28
|
-
BOOKING = "BOOKING"
|
|
24
|
+
API_SELECTOR = "API_SELECTOR"
|
|
29
25
|
}
|
|
30
26
|
export declare enum OptionTypes {
|
|
31
27
|
DEFAULT = "DEFAULT",
|
|
@@ -25,10 +25,6 @@ export var FormStepTypes;
|
|
|
25
25
|
FormStepTypes["MAPPER"] = "MAPPER";
|
|
26
26
|
FormStepTypes["ENTITYVALUEPICKER"] = "ENTITYVALUEPICKER";
|
|
27
27
|
FormStepTypes["API_SELECTOR"] = "API_SELECTOR";
|
|
28
|
-
FormStepTypes["LOCATION"] = "LOCATION";
|
|
29
|
-
FormStepTypes["NUMBER"] = "NUMBER";
|
|
30
|
-
FormStepTypes["AVAILABILITY"] = "AVAILABILITY";
|
|
31
|
-
FormStepTypes["BOOKING"] = "BOOKING";
|
|
32
28
|
})(FormStepTypes || (FormStepTypes = {}));
|
|
33
29
|
export var OptionTypes;
|
|
34
30
|
(function (OptionTypes) {
|
package/dist/index.lib.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import EurekaForm, { AppProps as EurekaFormProps } from './App/App';
|
|
2
2
|
import { StepProps } from './FormSteps/Step';
|
|
3
3
|
import * as StepFunctions from './FormSteps/StepFunctions';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type { StepProps, EurekaFormProps, ErkBookingPickerProps, ErkAvailabilityPickerProps };
|
|
7
|
-
export { EurekaForm, StepFunctions, ErkBookingPicker, ErkAvailabilityPicker };
|
|
4
|
+
export type { StepProps, EurekaFormProps };
|
|
5
|
+
export { EurekaForm, StepFunctions };
|
|
8
6
|
export default EurekaForm;
|
package/dist/index.lib.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import EurekaForm from './App/App';
|
|
2
2
|
import * as StepFunctions from './FormSteps/StepFunctions';
|
|
3
|
-
|
|
4
|
-
import ErkAvailabilityPicker from './Shared/ErkAvailabilityPicker/ErkAvailabilityPicker';
|
|
5
|
-
export { EurekaForm, StepFunctions, ErkBookingPicker, ErkAvailabilityPicker };
|
|
3
|
+
export { EurekaForm, StepFunctions };
|
|
6
4
|
export default EurekaForm;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arquimedes.co/eureka-forms",
|
|
3
3
|
"repository": "git://github.com/Arquimede5/Eureka-Forms.git",
|
|
4
|
-
"version":
|
|
4
|
+
"version":"3.0.71-test",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"watch": "node node_modules/@typescript/native/bin/tsc --noEmit --watch --project tsconfig.app.json",
|
|
7
7
|
"start": "vite",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"format:check": "oxfmt --check ./src"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@base-ui/react": "^1.6.0",
|
|
21
20
|
"@reduxjs/toolkit": "2.11.2",
|
|
22
21
|
"axios": "1.16.0",
|
|
23
22
|
"date-fns": "4.1.0",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Renombrado a CalendarFormStep.
|
|
3
|
-
* Este archivo existe solo para compatibilidad retroactiva.
|
|
4
|
-
* Usar `CalendarFormStep.ts` directamente.
|
|
5
|
-
*/
|
|
6
|
-
export type { AvailabilityStep } from './CalendarFormStep';
|
|
7
|
-
export type { CalendarValue as AvailabilityValue } from './CalendarFormStep';
|
|
8
|
-
export { CalendarEventCategory as AvailabilityEventCategory } from './CalendarFormStep';
|
|
9
|
-
export { CalendarDefaultView } from './CalendarFormStep';
|
|
10
|
-
export type { CalendarEventTemplate } from './CalendarFormStep';
|
|
11
|
-
export type { CalendarEvent } from './CalendarFormStep';
|
|
12
|
-
export declare enum AvailabilityMode {
|
|
13
|
-
WEEKLY = "WEEKLY",
|
|
14
|
-
SPECIFIC_DATES = "SPECIFIC_DATES",
|
|
15
|
-
COMBINED = "COMBINED"
|
|
16
|
-
}
|
|
17
|
-
export declare enum AvailabilityDayOfWeek {
|
|
18
|
-
MONDAY = 1,
|
|
19
|
-
TUESDAY = 2,
|
|
20
|
-
WEDNESDAY = 3,
|
|
21
|
-
THURSDAY = 4,
|
|
22
|
-
FRIDAY = 5,
|
|
23
|
-
SATURDAY = 6,
|
|
24
|
-
SUNDAY = 7
|
|
25
|
-
}
|
|
26
|
-
export interface AvailabilitySlot {
|
|
27
|
-
start: string;
|
|
28
|
-
end: string;
|
|
29
|
-
}
|
|
30
|
-
export interface AvailabilityDay {
|
|
31
|
-
day: AvailabilityDayOfWeek;
|
|
32
|
-
slots: AvailabilitySlot[];
|
|
33
|
-
recurrence?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface AvailabilitySpecificDate {
|
|
36
|
-
date: string;
|
|
37
|
-
slots: AvailabilitySlot[];
|
|
38
|
-
}
|
|
39
|
-
export interface AvailabilityExclusion {
|
|
40
|
-
date?: string;
|
|
41
|
-
dateRange?: {
|
|
42
|
-
start: string;
|
|
43
|
-
end: string;
|
|
44
|
-
};
|
|
45
|
-
dayOfWeek?: AvailabilityDayOfWeek;
|
|
46
|
-
slots?: AvailabilitySlot[];
|
|
47
|
-
reason?: string;
|
|
48
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Renombrado a CalendarFormStep.
|
|
3
|
-
* Este archivo existe solo para compatibilidad retroactiva.
|
|
4
|
-
* Usar `CalendarFormStep.ts` directamente.
|
|
5
|
-
*/
|
|
6
|
-
export { CalendarEventCategory as AvailabilityEventCategory } from './CalendarFormStep';
|
|
7
|
-
export { CalendarDefaultView } from './CalendarFormStep';
|
|
8
|
-
// Tipos del draft original mantenidos para no romper código existente.
|
|
9
|
-
export var AvailabilityMode;
|
|
10
|
-
(function (AvailabilityMode) {
|
|
11
|
-
AvailabilityMode["WEEKLY"] = "WEEKLY";
|
|
12
|
-
AvailabilityMode["SPECIFIC_DATES"] = "SPECIFIC_DATES";
|
|
13
|
-
AvailabilityMode["COMBINED"] = "COMBINED";
|
|
14
|
-
})(AvailabilityMode || (AvailabilityMode = {}));
|
|
15
|
-
export var AvailabilityDayOfWeek;
|
|
16
|
-
(function (AvailabilityDayOfWeek) {
|
|
17
|
-
AvailabilityDayOfWeek[AvailabilityDayOfWeek["MONDAY"] = 1] = "MONDAY";
|
|
18
|
-
AvailabilityDayOfWeek[AvailabilityDayOfWeek["TUESDAY"] = 2] = "TUESDAY";
|
|
19
|
-
AvailabilityDayOfWeek[AvailabilityDayOfWeek["WEDNESDAY"] = 3] = "WEDNESDAY";
|
|
20
|
-
AvailabilityDayOfWeek[AvailabilityDayOfWeek["THURSDAY"] = 4] = "THURSDAY";
|
|
21
|
-
AvailabilityDayOfWeek[AvailabilityDayOfWeek["FRIDAY"] = 5] = "FRIDAY";
|
|
22
|
-
AvailabilityDayOfWeek[AvailabilityDayOfWeek["SATURDAY"] = 6] = "SATURDAY";
|
|
23
|
-
AvailabilityDayOfWeek[AvailabilityDayOfWeek["SUNDAY"] = 7] = "SUNDAY";
|
|
24
|
-
})(AvailabilityDayOfWeek || (AvailabilityDayOfWeek = {}));
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DRAFT — BankAccountFormStep types
|
|
3
|
-
*
|
|
4
|
-
* Paso para capturar información de una cuenta bancaria.
|
|
5
|
-
* Incluye banco, tipo de cuenta, número, país, moneda y titular opcional.
|
|
6
|
-
*/
|
|
7
|
-
import { GBaseStep } from './GenericFormSteps';
|
|
8
|
-
export declare enum BankAccountType {
|
|
9
|
-
SAVINGS = "SAVINGS",
|
|
10
|
-
CHECKING = "CHECKING"
|
|
11
|
-
}
|
|
12
|
-
export interface BankAccountStep extends GBaseStep {
|
|
13
|
-
type: 'BANK_ACCOUNT';
|
|
14
|
-
label: string;
|
|
15
|
-
description: string | null;
|
|
16
|
-
required: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* País predeterminado para filtrar la lista de bancos.
|
|
19
|
-
* Código ISO 3166-1 alpha-2 (ej: "CO", "US", "MX").
|
|
20
|
-
* El usuario puede cambiarlo si no se restringe.
|
|
21
|
-
*/
|
|
22
|
-
defaultCountry?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Si se define, solo se muestran bancos de estos países.
|
|
25
|
-
* Si no se define, se permite cualquier país.
|
|
26
|
-
*/
|
|
27
|
-
allowedCountries?: string[];
|
|
28
|
-
/**
|
|
29
|
-
* Si se define, solo se muestran estas monedas.
|
|
30
|
-
* Códigos ISO 4217 (ej: ["COP", "USD"]).
|
|
31
|
-
*/
|
|
32
|
-
allowedCurrencies?: string[];
|
|
33
|
-
/**
|
|
34
|
-
* Si true, se solicita información del titular de la cuenta
|
|
35
|
-
* (nombre / identificación).
|
|
36
|
-
*/
|
|
37
|
-
requireHolder: boolean;
|
|
38
|
-
size: 1 | 2 | 3 | 4;
|
|
39
|
-
}
|
|
40
|
-
export interface BankAccountHolder {
|
|
41
|
-
/** Nombre completo del titular */
|
|
42
|
-
name?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Referencia a un registro de identidad en Capta.
|
|
45
|
-
* Puede ser el id del contacto o el número de documento.
|
|
46
|
-
*/
|
|
47
|
-
identityRef?: string;
|
|
48
|
-
}
|
|
49
|
-
export interface BankValue {
|
|
50
|
-
bank: {
|
|
51
|
-
/** Id interno del banco en el catálogo de Capta */
|
|
52
|
-
id: string;
|
|
53
|
-
/** Nombre display del banco */
|
|
54
|
-
label: string;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Tipo de cuenta. Se acepta string para bancos con tipos no estándar
|
|
58
|
-
* (ej: "NEQUI", "DAVIPLATA", "CORRIENTE_EXTERIOR").
|
|
59
|
-
*/
|
|
60
|
-
accountType: BankAccountType | string;
|
|
61
|
-
accountNumber: string;
|
|
62
|
-
/** Código ISO 3166-1 alpha-2 del país */
|
|
63
|
-
country: string;
|
|
64
|
-
/** Código ISO 4217 de la moneda */
|
|
65
|
-
currency: string;
|
|
66
|
-
holder?: BankAccountHolder;
|
|
67
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DRAFT — BankAccountFormStep types
|
|
3
|
-
*
|
|
4
|
-
* Paso para capturar información de una cuenta bancaria.
|
|
5
|
-
* Incluye banco, tipo de cuenta, número, país, moneda y titular opcional.
|
|
6
|
-
*/
|
|
7
|
-
// ===========================================================================
|
|
8
|
-
// Enums
|
|
9
|
-
// ===========================================================================
|
|
10
|
-
export var BankAccountType;
|
|
11
|
-
(function (BankAccountType) {
|
|
12
|
-
BankAccountType["SAVINGS"] = "SAVINGS";
|
|
13
|
-
BankAccountType["CHECKING"] = "CHECKING";
|
|
14
|
-
})(BankAccountType || (BankAccountType = {}));
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BookingFormStep — paso de agendamiento (flujo ligero).
|
|
3
|
-
*
|
|
4
|
-
* Permite que alguien externo agende en el calendario de una o varias personas.
|
|
5
|
-
* Flujo: (seleccionar persona) → seleccionar día → seleccionar hora.
|
|
6
|
-
*
|
|
7
|
-
* A diferencia del paso CALENDAR, este NO usa MUI X Scheduler:
|
|
8
|
-
* presenta una UI ligera de date-picker + lista de slots disponibles.
|
|
9
|
-
* La disponibilidad real la calcula el backend leyendo los calendarios referenciados.
|
|
10
|
-
*/
|
|
11
|
-
import { GBaseStep } from './GenericFormSteps';
|
|
12
|
-
import FormStepTypes from '../constants/FormStepTypes';
|
|
13
|
-
import { DynamicRef } from './StepRef';
|
|
14
|
-
import { CalendarValue } from './CalendarFormStep';
|
|
15
|
-
/**
|
|
16
|
-
* Modalidad de la cita.
|
|
17
|
-
*/
|
|
18
|
-
export declare enum BookingMode {
|
|
19
|
-
/** Presencial — requiere ubicación física. */
|
|
20
|
-
IN_PERSON = "IN_PERSON",
|
|
21
|
-
/** Virtual / remota (Meet, Teams, Zoom, etc.). */
|
|
22
|
-
VIRTUAL = "VIRTUAL",
|
|
23
|
-
/** Híbrida — se acuerda entre las partes. */
|
|
24
|
-
HYBRID = "HYBRID"
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Cómo se maneja la selección de la persona a agendar.
|
|
28
|
-
*/
|
|
29
|
-
export declare enum PersonSelectionMode {
|
|
30
|
-
/**
|
|
31
|
-
* Un único calendario destino, sin selector de persona visible.
|
|
32
|
-
* El backend asigna automáticamente el slot disponible.
|
|
33
|
-
*/
|
|
34
|
-
NONE = "NONE",
|
|
35
|
-
/**
|
|
36
|
-
* El usuario puede elegir una persona específica o dejar que el sistema asigne.
|
|
37
|
-
*/
|
|
38
|
-
OPTIONAL = "OPTIONAL",
|
|
39
|
-
/**
|
|
40
|
-
* El usuario debe elegir una persona antes de ver los horarios disponibles.
|
|
41
|
-
*/
|
|
42
|
-
REQUIRED = "REQUIRED"
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Perfil de una persona cuyo calendario se puede agendar.
|
|
46
|
-
*/
|
|
47
|
-
export interface BookablePerson {
|
|
48
|
-
/** Identificador único de la persona en el sistema. */
|
|
49
|
-
id: string;
|
|
50
|
-
/** Nombre visible en la UI de selección. */
|
|
51
|
-
name: string;
|
|
52
|
-
/** URL del avatar / foto de perfil. */
|
|
53
|
-
avatarUrl?: string;
|
|
54
|
-
/** Rol o cargo visible al usuario (ej: "Técnico", "Asesor comercial"). */
|
|
55
|
-
role?: string;
|
|
56
|
-
/** Descripción breve opcional. */
|
|
57
|
-
description?: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Paso de tipo `BOOKING`.
|
|
61
|
-
* UI ligera: persona → día → slot de hora.
|
|
62
|
-
*/
|
|
63
|
-
export interface BookingStep extends GBaseStep {
|
|
64
|
-
type: FormStepTypes.BOOKING;
|
|
65
|
-
label: string;
|
|
66
|
-
description: string | null;
|
|
67
|
-
required: boolean;
|
|
68
|
-
/** Modalidad de la cita (presencial, virtual, híbrida). */
|
|
69
|
-
bookingMode: BookingMode;
|
|
70
|
-
/**
|
|
71
|
-
* Tipo de atención sobre el que se agenda (plantilla de evento de la organización).
|
|
72
|
-
*
|
|
73
|
-
* Cuando está definido, solo se ofrecen las franjas que el agente abrió para
|
|
74
|
-
* ese mismo tipo de atención; las franjas generales (jornada laboral, presencial
|
|
75
|
-
* o virtual) quedan fuera de la oferta. La precedencia es absoluta: mientras
|
|
76
|
-
* exista al menos una franja de este tipo en el horizonte consultado, no se
|
|
77
|
-
* ofrece ninguna franja general.
|
|
78
|
-
*/
|
|
79
|
-
idEventTemplate?: string;
|
|
80
|
-
/**
|
|
81
|
-
* Permite caer a las franjas generales cuando nadie abrió una franja para el
|
|
82
|
-
* `idEventTemplate` pedido.
|
|
83
|
-
*
|
|
84
|
-
* Solo entra en juego cuando no existe ninguna franja de ese tipo de atención en
|
|
85
|
-
* todo el horizonte; si existe aunque sea una, las generales siguen sin ofrecerse.
|
|
86
|
-
* Al caer a las generales se vuelve a aplicar la regla de `bookingMode`.
|
|
87
|
-
* No tiene efecto si no se definió `idEventTemplate`.
|
|
88
|
-
* @default false
|
|
89
|
-
*/
|
|
90
|
-
fallbackToGeneral?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Cómo se presenta la selección de persona al usuario.
|
|
93
|
-
* @default PersonSelectionMode.NONE
|
|
94
|
-
*/
|
|
95
|
-
personSelectionMode?: PersonSelectionMode;
|
|
96
|
-
/**
|
|
97
|
-
* Lista de personas agendables.
|
|
98
|
-
* Requerido si `personSelectionMode` es `OPTIONAL` o `REQUIRED`.
|
|
99
|
-
*/
|
|
100
|
-
persons?: BookablePerson[];
|
|
101
|
-
/**
|
|
102
|
-
* Permite que el formulario sea enviado sin identificar al usuario (agendamiento anónimo).
|
|
103
|
-
* El backend genera un token temporal para rastrear la reserva.
|
|
104
|
-
* @default false
|
|
105
|
-
*/
|
|
106
|
-
allowAnonymous?: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Si el paso recopila datos de contacto (nombre/correo) del que agenda.
|
|
109
|
-
* Desactívalo cuando el booking va dentro de un formulario mayor que ya los captura.
|
|
110
|
-
* @default false
|
|
111
|
-
*/
|
|
112
|
-
collectContact?: boolean;
|
|
113
|
-
/** Duración en minutos de cada slot de cita. */
|
|
114
|
-
durationMinutes: number;
|
|
115
|
-
/**
|
|
116
|
-
* Buffer en minutos entre citas consecutivas.
|
|
117
|
-
* @default 0
|
|
118
|
-
*/
|
|
119
|
-
bufferMinutes?: number;
|
|
120
|
-
/**
|
|
121
|
-
* Mínimo de horas de anticipación para agendar (ej: no se puede agendar con menos de 2h).
|
|
122
|
-
* @default 0
|
|
123
|
-
*/
|
|
124
|
-
minNoticeHours?: number;
|
|
125
|
-
/**
|
|
126
|
-
* Máximo de días hacia el futuro en los que se pueden ver slots disponibles.
|
|
127
|
-
* @default 30
|
|
128
|
-
*/
|
|
129
|
-
maxAdvanceDays?: number;
|
|
130
|
-
/**
|
|
131
|
-
* Minutos que se bloquea el slot mientras el usuario termina el formulario.
|
|
132
|
-
* Si no confirma a tiempo, el slot vuelve a estar disponible.
|
|
133
|
-
* @default 15
|
|
134
|
-
*/
|
|
135
|
-
temporaryLockMinutes?: number;
|
|
136
|
-
/**
|
|
137
|
-
* Referencia a un paso `CALENDAR` en el mismo formulario cuya disponibilidad
|
|
138
|
-
* se usa para filtrar los slots. Útil cuando el dueño del calendario también
|
|
139
|
-
* llena el formulario y define su disponibilidad en el mismo flujo.
|
|
140
|
-
*/
|
|
141
|
-
availabilityRef?: DynamicRef<CalendarValue, 'AVAILABILITY'>;
|
|
142
|
-
size: 1 | 2 | 3 | 4;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Un slot de tiempo disponible para agendamiento.
|
|
146
|
-
* El backend calcula esto cruzando el calendario del profesional con el horario configurado.
|
|
147
|
-
*/
|
|
148
|
-
export interface BookingSlot {
|
|
149
|
-
/** ID único del slot (puede incluir personId, fecha y hora). */
|
|
150
|
-
id: string;
|
|
151
|
-
/** Hora de inicio en formato 24h `HH:mm`. */
|
|
152
|
-
startTime: string;
|
|
153
|
-
/** Hora de fin en formato 24h `HH:mm`. */
|
|
154
|
-
endTime: string;
|
|
155
|
-
/** Si el slot sigue disponible para ser reservado. */
|
|
156
|
-
available: boolean;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Valor que se guarda tras completar un paso de tipo `BOOKING`.
|
|
160
|
-
*/
|
|
161
|
-
export interface BookingValue {
|
|
162
|
-
type: 'BOOKING_VALUE';
|
|
163
|
-
/** ID generado por el backend al bloquear el slot. */
|
|
164
|
-
slotId?: string;
|
|
165
|
-
/** Fecha de la cita en formato ISO `YYYY-MM-DD`. */
|
|
166
|
-
date: string;
|
|
167
|
-
/** Hora de inicio en formato 24h `HH:mm`. */
|
|
168
|
-
startTime: string;
|
|
169
|
-
/** Hora de fin en formato 24h `HH:mm`. */
|
|
170
|
-
endTime: string;
|
|
171
|
-
/** ID de la persona seleccionada o asignada. */
|
|
172
|
-
personId?: string;
|
|
173
|
-
/** Nombre de la persona (incluido si `personSelectionMode !== NONE`). */
|
|
174
|
-
personName?: string;
|
|
175
|
-
/** Nombre de contacto del que agenda (solo si `collectContact`). */
|
|
176
|
-
contactName?: string;
|
|
177
|
-
/** Correo de contacto del que agenda (solo si `collectContact`). */
|
|
178
|
-
contactEmail?: string;
|
|
179
|
-
/**
|
|
180
|
-
* Estado del slot en el ciclo de vida del formulario.
|
|
181
|
-
* - `PENDING`: bloqueado temporalmente, formulario sin enviar.
|
|
182
|
-
* - `CONFIRMED`: reserva en firme, formulario enviado.
|
|
183
|
-
*/
|
|
184
|
-
status: 'PENDING' | 'CONFIRMED';
|
|
185
|
-
/** Timestamp ISO hasta el que está bloqueado el slot (cuando `status === 'PENDING'`). */
|
|
186
|
-
lockedUntil?: string;
|
|
187
|
-
/**
|
|
188
|
-
* La cita que el backend creó al bloquear el slot. Junto con `hold`, es lo que el envío del
|
|
189
|
-
* formulario necesita para convertir el bloqueo en una cita en firme.
|
|
190
|
-
*/
|
|
191
|
-
appointment?: string;
|
|
192
|
-
/**
|
|
193
|
-
* Secreto que identifica al dueño del bloqueo. Solo quien lo tiene puede renovarlo, liberarlo o
|
|
194
|
-
* confirmarlo; viaja con el envío y el backend no lo conserva en el ticket.
|
|
195
|
-
*/
|
|
196
|
-
hold?: string;
|
|
197
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BookingFormStep — paso de agendamiento (flujo ligero).
|
|
3
|
-
*
|
|
4
|
-
* Permite que alguien externo agende en el calendario de una o varias personas.
|
|
5
|
-
* Flujo: (seleccionar persona) → seleccionar día → seleccionar hora.
|
|
6
|
-
*
|
|
7
|
-
* A diferencia del paso CALENDAR, este NO usa MUI X Scheduler:
|
|
8
|
-
* presenta una UI ligera de date-picker + lista de slots disponibles.
|
|
9
|
-
* La disponibilidad real la calcula el backend leyendo los calendarios referenciados.
|
|
10
|
-
*/
|
|
11
|
-
// ===========================================================================
|
|
12
|
-
// Enums
|
|
13
|
-
// ===========================================================================
|
|
14
|
-
/**
|
|
15
|
-
* Modalidad de la cita.
|
|
16
|
-
*/
|
|
17
|
-
export var BookingMode;
|
|
18
|
-
(function (BookingMode) {
|
|
19
|
-
/** Presencial — requiere ubicación física. */
|
|
20
|
-
BookingMode["IN_PERSON"] = "IN_PERSON";
|
|
21
|
-
/** Virtual / remota (Meet, Teams, Zoom, etc.). */
|
|
22
|
-
BookingMode["VIRTUAL"] = "VIRTUAL";
|
|
23
|
-
/** Híbrida — se acuerda entre las partes. */
|
|
24
|
-
BookingMode["HYBRID"] = "HYBRID";
|
|
25
|
-
})(BookingMode || (BookingMode = {}));
|
|
26
|
-
/**
|
|
27
|
-
* Cómo se maneja la selección de la persona a agendar.
|
|
28
|
-
*/
|
|
29
|
-
export var PersonSelectionMode;
|
|
30
|
-
(function (PersonSelectionMode) {
|
|
31
|
-
/**
|
|
32
|
-
* Un único calendario destino, sin selector de persona visible.
|
|
33
|
-
* El backend asigna automáticamente el slot disponible.
|
|
34
|
-
*/
|
|
35
|
-
PersonSelectionMode["NONE"] = "NONE";
|
|
36
|
-
/**
|
|
37
|
-
* El usuario puede elegir una persona específica o dejar que el sistema asigne.
|
|
38
|
-
*/
|
|
39
|
-
PersonSelectionMode["OPTIONAL"] = "OPTIONAL";
|
|
40
|
-
/**
|
|
41
|
-
* El usuario debe elegir una persona antes de ver los horarios disponibles.
|
|
42
|
-
*/
|
|
43
|
-
PersonSelectionMode["REQUIRED"] = "REQUIRED";
|
|
44
|
-
})(PersonSelectionMode || (PersonSelectionMode = {}));
|