@arquimedes.co/eureka-forms 3.0.53-new-steps → 3.0.53-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@Types/FormStep.d.ts +2 -7
- package/dist/@Types/FormStep.js +1 -2
- package/dist/FormSteps/Step.js +0 -16
- package/dist/FormSteps/StepFunctions.js +0 -14
- package/dist/FormSteps/StepFunctions.test.js +0 -54
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +7 -5
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.d.ts +3 -2
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +5 -4
- 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 +7 -8
- 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 -166
- package/dist/@Types/BookingFormStep.js +0 -44
- package/dist/@Types/CalendarFormStep.d.ts +0 -192
- package/dist/@Types/CalendarFormStep.js +0 -48
- 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/BookingStep/BookingStep.d.ts +0 -17
- package/dist/FormSteps/BookingStep/BookingStep.js +0 -14
- package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.d.ts +0 -7
- package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.js +0 -32
- package/dist/FormSteps/CalendarStep/CalendarStep.d.ts +0 -7
- package/dist/FormSteps/CalendarStep/CalendarStep.js +0 -14
- package/dist/FormSteps/CalendarStep/MaterialCalendarStep/MaterialCalendarStep.d.ts +0 -7
- package/dist/FormSteps/CalendarStep/MaterialCalendarStep/MaterialCalendarStep.js +0 -31
- 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 -47
- 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 -168
- package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.module.css +0 -94
- package/dist/FormSteps/NumberStep/NumberStep.d.ts +0 -10
- package/dist/FormSteps/NumberStep/NumberStep.js +0 -14
- 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/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.d.ts +0 -19
- package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.js +0 -80
- package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.module.css +0 -82
- package/dist/Shared/ErkAddressAutocomplete/googlePlaces.d.ts +0 -29
- package/dist/Shared/ErkAddressAutocomplete/googlePlaces.js +0 -139
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.d.ts +0 -31
- package/dist/Shared/ErkBookingPicker/ErkBookingPicker.js +0 -223
- 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 -107
- package/dist/Shared/ErkCalendar/CalendarFunctions.d.ts +0 -28
- package/dist/Shared/ErkCalendar/CalendarFunctions.js +0 -121
- package/dist/Shared/ErkCalendar/CalendarPopovers.d.ts +0 -45
- package/dist/Shared/ErkCalendar/CalendarPopovers.js +0 -110
- package/dist/Shared/ErkCalendar/ErkCalendar.d.ts +0 -73
- package/dist/Shared/ErkCalendar/ErkCalendar.js +0 -293
- package/dist/Shared/ErkCalendar/ErkCalendar.module.css +0 -775
- package/dist/Shared/ErkCalendar/ErkCalendar.test.d.ts +0 -1
- package/dist/Shared/ErkCalendar/ErkCalendar.test.js +0 -171
- package/dist/Shared/ErkLocationField/ErkLocationField.d.ts +0 -23
- package/dist/Shared/ErkLocationField/ErkLocationField.js +0 -73
- package/dist/Shared/ErkLocationField/ErkLocationField.module.css +0 -29
- 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 -115
- package/dist/Shared/ErkNumberField/ErkNumberField.d.ts +0 -42
- package/dist/Shared/ErkNumberField/ErkNumberField.js +0 -170
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DRAFT — LocationStep types
|
|
3
|
-
* Pendiente de revisión antes de integrar al FormStep union principal.
|
|
4
|
-
*/
|
|
5
|
-
import { GBaseStep } from './GenericFormSteps';
|
|
6
|
-
export { type DynamicRef } from './StepRef';
|
|
7
|
-
import FormStepTypes from '../constants/FormStepTypes';
|
|
8
|
-
/** Modos de entrada que el paso puede ofrecer al usuario */
|
|
9
|
-
export declare enum LocationInputMode {
|
|
10
|
-
/** Autocomplete de Google Places — retorna placeId, coordenadas y addressDetail */
|
|
11
|
-
GOOGLE_PLACES = "GOOGLE_PLACES",
|
|
12
|
-
/** Geolocalización del navegador (GPS) — retorna solo lat/lng */
|
|
13
|
-
GPS = "GPS",
|
|
14
|
-
/** Entrada manual de campos de dirección — sin coordenadas garantizadas */
|
|
15
|
-
MANUAL = "MANUAL"
|
|
16
|
-
}
|
|
17
|
-
/** Tipo de restricción geográfica */
|
|
18
|
-
export declare enum LocationRestrictionType {
|
|
19
|
-
/** Zona circular definida por un centro y un radio en metros */
|
|
20
|
-
RADIUS = "RADIUS",
|
|
21
|
-
/** Polígono arbitrario (geofence) */
|
|
22
|
-
GEOFENCE = "GEOFENCE"
|
|
23
|
-
}
|
|
24
|
-
/** Comportamiento de la restricción */
|
|
25
|
-
export declare enum LocationRestrictionBehavior {
|
|
26
|
-
/** Solo se permite una ubicación dentro de esta zona */
|
|
27
|
-
ALLOW = "ALLOW",
|
|
28
|
-
/** Se rechaza una ubicación dentro de esta zona */
|
|
29
|
-
DENY = "DENY"
|
|
30
|
-
}
|
|
31
|
-
/** Cómo se comporta cada campo de la dirección en el formulario */
|
|
32
|
-
export declare enum AddressFieldMode {
|
|
33
|
-
/** Se le pide al usuario final */
|
|
34
|
-
ASK = "ASK",
|
|
35
|
-
/** El diseñador fija el valor; el usuario no lo cambia */
|
|
36
|
-
FIXED = "FIXED",
|
|
37
|
-
/** No se pide ni se muestra */
|
|
38
|
-
OMIT = "OMIT"
|
|
39
|
-
}
|
|
40
|
-
export interface AddressFieldConfig {
|
|
41
|
-
mode: AddressFieldMode;
|
|
42
|
-
/** Valor usado solo cuando `mode === FIXED` */
|
|
43
|
-
fixedValue?: string;
|
|
44
|
-
}
|
|
45
|
-
/** Campos configurables — coinciden con las claves de LocationAddressDetail (countryCode se deriva de country) */
|
|
46
|
-
export type AddressFieldKey = 'street' | 'streetNumber' | 'unit' | 'neighborhood' | 'city' | 'state' | 'postalCode' | 'country';
|
|
47
|
-
/**
|
|
48
|
-
* Coordenadas fijas usadas como centro de una restricción de radio.
|
|
49
|
-
* Cuando el centro viene de otro step se usa StepRef con allowedStepTypes: ['LOCATION'].
|
|
50
|
-
*/
|
|
51
|
-
export interface LocationCoords {
|
|
52
|
-
latitude: number;
|
|
53
|
-
longitude: number;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Centro del radio: coordenadas fijas o referencia a otro LocationStep.
|
|
57
|
-
* El segundo parámetro de DynamicRef restringe las referencias a steps de tipo 'LOCATION'.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* // fijo
|
|
61
|
-
* center: { type: 'FIXED', value: { latitude: 6.2, longitude: -75.5 } }
|
|
62
|
-
*
|
|
63
|
-
* // dinámico — TypeScript solo acepta allowedStepTypes: ['LOCATION']
|
|
64
|
-
* center: { type: 'STEP_REF', idStep: 'step_origen', allowedStepTypes: ['LOCATION'] }
|
|
65
|
-
*/
|
|
66
|
-
/** Restricción circular */
|
|
67
|
-
export interface RadiusRestriction {
|
|
68
|
-
type: LocationRestrictionType.RADIUS;
|
|
69
|
-
behavior: LocationRestrictionBehavior;
|
|
70
|
-
center: LocationCoords;
|
|
71
|
-
/** Radio en metros */
|
|
72
|
-
radiusMeters: number;
|
|
73
|
-
/** Mensaje de error personalizado cuando la validación falla */
|
|
74
|
-
errorMessage?: string;
|
|
75
|
-
}
|
|
76
|
-
/** Vértice de un polígono */
|
|
77
|
-
export interface GeofenceVertex {
|
|
78
|
-
latitude: number;
|
|
79
|
-
longitude: number;
|
|
80
|
-
}
|
|
81
|
-
/** Restricción por polígono — mínimo 3 vértices, se cierra automáticamente */
|
|
82
|
-
export interface GeofenceRestriction {
|
|
83
|
-
type: LocationRestrictionType.GEOFENCE;
|
|
84
|
-
behavior: LocationRestrictionBehavior;
|
|
85
|
-
/** Lista ordenada de vértices que forman el polígono */
|
|
86
|
-
polygon: [GeofenceVertex, GeofenceVertex, GeofenceVertex, ...GeofenceVertex[]];
|
|
87
|
-
/** Mensaje de error personalizado cuando la validación falla */
|
|
88
|
-
errorMessage?: string;
|
|
89
|
-
}
|
|
90
|
-
/** Una restricción geográfica — pueden combinarse varias (todas deben cumplirse) */
|
|
91
|
-
export type LocationRestriction = RadiusRestriction | GeofenceRestriction;
|
|
92
|
-
export interface LocationStep extends GBaseStep {
|
|
93
|
-
type: FormStepTypes.LOCATION;
|
|
94
|
-
label: string;
|
|
95
|
-
description: string | null;
|
|
96
|
-
required: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Modos de entrada habilitados. Al menos uno debe estar presente.
|
|
99
|
-
* Si solo hay uno, la UI no muestra selector de modo.
|
|
100
|
-
*/
|
|
101
|
-
allowedModes: [LocationInputMode, ...LocationInputMode[]];
|
|
102
|
-
/**
|
|
103
|
-
* Modo que se preselecciona al abrir el paso.
|
|
104
|
-
* Debe estar incluido en allowedModes.
|
|
105
|
-
* Si no se especifica, se usa el primero de allowedModes.
|
|
106
|
-
*/
|
|
107
|
-
defaultMode?: LocationInputMode;
|
|
108
|
-
/**
|
|
109
|
-
* Restricciones geográficas. Se evalúan todas (lógica AND).
|
|
110
|
-
* Una ubicación es válida solo si pasa cada restricción.
|
|
111
|
-
*/
|
|
112
|
-
restrictions?: LocationRestriction[];
|
|
113
|
-
/**
|
|
114
|
-
* Config por campo de la dirección: pedir / fijar / omitir.
|
|
115
|
-
* Aplica al modo MANUAL (qué campos se muestran) y como override tras autocompletar
|
|
116
|
-
* con GOOGLE_PLACES (los FIXED se sobreescriben, los OMIT se descartan del value).
|
|
117
|
-
*/
|
|
118
|
-
addressFields?: Partial<Record<AddressFieldKey, AddressFieldConfig>>;
|
|
119
|
-
size: 1 | 2 | 3 | 4;
|
|
120
|
-
defaultValue?: LocationStepValue | null;
|
|
121
|
-
}
|
|
122
|
-
/** Desglose estructurado de la dirección (mismo shape que AddressModel) */
|
|
123
|
-
export interface LocationAddressDetail {
|
|
124
|
-
street?: string;
|
|
125
|
-
streetNumber?: string;
|
|
126
|
-
unit?: string;
|
|
127
|
-
neighborhood?: string;
|
|
128
|
-
city?: string;
|
|
129
|
-
state?: string;
|
|
130
|
-
country?: string;
|
|
131
|
-
/** ISO 3166-1 alpha-2 (e.g., "CO", "US", "MX") */
|
|
132
|
-
countryCode?: string;
|
|
133
|
-
postalCode?: string;
|
|
134
|
-
}
|
|
135
|
-
export interface LocationStepValue {
|
|
136
|
-
/** Indica cómo fue capturada la ubicación */
|
|
137
|
-
source: LocationInputMode;
|
|
138
|
-
/**
|
|
139
|
-
* Latitud — presente si source es GOOGLE_PLACES o GPS.
|
|
140
|
-
* Ausente en MANUAL si el usuario no activó coordenadas.
|
|
141
|
-
*/
|
|
142
|
-
latitude?: number;
|
|
143
|
-
/**
|
|
144
|
-
* Longitud — presente si source es GOOGLE_PLACES o GPS.
|
|
145
|
-
* Ausente en MANUAL si el usuario no activó coordenadas.
|
|
146
|
-
*/
|
|
147
|
-
longitude?: number;
|
|
148
|
-
/** Nombre del lugar o negocio (ej: "Torre Bancolombia") */
|
|
149
|
-
name?: string;
|
|
150
|
-
/** Dirección completa formateada (viene de Google o construida manualmente) */
|
|
151
|
-
address?: string;
|
|
152
|
-
/**
|
|
153
|
-
* Google Place ID — presente solo si source === GOOGLE_PLACES.
|
|
154
|
-
* Permite re-fetch de detalles y construcción de links a Maps.
|
|
155
|
-
*/
|
|
156
|
-
placeId?: string;
|
|
157
|
-
/** Desglose campo a campo de la dirección */
|
|
158
|
-
addressDetail?: LocationAddressDetail;
|
|
159
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DRAFT — LocationStep types
|
|
3
|
-
* Pendiente de revisión antes de integrar al FormStep union principal.
|
|
4
|
-
*/
|
|
5
|
-
// ---------------------------------------------------------------------------
|
|
6
|
-
// Enums
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
/** Modos de entrada que el paso puede ofrecer al usuario */
|
|
9
|
-
export var LocationInputMode;
|
|
10
|
-
(function (LocationInputMode) {
|
|
11
|
-
/** Autocomplete de Google Places — retorna placeId, coordenadas y addressDetail */
|
|
12
|
-
LocationInputMode["GOOGLE_PLACES"] = "GOOGLE_PLACES";
|
|
13
|
-
/** Geolocalización del navegador (GPS) — retorna solo lat/lng */
|
|
14
|
-
LocationInputMode["GPS"] = "GPS";
|
|
15
|
-
/** Entrada manual de campos de dirección — sin coordenadas garantizadas */
|
|
16
|
-
LocationInputMode["MANUAL"] = "MANUAL";
|
|
17
|
-
})(LocationInputMode || (LocationInputMode = {}));
|
|
18
|
-
/** Tipo de restricción geográfica */
|
|
19
|
-
export var LocationRestrictionType;
|
|
20
|
-
(function (LocationRestrictionType) {
|
|
21
|
-
/** Zona circular definida por un centro y un radio en metros */
|
|
22
|
-
LocationRestrictionType["RADIUS"] = "RADIUS";
|
|
23
|
-
/** Polígono arbitrario (geofence) */
|
|
24
|
-
LocationRestrictionType["GEOFENCE"] = "GEOFENCE";
|
|
25
|
-
})(LocationRestrictionType || (LocationRestrictionType = {}));
|
|
26
|
-
/** Comportamiento de la restricción */
|
|
27
|
-
export var LocationRestrictionBehavior;
|
|
28
|
-
(function (LocationRestrictionBehavior) {
|
|
29
|
-
/** Solo se permite una ubicación dentro de esta zona */
|
|
30
|
-
LocationRestrictionBehavior["ALLOW"] = "ALLOW";
|
|
31
|
-
/** Se rechaza una ubicación dentro de esta zona */
|
|
32
|
-
LocationRestrictionBehavior["DENY"] = "DENY";
|
|
33
|
-
})(LocationRestrictionBehavior || (LocationRestrictionBehavior = {}));
|
|
34
|
-
// ---------------------------------------------------------------------------
|
|
35
|
-
// Config por campo de la dirección (fijo / pedir / omitir)
|
|
36
|
-
// ---------------------------------------------------------------------------
|
|
37
|
-
/** Cómo se comporta cada campo de la dirección en el formulario */
|
|
38
|
-
export var AddressFieldMode;
|
|
39
|
-
(function (AddressFieldMode) {
|
|
40
|
-
/** Se le pide al usuario final */
|
|
41
|
-
AddressFieldMode["ASK"] = "ASK";
|
|
42
|
-
/** El diseñador fija el valor; el usuario no lo cambia */
|
|
43
|
-
AddressFieldMode["FIXED"] = "FIXED";
|
|
44
|
-
/** No se pide ni se muestra */
|
|
45
|
-
AddressFieldMode["OMIT"] = "OMIT";
|
|
46
|
-
})(AddressFieldMode || (AddressFieldMode = {}));
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NumericFormSteps types
|
|
3
|
-
* Cubre el paso relacionado con números y sus múltiples subtipos.
|
|
4
|
-
*/
|
|
5
|
-
import { GBaseStep } from './GenericFormSteps';
|
|
6
|
-
import FormStepTypes from '../constants/FormStepTypes';
|
|
7
|
-
/** Subtipo del paso numérico — discriminante secundario */
|
|
8
|
-
export declare enum NumberStepType {
|
|
9
|
-
INTEGER = "INTEGER",
|
|
10
|
-
DECIMAL = "DECIMAL",
|
|
11
|
-
PERCENTAGE = "PERCENTAGE",
|
|
12
|
-
/** Monto de dinero en una divisa (ej: 1500 COP). */
|
|
13
|
-
MONEY = "MONEY",
|
|
14
|
-
/** Magnitud con unidad de medida (ej: 5 kg). */
|
|
15
|
-
MEASURE = "MEASURE",
|
|
16
|
-
/** Precio por unidad: divisa sobre unidad (ej: 20 USD / hora). */
|
|
17
|
-
UNIT_PRICE = "UNIT_PRICE"
|
|
18
|
-
}
|
|
19
|
-
/** Campos base compartidos por todos los subtipos numéricos */
|
|
20
|
-
interface GNumberStep extends GBaseStep {
|
|
21
|
-
type: FormStepTypes.NUMBER;
|
|
22
|
-
numberType: NumberStepType;
|
|
23
|
-
label: string;
|
|
24
|
-
description: string | null;
|
|
25
|
-
required: boolean;
|
|
26
|
-
min?: number;
|
|
27
|
-
max?: number;
|
|
28
|
-
/** Cantidad de decimales permitidos (0 = entero). Default: 2 */
|
|
29
|
-
decimals?: number;
|
|
30
|
-
/** Sufijo de unidad estático que se muestra junto al valor (solo visual, no afecta el número guardado). */
|
|
31
|
-
suffix?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Mostrar u ocultar los botones +/− de incremento/decremento.
|
|
34
|
-
* Default: true
|
|
35
|
-
*/
|
|
36
|
-
spinner?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Tamaño de cada incremento/decremento al usar los botones o las flechas del teclado.
|
|
39
|
-
* Útil para monedas (0.01), cantidades grandes (100) o porcentajes (5).
|
|
40
|
-
* Default: 1
|
|
41
|
-
*/
|
|
42
|
-
step?: number;
|
|
43
|
-
/** Texto de placeholder del campo numérico. */
|
|
44
|
-
placeholder?: string;
|
|
45
|
-
size: 1 | 2 | 3 | 4;
|
|
46
|
-
}
|
|
47
|
-
export interface IntegerStep extends GNumberStep {
|
|
48
|
-
numberType: NumberStepType.INTEGER;
|
|
49
|
-
/** Siempre 0 para enteros, pero puede dejarse undefined */
|
|
50
|
-
decimals?: 0;
|
|
51
|
-
defaultValue?: number;
|
|
52
|
-
}
|
|
53
|
-
export interface DecimalStep extends GNumberStep {
|
|
54
|
-
numberType: NumberStepType.DECIMAL;
|
|
55
|
-
defaultValue?: number;
|
|
56
|
-
}
|
|
57
|
-
export interface PercentageStep extends GNumberStep {
|
|
58
|
-
numberType: NumberStepType.PERCENTAGE;
|
|
59
|
-
defaultValue?: number;
|
|
60
|
-
}
|
|
61
|
-
export interface MoneyStep extends GNumberStep {
|
|
62
|
-
numberType: NumberStepType.MONEY;
|
|
63
|
-
/** Moneda fija (ej: "COP", "USD", "EUR") */
|
|
64
|
-
currency?: string;
|
|
65
|
-
allowCurrencyChange?: boolean;
|
|
66
|
-
availableCurrencies?: string[];
|
|
67
|
-
defaultValue?: MoneyValue | null;
|
|
68
|
-
}
|
|
69
|
-
export interface MeasureStep extends GNumberStep {
|
|
70
|
-
numberType: NumberStepType.MEASURE;
|
|
71
|
-
/** Unidad fija (ej: "kg", "m", "hrs") */
|
|
72
|
-
unit?: string;
|
|
73
|
-
allowUnitChange?: boolean;
|
|
74
|
-
availableUnits?: string[];
|
|
75
|
-
defaultValue?: MeasureValue | null;
|
|
76
|
-
}
|
|
77
|
-
export interface UnitPriceStep extends GNumberStep {
|
|
78
|
-
numberType: NumberStepType.UNIT_PRICE;
|
|
79
|
-
/** Moneda del precio (ej: "USD") */
|
|
80
|
-
currency?: string;
|
|
81
|
-
/** Unidad base del precio (ej: "hrs", "km", "mes") */
|
|
82
|
-
unit?: string;
|
|
83
|
-
allowCurrencyChange?: boolean;
|
|
84
|
-
allowUnitChange?: boolean;
|
|
85
|
-
availableCurrencies?: string[];
|
|
86
|
-
availableUnits?: string[];
|
|
87
|
-
defaultValue?: UnitPriceValue | null;
|
|
88
|
-
}
|
|
89
|
-
/** Unión discriminada del paso NUMBER — narrowing por numberType */
|
|
90
|
-
export type NumberStep = IntegerStep | DecimalStep | PercentageStep | MoneyStep | MeasureStep | UnitPriceStep;
|
|
91
|
-
export type IntegerValue = number;
|
|
92
|
-
export type DecimalValue = number;
|
|
93
|
-
export type PercentageValue = number;
|
|
94
|
-
export interface MoneyValue {
|
|
95
|
-
value: number;
|
|
96
|
-
currency: string;
|
|
97
|
-
}
|
|
98
|
-
export interface MeasureValue {
|
|
99
|
-
value: number;
|
|
100
|
-
unit: string;
|
|
101
|
-
}
|
|
102
|
-
export interface UnitPriceValue {
|
|
103
|
-
value: number;
|
|
104
|
-
currency: string;
|
|
105
|
-
unit: string;
|
|
106
|
-
}
|
|
107
|
-
export type NumberStepValue = number | MoneyValue | MeasureValue | UnitPriceValue;
|
|
108
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NumericFormSteps types
|
|
3
|
-
* Cubre el paso relacionado con números y sus múltiples subtipos.
|
|
4
|
-
*/
|
|
5
|
-
// ===========================================================================
|
|
6
|
-
// NUMBER
|
|
7
|
-
// ===========================================================================
|
|
8
|
-
/** Subtipo del paso numérico — discriminante secundario */
|
|
9
|
-
export var NumberStepType;
|
|
10
|
-
(function (NumberStepType) {
|
|
11
|
-
NumberStepType["INTEGER"] = "INTEGER";
|
|
12
|
-
NumberStepType["DECIMAL"] = "DECIMAL";
|
|
13
|
-
NumberStepType["PERCENTAGE"] = "PERCENTAGE";
|
|
14
|
-
/** Monto de dinero en una divisa (ej: 1500 COP). */
|
|
15
|
-
NumberStepType["MONEY"] = "MONEY";
|
|
16
|
-
/** Magnitud con unidad de medida (ej: 5 kg). */
|
|
17
|
-
NumberStepType["MEASURE"] = "MEASURE";
|
|
18
|
-
/** Precio por unidad: divisa sobre unidad (ej: 20 USD / hora). */
|
|
19
|
-
NumberStepType["UNIT_PRICE"] = "UNIT_PRICE";
|
|
20
|
-
})(NumberStepType || (NumberStepType = {}));
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DRAFT — PredefinedSelectorFormStep types
|
|
3
|
-
*
|
|
4
|
-
* Paso que reemplaza tener que configurar manualmente opciones de selectores
|
|
5
|
-
* para listas fijas y controladas por Capta (países, ciudades, monedas, etc.).
|
|
6
|
-
* Las opciones vienen de APIs internas — el formulario no necesita configurarlas.
|
|
7
|
-
*
|
|
8
|
-
* También resuelve la cascada Country → State → City via parentStepId.
|
|
9
|
-
*/
|
|
10
|
-
import { GSmartSelect } from './GenericFormSteps';
|
|
11
|
-
export declare enum PredefinedOptionType {
|
|
12
|
-
/** ISO 3166-1 — lista de países */
|
|
13
|
-
COUNTRY = "COUNTRY",
|
|
14
|
-
/**
|
|
15
|
-
* Departamento / provincia / estado.
|
|
16
|
-
* Requiere parentStepId apuntando a un step COUNTRY.
|
|
17
|
-
*/
|
|
18
|
-
STATE = "STATE",
|
|
19
|
-
/**
|
|
20
|
-
* Ciudad / municipio.
|
|
21
|
-
* Requiere parentStepId apuntando a un step STATE (o COUNTRY si no hay STATE).
|
|
22
|
-
*/
|
|
23
|
-
CITY = "CITY",
|
|
24
|
-
/** ISO 4217 — monedas (USD, COP, EUR, etc.) */
|
|
25
|
-
CURRENCY = "CURRENCY",
|
|
26
|
-
/** BCP 47 — idiomas (es, en, pt, etc.) */
|
|
27
|
-
LANGUAGE = "LANGUAGE",
|
|
28
|
-
/** Tipos de canal de comunicación (WhatsApp, Email, Teléfono) */
|
|
29
|
-
COMMUNICATION_CHANNEL_TYPE = "COMMUNICATION_CHANNEL_TYPE",
|
|
30
|
-
/** Tipos de documento de identidad por país (CC, NIT, Pasaporte, etc.) */
|
|
31
|
-
DOCUMENT_TYPE = "DOCUMENT_TYPE",
|
|
32
|
-
/** Días de la semana */
|
|
33
|
-
DAY_OF_WEEK = "DAY_OF_WEEK",
|
|
34
|
-
/** Meses del año */
|
|
35
|
-
MONTH = "MONTH"
|
|
36
|
-
}
|
|
37
|
-
export interface PredefinedSelectorStep extends GSmartSelect {
|
|
38
|
-
type: 'PREDEFINED_SELECTOR';
|
|
39
|
-
predefinedType: PredefinedOptionType;
|
|
40
|
-
/**
|
|
41
|
-
* Solo para STATE y CITY: id del step padre que filtra las opciones.
|
|
42
|
-
* - COUNTRY step → filtra estados del país seleccionado
|
|
43
|
-
* - STATE step → filtra ciudades del estado seleccionado
|
|
44
|
-
*
|
|
45
|
-
* Si no se especifica, se listan todas las opciones sin filtrar.
|
|
46
|
-
*/
|
|
47
|
-
parentStepId?: string;
|
|
48
|
-
maxSize?: number;
|
|
49
|
-
defaultValue?: string;
|
|
50
|
-
}
|
|
51
|
-
export type PredefinedSelectorValue = string;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DRAFT — PredefinedSelectorFormStep types
|
|
3
|
-
*
|
|
4
|
-
* Paso que reemplaza tener que configurar manualmente opciones de selectores
|
|
5
|
-
* para listas fijas y controladas por Capta (países, ciudades, monedas, etc.).
|
|
6
|
-
* Las opciones vienen de APIs internas — el formulario no necesita configurarlas.
|
|
7
|
-
*
|
|
8
|
-
* También resuelve la cascada Country → State → City via parentStepId.
|
|
9
|
-
*/
|
|
10
|
-
// ===========================================================================
|
|
11
|
-
// Tipos predefinidos disponibles
|
|
12
|
-
// ===========================================================================
|
|
13
|
-
export var PredefinedOptionType;
|
|
14
|
-
(function (PredefinedOptionType) {
|
|
15
|
-
/** ISO 3166-1 — lista de países */
|
|
16
|
-
PredefinedOptionType["COUNTRY"] = "COUNTRY";
|
|
17
|
-
/**
|
|
18
|
-
* Departamento / provincia / estado.
|
|
19
|
-
* Requiere parentStepId apuntando a un step COUNTRY.
|
|
20
|
-
*/
|
|
21
|
-
PredefinedOptionType["STATE"] = "STATE";
|
|
22
|
-
/**
|
|
23
|
-
* Ciudad / municipio.
|
|
24
|
-
* Requiere parentStepId apuntando a un step STATE (o COUNTRY si no hay STATE).
|
|
25
|
-
*/
|
|
26
|
-
PredefinedOptionType["CITY"] = "CITY";
|
|
27
|
-
/** ISO 4217 — monedas (USD, COP, EUR, etc.) */
|
|
28
|
-
PredefinedOptionType["CURRENCY"] = "CURRENCY";
|
|
29
|
-
/** BCP 47 — idiomas (es, en, pt, etc.) */
|
|
30
|
-
PredefinedOptionType["LANGUAGE"] = "LANGUAGE";
|
|
31
|
-
/** Tipos de canal de comunicación (WhatsApp, Email, Teléfono) */
|
|
32
|
-
PredefinedOptionType["COMMUNICATION_CHANNEL_TYPE"] = "COMMUNICATION_CHANNEL_TYPE";
|
|
33
|
-
/** Tipos de documento de identidad por país (CC, NIT, Pasaporte, etc.) */
|
|
34
|
-
PredefinedOptionType["DOCUMENT_TYPE"] = "DOCUMENT_TYPE";
|
|
35
|
-
/** Días de la semana */
|
|
36
|
-
PredefinedOptionType["DAY_OF_WEEK"] = "DAY_OF_WEEK";
|
|
37
|
-
/** Meses del año */
|
|
38
|
-
PredefinedOptionType["MONTH"] = "MONTH";
|
|
39
|
-
})(PredefinedOptionType || (PredefinedOptionType = {}));
|
package/dist/@Types/StepRef.d.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DRAFT — Sistema de referencias dinámicas entre steps
|
|
3
|
-
*
|
|
4
|
-
* Permite que la configuración de un paso use el valor en tiempo de ejecución
|
|
5
|
-
* de otro step del mismo formulario, en lugar de un literal fijo.
|
|
6
|
-
*
|
|
7
|
-
* Patrón de uso:
|
|
8
|
-
*
|
|
9
|
-
* // Valor fijo definido en la configuración del formulario
|
|
10
|
-
* suffix: { type: 'FIXED', value: 'km' }
|
|
11
|
-
*
|
|
12
|
-
* // Valor tomado del step 'step_unidad' cuando el usuario interactúa
|
|
13
|
-
* suffix: { type: 'STEP_REF', idStep: 'step_unidad', fallback: 'm' }
|
|
14
|
-
*
|
|
15
|
-
* Se puede aplicar a cualquier campo de configuración cuyo valor deba
|
|
16
|
-
* responder a la selección previa del usuario: sufijos, unidades, monedas,
|
|
17
|
-
* títulos dinámicos, límites numéricos, etc.
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Representa un valor estático/literal configurado en tiempo de diseño.
|
|
21
|
-
* No cambia dinámicamente según las respuestas del usuario.
|
|
22
|
-
*
|
|
23
|
-
* @typeParam T - Tipo de dato del valor estático.
|
|
24
|
-
*/
|
|
25
|
-
export interface FixedRef<T> {
|
|
26
|
-
/**
|
|
27
|
-
* Indica que el valor es fijo.
|
|
28
|
-
*/
|
|
29
|
-
type: 'FIXED';
|
|
30
|
-
/**
|
|
31
|
-
* El valor estático de tipo T.
|
|
32
|
-
* @example "km"
|
|
33
|
-
* @example 50
|
|
34
|
-
*/
|
|
35
|
-
value: T;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Referencia dinámica al valor actual de otro step en el mismo formulario.
|
|
39
|
-
* El runtime del formulario sustituye esta referencia por el valor que el usuario
|
|
40
|
-
* haya ingresado en el step indicado.
|
|
41
|
-
*
|
|
42
|
-
* @typeParam TAllowed - Literal(es) de tipo de step permitidos como origen.
|
|
43
|
-
* Por defecto es `string` (cualquier tipo de step). Pasar un literal union
|
|
44
|
-
* permite al Form Builder filtrar la lista de steps disponibles en la UI.
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```ts
|
|
48
|
-
* // Referencia a cualquier tipo de step
|
|
49
|
-
* const ref: StepRef = {
|
|
50
|
-
* type: 'STEP_REF',
|
|
51
|
-
* idStep: 'step_unidad_medida',
|
|
52
|
-
* fallback: 'm'
|
|
53
|
-
* }
|
|
54
|
-
*
|
|
55
|
-
* // Referencia restringida únicamente a pasos de tipo LOCATION
|
|
56
|
-
* const refLocation: StepRef<'LOCATION'> = {
|
|
57
|
-
* type: 'STEP_REF',
|
|
58
|
-
* idStep: 'step_destino_cliente',
|
|
59
|
-
* allowedStepTypes: ['LOCATION']
|
|
60
|
-
* }
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
export interface StepRef<TAllowed extends string = string> {
|
|
64
|
-
/**
|
|
65
|
-
* Indica que el valor se toma dinámicamente de otro paso.
|
|
66
|
-
*/
|
|
67
|
-
type: 'STEP_REF';
|
|
68
|
-
/**
|
|
69
|
-
* ID del paso origen en el formulario del cual se leerá el valor en tiempo de ejecución.
|
|
70
|
-
* @example "step_ubicacion_cliente"
|
|
71
|
-
*/
|
|
72
|
-
idStep: string;
|
|
73
|
-
/**
|
|
74
|
-
* Valor de respaldo (fallback) en formato de texto a utilizar mientras el paso referenciado
|
|
75
|
-
* no contenga ningún valor (ej: porque el usuario aún no llega a ese paso).
|
|
76
|
-
* Si se omite, el campo referenciador se comportará como vacío o sin unidad.
|
|
77
|
-
*
|
|
78
|
-
* @example "m"
|
|
79
|
-
*/
|
|
80
|
-
fallback?: string;
|
|
81
|
-
/**
|
|
82
|
-
* Lista de tipos de pasos permitidos para esta referencia.
|
|
83
|
-
* Ayuda al Form Builder a filtrar la interfaz de selección de campos y es
|
|
84
|
-
* validada por el backend al guardar la configuración del formulario.
|
|
85
|
-
* Si no se define, se permite referenciar cualquier tipo de paso.
|
|
86
|
-
*
|
|
87
|
-
* @example ["LOCATION"]
|
|
88
|
-
* @example ["PREDEFINED_SELECTOR", "CHECKBOX"]
|
|
89
|
-
*/
|
|
90
|
-
allowedStepTypes?: TAllowed[];
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Tipo genérico para campos que admiten tanto un valor estático como una referencia dinámica.
|
|
94
|
-
*
|
|
95
|
-
* @typeParam T - Tipo del valor cuando es FIXED (ej: `string`, `number`, `boolean`).
|
|
96
|
-
* @typeParam TAllowed - Tipos de paso de origen permitidos si es STEP_REF.
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* ```ts
|
|
100
|
-
* // Un sufijo de texto dinámico:
|
|
101
|
-
* const sufijo: DynamicRef<string> = { type: 'FIXED', value: 'km' };
|
|
102
|
-
*
|
|
103
|
-
* // Una coordenada geográfica que debe venir de un paso de mapa:
|
|
104
|
-
* const origen: DynamicRef<LocationCoords, 'LOCATION'> = {
|
|
105
|
-
* type: 'STEP_REF',
|
|
106
|
-
* idStep: 'step_mapa_inicio',
|
|
107
|
-
* allowedStepTypes: ['LOCATION']
|
|
108
|
-
* };
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
export type DynamicRef<T, TAllowed extends string = string> = FixedRef<T> | StepRef<TAllowed>;
|
|
112
|
-
/**
|
|
113
|
-
* Comprueba si la referencia dinámica recibida es de tipo FIXED.
|
|
114
|
-
* Funciona como Type Guard para TypeScript.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```ts
|
|
118
|
-
* if (isFixedRef(miRef)) {
|
|
119
|
-
* console.log("El valor es:", miRef.value);
|
|
120
|
-
* }
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
export declare function isFixedRef<T, TAllowed extends string = string>(ref: DynamicRef<T, TAllowed>): ref is FixedRef<T>;
|
|
124
|
-
/**
|
|
125
|
-
* Comprueba si la referencia dinámica recibida es de tipo STEP_REF.
|
|
126
|
-
* Funciona como Type Guard para TypeScript.
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* ```ts
|
|
130
|
-
* if (isStepRef(miRef)) {
|
|
131
|
-
* console.log("Apunta al step:", miRef.idStep);
|
|
132
|
-
* }
|
|
133
|
-
* ```
|
|
134
|
-
*/
|
|
135
|
-
export declare function isStepRef<T, TAllowed extends string = string>(ref: DynamicRef<T, TAllowed>): ref is StepRef<TAllowed>;
|
package/dist/@Types/StepRef.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DRAFT — Sistema de referencias dinámicas entre steps
|
|
3
|
-
*
|
|
4
|
-
* Permite que la configuración de un paso use el valor en tiempo de ejecución
|
|
5
|
-
* de otro step del mismo formulario, en lugar de un literal fijo.
|
|
6
|
-
*
|
|
7
|
-
* Patrón de uso:
|
|
8
|
-
*
|
|
9
|
-
* // Valor fijo definido en la configuración del formulario
|
|
10
|
-
* suffix: { type: 'FIXED', value: 'km' }
|
|
11
|
-
*
|
|
12
|
-
* // Valor tomado del step 'step_unidad' cuando el usuario interactúa
|
|
13
|
-
* suffix: { type: 'STEP_REF', idStep: 'step_unidad', fallback: 'm' }
|
|
14
|
-
*
|
|
15
|
-
* Se puede aplicar a cualquier campo de configuración cuyo valor deba
|
|
16
|
-
* responder a la selección previa del usuario: sufijos, unidades, monedas,
|
|
17
|
-
* títulos dinámicos, límites numéricos, etc.
|
|
18
|
-
*/
|
|
19
|
-
// ---------------------------------------------------------------------------
|
|
20
|
-
// Helpers de narrowing
|
|
21
|
-
// ---------------------------------------------------------------------------
|
|
22
|
-
/**
|
|
23
|
-
* Comprueba si la referencia dinámica recibida es de tipo FIXED.
|
|
24
|
-
* Funciona como Type Guard para TypeScript.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* if (isFixedRef(miRef)) {
|
|
29
|
-
* console.log("El valor es:", miRef.value);
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export function isFixedRef(ref) {
|
|
34
|
-
return ref.type === 'FIXED';
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Comprueba si la referencia dinámica recibida es de tipo STEP_REF.
|
|
38
|
-
* Funciona como Type Guard para TypeScript.
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```ts
|
|
42
|
-
* if (isStepRef(miRef)) {
|
|
43
|
-
* console.log("Apunta al step:", miRef.idStep);
|
|
44
|
-
* }
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export function isStepRef(ref) {
|
|
48
|
-
return ref.type === 'STEP_REF';
|
|
49
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BookingStep } from '../../@Types/BookingFormStep';
|
|
2
|
-
import { BookingSlot } from '../../@Types/BookingFormStep';
|
|
3
|
-
import { StepProps } from '../Step';
|
|
4
|
-
export interface BookingStepProps extends StepProps {
|
|
5
|
-
step: BookingStep;
|
|
6
|
-
/**
|
|
7
|
-
* Callback to fetch available slots for a given person + date.
|
|
8
|
-
* The form host wires this to their availability API.
|
|
9
|
-
* If omitted, the component shows an empty slot list.
|
|
10
|
-
*/
|
|
11
|
-
fetchSlots?: (params: {
|
|
12
|
-
personId?: string;
|
|
13
|
-
date: string;
|
|
14
|
-
}) => Promise<BookingSlot[]>;
|
|
15
|
-
}
|
|
16
|
-
declare function BookingStepComponent(props: BookingStepProps): JSX.Element;
|
|
17
|
-
export default BookingStepComponent;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FormStyleTypes } from '../../constants/FormStepTypes';
|
|
3
|
-
import MaterialBookingStep from './MaterialBookingStep/MaterialBookingStep';
|
|
4
|
-
import { useAppSelector } from '../../hooks';
|
|
5
|
-
function BookingStepComponent(props) {
|
|
6
|
-
const { formStyle } = useAppSelector((state) => state.global);
|
|
7
|
-
switch (formStyle.type) {
|
|
8
|
-
case FormStyleTypes.MATERIAL:
|
|
9
|
-
default: {
|
|
10
|
-
return _jsx(MaterialBookingStep, { ...props });
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export default BookingStepComponent;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BookingStepProps } from '../BookingStep';
|
|
2
|
-
/**
|
|
3
|
-
* Conector del paso BOOKING: enlaza el estado del formulario (`useFormStep`) y el
|
|
4
|
-
* theming del form con el componente reutilizable `ErkBookingPicker` (en Shared).
|
|
5
|
-
*/
|
|
6
|
-
declare function MaterialBookingStep({ step, editable, fetchSlots }: BookingStepProps): JSX.Element;
|
|
7
|
-
export default MaterialBookingStep;
|