@envisiongroup/porygon 1.0.0-rc.41 → 1.0.0-rc.42

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.
@@ -138,7 +138,7 @@ const i = (t) => ({
138
138
  return `${a}/${u}/${n}`;
139
139
  }
140
140
  }, d = (t) => {
141
- if (t instanceof Date) return t;
141
+ if (t instanceof Date) return s(t) ? t : null;
142
142
  if (typeof t == "string")
143
143
  try {
144
144
  const e = new Date(t);
@@ -1,25 +1,10 @@
1
1
  import { EFWInputProps } from './EFWInput.types';
2
2
 
3
3
  /**
4
- * Componente de entrada de texto personalizado con soporte para formateo y validación.
5
- * Permite manejar valores con formatos específicos (como RUT chileno, correo electrónico, números) y valida la entrada del usuario.
6
- * @param {EFWInputProps} props - Propiedades del componente.
7
- * @param {string} [props.value=""] - Valor inicial del input.
8
- * @param {(rawValue: string, formattedValue: string) => void} [props.onChange] - Función llamada cuando cambia el valor del input.
9
- * @param {boolean} [props.editable=true] - Indica si el input es editable o de solo lectura.
10
- * @param {boolean} [props.disabled=false] - Indica si el input está deshabilitado.
11
- * @param {string} [props.autoComplete="off"] - Configuración de autocompletado del input.
12
- * @param {string} [props.type="text"] - Tipo de input (por ejemplo, 'text', 'number').
13
- * @param {React.ReactNode} [props.contentBefore] - Contenido renderizado antes del input.
14
- * @param {React.ReactNode} [props.contentAfter] - Contenido renderizado después del input.
15
- * @param {string} [props.formatType="none"] - Tipo de formateo aplicado al valor (por ejemplo, 'chileanRut', 'email', 'number').
16
- * @param {string} [props.formatPattern] - Expresión regular para validar el formato del valor.
17
- * @param {(value: string) => string} [props.formatFunction] - Función personalizada para formatear el valor.
18
- * @param {number} [props.maxLength=250] - Longitud máxima del valor en caracteres.
19
- * @param {number} [props.maxValue] - Valor numérico máximo permitido (para `formatType="number"`).
20
- * @param {number} [props.minValue] - Valor numérico mínimo permitido (para `formatType="number"`).
21
- * @param {string} [props.validationState="none"] - Estado de validación externo ('none', 'error').
22
- * @param {(state: string, message: string) => void} [props.setParentComponentState] - Función para actualizar el estado de validación en el componente padre.
23
- * @returns {JSX.Element} El componente de input o texto renderizado según la configuración.
4
+ * Campo de texto con soporte para modo controlled/uncontrolled, formato visual,
5
+ * normalización de valor crudo, validación y render de solo lectura.
6
+ *
7
+ * Los contratos públicos viven en `EFWInput.types.tsx`; este componente se
8
+ * encarga de orquestar estado, callbacks y render.
24
9
  */
25
10
  export declare const EFWInput: (props: EFWInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,199 +1,241 @@
1
- import { jsx as M, Fragment as Be } from "react/jsx-runtime";
2
- import { makeStyles as Pe, tokens as v, mergeClasses as Te, Text as We, Input as De } from "@fluentui/react-components";
3
- import { useId as Ne, useRef as Ve, useState as fe, useMemo as h, useCallback as z, useEffect as C } from "react";
4
- import { stripFormatting as f, getInputFormattedValue as B, isFormattableValue as Oe, validateChileanRut as je, validateEmail as Ae, applyFormatting as P, validateTime as _e } from "./EFWInput.utils.js";
5
- import { useFieldsLocaleText as qe } from "../../i18n/PorygonI18nProvider.js";
6
- const Ge = Pe({
1
+ import { jsx as L, Fragment as ke } from "react/jsx-runtime";
2
+ import { makeStyles as Me, tokens as I, mergeClasses as ze, Text as Be, Input as Pe } from "@fluentui/react-components";
3
+ import { useId as De, useRef as Ne, useState as Ie, useMemo as u, useCallback as pe, useEffect as h } from "react";
4
+ import { stripFormatting as p, getInputFormattedValue as x, applyFormatting as fe } from "./EFWInput.utils.js";
5
+ import { resolveInputValidationState as We } from "./EFWInput.validation.js";
6
+ import { useFieldsLocaleText as Te } from "../../i18n/PorygonI18nProvider.js";
7
+ const Oe = Me({
7
8
  efwInputError: {
8
- backgroundColor: v.colorPaletteRedBackground1,
9
+ backgroundColor: I.colorPaletteRedBackground1,
9
10
  "::after": {
10
- borderBottomColor: v.colorPaletteRedBorder2,
11
+ borderBottomColor: I.colorPaletteRedBorder2,
11
12
  borderBottomStyle: "solid",
12
13
  borderBottomWidth: "2px"
13
14
  }
14
15
  },
15
16
  efwInput: {
16
17
  "& [disabled]": {
17
- backgroundColor: v.colorNeutralBackground3,
18
- color: v.colorNeutralForeground2,
18
+ backgroundColor: I.colorNeutralBackground3,
19
+ color: I.colorNeutralForeground2,
19
20
  "&::placeholder": {
20
21
  color: "transparent"
21
22
  }
22
23
  },
23
24
  // Afectar el span que contiene el input disabled
24
25
  "&:has(span + [disabled])": {
25
- backgroundColor: v.colorNeutralBackground3
26
+ backgroundColor: I.colorNeutralBackground3
26
27
  }
27
28
  }
28
- }), Ue = (Ie) => {
29
+ }), Je = (ve) => {
29
30
  const {
30
- value: c,
31
- defaultValue: T,
32
- onChange: W,
33
- editable: pe = !0,
31
+ value: d,
32
+ defaultValue: R,
33
+ onChange: S,
34
+ editable: he = !0,
34
35
  disabled: ge = !1,
35
- className: Ce = "",
36
- autoComplete: be = "off",
37
- type: Fe = "text",
38
- contentBefore: xe,
39
- contentAfter: ye,
40
- formatType: t = "none",
41
- formatPattern: u,
42
- formatFunction: b,
43
- minLength: I = 0,
44
- maxLength: F = 250,
45
- labels: D,
46
- readOnlyRenderer: Le,
47
- validationMessages: o,
48
- validationState: Se = "none",
49
- setParentComponentState: r
50
- } = Ie, a = c !== void 0, N = (a ? c : T) ?? "", p = T ?? "", V = Ge(), O = Ne(), j = Ve(!1), [m, A] = fe(() => f(N, t)), [Ee, x] = fe(() => B(N, t, { formatPattern: u, formatFunction: b })), d = h(
51
- () => ({ formatPattern: u, formatFunction: b }),
52
- [u, b]
53
- ), _ = qe(), q = _.input.labels, i = _.input.validationMessages, G = q.placeholder, H = q.emptyState, J = D?.placeholder, K = D?.emptyState, Q = h(() => ({
54
- placeholder: J ?? G,
55
- emptyState: K ?? H
36
+ className: be = "",
37
+ autoComplete: Ce = "off",
38
+ type: Ve = "text",
39
+ contentBefore: Fe,
40
+ contentAfter: we,
41
+ formatType: e = "none",
42
+ formatPattern: m,
43
+ formatFunction: g,
44
+ formatConfig: o,
45
+ minLength: E = 0,
46
+ maxLength: k = 250,
47
+ labels: M,
48
+ readOnlyRenderer: ye,
49
+ validationMessages: l,
50
+ validationState: Le = "none",
51
+ setParentComponentState: z
52
+ } = ve, t = d !== void 0, B = (t ? d : R) ?? "", f = R ?? "", P = Oe(), D = De(), N = Ne(!1), [c, W] = Ie(
53
+ () => p(B, e, o)
54
+ ), [xe, b] = Ie(
55
+ () => x(B, e, {
56
+ formatPattern: m,
57
+ formatFunction: g,
58
+ formatConfig: o
59
+ })
60
+ ), r = u(
61
+ () => ({ formatPattern: m, formatFunction: g, formatConfig: o }),
62
+ [m, g, o]
63
+ ), T = Te(), O = T.input.labels, i = T.input.validationMessages, j = O.placeholder, A = O.emptyState, _ = M?.placeholder, q = M?.emptyState, G = u(() => ({
64
+ placeholder: _ ?? j,
65
+ emptyState: q ?? A
56
66
  }), [
57
- J,
58
- K,
59
- G,
60
- H
61
- ]), R = i.minLength, U = i.maxLength, X = i.phoneInvalid, Y = i.creditCardInvalid, Z = i.chileanRutInvalid, $ = i.dateInvalid, w = i.dateInvalidWithFormat, ee = i.timeInvalid, te = i.emailInvalid, ae = i.formatInvalid, ne = o?.minLength, le = o?.maxLength, re = o?.phoneInvalid, oe = o?.creditCardInvalid, ie = o?.chileanRutInvalid, de = o?.dateInvalid, se = o?.dateInvalidWithFormat, ce = o?.timeInvalid, ue = o?.emailInvalid, me = o?.formatInvalid, n = h(() => ({
62
- minLength: ne ?? R,
63
- maxLength: le ?? U,
64
- phoneInvalid: re ?? X,
65
- creditCardInvalid: oe ?? Y,
66
- chileanRutInvalid: ie ?? Z,
67
- dateInvalid: de ?? $,
68
- dateInvalidWithFormat: se ?? w,
69
- timeInvalid: ce ?? ee,
70
- emailInvalid: ue ?? te,
71
- formatInvalid: me ?? ae
67
+ _,
68
+ q,
69
+ j,
70
+ A
71
+ ]), H = i.minLength, J = i.maxLength, K = i.phoneInvalid, Q = i.creditCardInvalid, U = i.chileanRutInvalid, X = i.dateInvalid, Y = i.dateInvalidWithFormat, Z = i.timeInvalid, $ = i.emailInvalid, ee = i.formatInvalid, te = l?.minLength, ae = l?.maxLength, ne = l?.phoneInvalid, oe = l?.creditCardInvalid, le = l?.chileanRutInvalid, re = l?.dateInvalid, ie = l?.dateInvalidWithFormat, se = l?.timeInvalid, de = l?.emailInvalid, ce = l?.formatInvalid, ue = u(() => ({
72
+ minLength: te ?? H,
73
+ maxLength: ae ?? J,
74
+ phoneInvalid: ne ?? K,
75
+ creditCardInvalid: oe ?? Q,
76
+ chileanRutInvalid: le ?? U,
77
+ dateInvalid: re ?? X,
78
+ dateInvalidWithFormat: ie ?? Y,
79
+ timeInvalid: se ?? Z,
80
+ emailInvalid: de ?? $,
81
+ formatInvalid: ce ?? ee
72
82
  }), [
83
+ te,
84
+ ae,
73
85
  ne,
86
+ oe,
74
87
  le,
75
88
  re,
76
- oe,
77
89
  ie,
78
- de,
79
90
  se,
91
+ de,
80
92
  ce,
81
- ue,
82
- me,
83
- R,
93
+ H,
94
+ J,
95
+ K,
96
+ Q,
84
97
  U,
85
98
  X,
86
99
  Y,
87
100
  Z,
88
101
  $,
89
- w,
90
- ee,
91
- te,
92
- ae
93
- ]), g = h(
94
- () => f(p, t),
95
- [p, t]
96
- ), y = h(
97
- () => B(p, t, d),
98
- [p, t, d]
99
- ), he = h(() => {
100
- if (!a)
102
+ ee
103
+ ]), v = u(
104
+ () => p(f, e, o),
105
+ [f, e, o]
106
+ ), C = u(
107
+ () => x(
108
+ f,
109
+ e,
110
+ r
111
+ ),
112
+ [f, e, r]
113
+ ), me = u(() => {
114
+ if (!t)
101
115
  return { raw: "", formatted: "" };
102
- const e = f(c ?? "", t), l = B(c, t, d);
103
- return { raw: e, formatted: l };
104
- }, [a, c, t, d]), L = a ? he.raw : m, S = a ? he.formatted : Ee, ve = z((e) => {
105
- if (t === "none" || !u) return !0;
106
- try {
107
- return new RegExp(u).test(e);
108
- } catch {
109
- return !1;
110
- }
111
- }, [t, u]), s = z((e) => {
112
- if (I > 0 && e.length > 0 && e.length < I)
113
- return r?.("error", n.minLength(I)), !0;
114
- if (e.length > F)
115
- return r?.("error", n.maxLength(F)), !0;
116
- if (e.length > 0 && !Oe(e, t)) {
117
- const l = {
118
- phone: n.phoneInvalid,
119
- creditCard: n.creditCardInvalid,
120
- chileanRut: n.chileanRutInvalid,
121
- date: n.dateInvalid,
122
- time: n.timeInvalid
123
- };
124
- return r?.("error", l[t] || n.formatInvalid), !0;
125
- } else {
126
- if (t === "chileanRut" && e.length > 0 && !je(e))
127
- return r?.("error", n.chileanRutInvalid), !0;
128
- if (t === "phone" && e.length > 0 && (e.length < 7 || e.length > 15))
129
- return r?.("error", n.phoneInvalid), !0;
130
- if (t === "creditCard" && e.length > 0 && (e.length < 13 || e.length > 19))
131
- return r?.("error", n.creditCardInvalid), !0;
132
- if (t === "date" && e.length > 0 && e.length !== 8)
133
- return r?.("error", n.dateInvalidWithFormat), !0;
134
- if (t === "email" && e.length > 0 && !Ae(e))
135
- return r?.("error", n.emailInvalid), !0;
136
- if (t === "time" && e.length > 0) {
137
- const l = P(e, t, {});
138
- return e.length !== 4 || !_e(l) ? (r?.("error", n.timeInvalid), !0) : (r?.("none", ""), !1);
139
- } else return ve(e) ? (r?.("none", ""), !1) : (r?.("error", n.formatInvalid), !0);
140
- }
141
- }, [I, F, t, ve, r, n]);
142
- C(() => {
143
- a && s(L);
144
- }, [a, L, s]), C(() => {
145
- a || (A((e) => e === g ? e : g), x((e) => e === y ? e : y), s(g));
116
+ const a = p(
117
+ d ?? "",
118
+ e,
119
+ o
120
+ ), n = x(
121
+ d,
122
+ e,
123
+ r
124
+ );
125
+ return { raw: a, formatted: n };
126
+ }, [t, d, e, o, r]), V = t ? me.raw : c, F = t ? me.formatted : xe, s = pe(
127
+ (a) => {
128
+ const n = We({
129
+ rawValue: a,
130
+ formatType: e,
131
+ formatPattern: m,
132
+ formatConfig: o,
133
+ minLength: E,
134
+ maxLength: k,
135
+ messages: ue,
136
+ formatOptions: r
137
+ });
138
+ return z?.(
139
+ n.hasError ? "error" : "none",
140
+ n.message
141
+ ), n.hasError;
142
+ },
143
+ [
144
+ E,
145
+ k,
146
+ e,
147
+ m,
148
+ o,
149
+ r,
150
+ z,
151
+ ue
152
+ ]
153
+ );
154
+ h(() => {
155
+ t && s(V);
156
+ }, [t, V, s]), h(() => {
157
+ t || (W(
158
+ (a) => a === v ? a : v
159
+ ), b(
160
+ (a) => a === C ? a : C
161
+ ), s(v));
146
162
  }, [
147
- a,
148
- g,
149
- y,
163
+ t,
164
+ v,
165
+ C,
150
166
  s
151
- ]), C(() => {
152
- a || x((e) => {
153
- const l = P(m, t, d);
154
- return l === e ? e : l;
167
+ ]), h(() => {
168
+ t || b((a) => {
169
+ const n = fe(
170
+ c,
171
+ e,
172
+ r
173
+ );
174
+ return n === a ? a : n;
155
175
  });
156
- }, [a, m, t, d]), C(() => {
157
- a || j.current || (j.current = !0, s(m));
158
- }, [a, m, s]);
159
- const ke = z((e, l) => {
160
- if (typeof l.value == "string") {
161
- const ze = f(l.value, t), E = P(ze, t, d), k = f(E, t);
162
- s(k), a || (A(k), x(E)), W?.(k, E);
163
- }
164
- }, [t, d, W, s, a]), Me = Te(
165
- Ce,
166
- V.efwInput,
167
- Se === "error" && V.efwInputError
176
+ }, [t, c, e, r]), h(() => {
177
+ t || N.current || (N.current = !0, s(c));
178
+ }, [t, c, s]);
179
+ const Re = pe(
180
+ (a, n) => {
181
+ if (typeof n.value == "string") {
182
+ const Ee = p(
183
+ n.value,
184
+ e,
185
+ o
186
+ ), w = fe(
187
+ Ee,
188
+ e,
189
+ r
190
+ ), y = p(
191
+ w,
192
+ e,
193
+ o
194
+ );
195
+ s(y), t || (W(y), b(w)), S?.(y, w);
196
+ }
197
+ },
198
+ [
199
+ e,
200
+ o,
201
+ r,
202
+ S,
203
+ s,
204
+ t
205
+ ]
206
+ ), Se = ze(
207
+ be,
208
+ P.efwInput,
209
+ Le === "error" && P.efwInputError
168
210
  );
169
- if (!pe) {
170
- const e = S || Q.emptyState, l = Le?.(
171
- a ? c : m,
172
- e
211
+ if (!he) {
212
+ const a = F || G.emptyState, n = ye?.(
213
+ t ? d : c,
214
+ a
173
215
  );
174
- return l != null ? /* @__PURE__ */ M(Be, { children: l }) : /* @__PURE__ */ M(We, { style: S ? void 0 : { opacity: 0.7 }, children: e });
216
+ return n != null ? /* @__PURE__ */ L(ke, { children: n }) : /* @__PURE__ */ L(Be, { style: F ? void 0 : { opacity: 0.7 }, children: a });
175
217
  }
176
- return /* @__PURE__ */ M(
177
- De,
218
+ return /* @__PURE__ */ L(
219
+ Pe,
178
220
  {
179
- className: Me,
180
- id: O,
181
- name: O,
182
- type: Fe,
183
- placeholder: Q.placeholder,
184
- contentBefore: xe,
185
- contentAfter: ye,
221
+ className: Se,
222
+ id: D,
223
+ name: D,
224
+ type: Ve,
225
+ placeholder: G.placeholder,
226
+ contentBefore: Fe,
227
+ contentAfter: we,
186
228
  disabled: ge,
187
- value: S,
188
- "data-raw-value": L,
189
- autoComplete: be,
229
+ value: F,
230
+ "data-raw-value": V,
231
+ autoComplete: Ce,
190
232
  autoCorrect: "off",
191
233
  autoCapitalize: "off",
192
234
  spellCheck: "false",
193
- onChange: ke
235
+ onChange: Re
194
236
  }
195
237
  );
196
238
  };
197
239
  export {
198
- Ue as EFWInput
240
+ Je as EFWInput
199
241
  };
@@ -75,7 +75,36 @@ export interface EFWInputValidationMessages {
75
75
  * // Para RUT chileno
76
76
  * const rutFormat: FormatType = 'chileanRut';
77
77
  */
78
- export type FormatType = 'none' | 'phone' | 'creditCard' | 'chileanRut' | 'date' | 'custom' | 'email' | 'time';
78
+ export type FormatType = "none" | "phone" | "creditCard" | "chileanRut" | "date" | "custom" | "email" | "time";
79
+ export type EFWInputValidationTarget = "raw" | "formatted";
80
+ export interface EFWInputFormatValidationContext {
81
+ rawValue: string;
82
+ formattedValue: string;
83
+ }
84
+ export interface EFWInputFormatConfig {
85
+ /**
86
+ * Máscara visual. Usa `#` como placeholder de caracteres del valor crudo.
87
+ * Los caracteres estáticos se renderizan como decoración y se consumen del raw
88
+ * cuando coinciden, permitiendo máscaras como `+56 # #### ####` con raw `569...`.
89
+ */
90
+ mask?: string;
91
+ /**
92
+ * Patrón usado para remover decoración y obtener el valor crudo.
93
+ * Debe provenir de código/configuración confiable; no usar patrones editables por usuarios finales.
94
+ */
95
+ stripPattern?: RegExp | string;
96
+ /**
97
+ * Patrón usado para validar el valor crudo o formateado.
98
+ * Debe provenir de código/configuración confiable; no usar patrones editables por usuarios finales.
99
+ */
100
+ validationPattern?: RegExp | string;
101
+ /** Valor sobre el que se aplican `validationPattern` y `validate`. Default: `raw`. */
102
+ validationTarget?: EFWInputValidationTarget;
103
+ /** Validador avanzado. Retornar string marca inválido y usa ese string como mensaje. */
104
+ validate?: (value: string, context: EFWInputFormatValidationContext) => boolean | string;
105
+ /** Mensaje de error usado cuando falla la validación de este formato. */
106
+ invalidMessage?: string;
107
+ }
79
108
  /**
80
109
  * Propiedades del componente EFWInput.
81
110
  * Extiende las propiedades básicas de los campos EFW con funcionalidades específicas
@@ -141,7 +170,7 @@ export interface EFWInputProps extends Partial<EFWFieldChildrenProps> {
141
170
  * @example
142
171
  * autoComplete="off"
143
172
  */
144
- autoComplete?: 'on' | 'off';
173
+ autoComplete?: "on" | "off";
145
174
  /**
146
175
  * Valor actual del campo de entrada.
147
176
  * Puede ser una cadena de texto o null para campos vacíos.
@@ -180,7 +209,7 @@ export interface EFWInputProps extends Partial<EFWFieldChildrenProps> {
180
209
  * @example
181
210
  * type="tel"
182
211
  */
183
- type?: 'text' | 'password' | 'email' | 'number' | 'tel';
212
+ type?: "text" | "password" | "email" | "number" | "tel";
184
213
  /**
185
214
  * Clases CSS adicionales aplicadas al componente.
186
215
  * Permite personalizar la apariencia del campo de entrada.
@@ -211,6 +240,7 @@ export interface EFWInputProps extends Partial<EFWFieldChildrenProps> {
211
240
  /**
212
241
  * Patrón de expresión regular para validación personalizada.
213
242
  * Se aplica cuando formatType es "custom" o para validaciones adicionales.
243
+ * Debe provenir de código/configuración confiable; no usar patrones editables por usuarios finales.
214
244
  *
215
245
  * @example
216
246
  * formatPattern="^[A-Z]{2}[0-9]{6}$"
@@ -219,6 +249,20 @@ export interface EFWInputProps extends Partial<EFWFieldChildrenProps> {
219
249
  * formatPattern="\\d{4}-\\d{4}-\\d{4}-\\d{4}"
220
250
  */
221
251
  formatPattern?: string;
252
+ /**
253
+ * Configuración explícita de formato, normalización y validación.
254
+ * Es la API recomendada para formatos específicos de negocio.
255
+ *
256
+ * @example
257
+ * formatConfig={{
258
+ * mask: '+56 # #### ####',
259
+ * stripPattern: /\D/g,
260
+ * validationPattern: /^569\d{8}$/,
261
+ * validationTarget: 'raw',
262
+ * invalidMessage: 'Ingrese un teléfono móvil chileno válido.'
263
+ * }}
264
+ */
265
+ formatConfig?: EFWInputFormatConfig;
222
266
  /**
223
267
  * Controla si el usuario puede editar el contenido del campo.
224
268
  * Cuando es false, el campo se muestra como texto de solo lectura.
@@ -1,24 +1,44 @@
1
- import { EFWInputValue, FormatType } from './EFWInput.types';
1
+ import { EFWInputFormatConfig, EFWInputValue, FormatType } from './EFWInput.types';
2
2
 
3
- interface FormatOptions {
3
+ export interface FormatOptions {
4
4
  formatPattern?: string;
5
5
  formatFunction?: (value: EFWInputValue) => EFWInputValue;
6
+ formatConfig?: EFWInputFormatConfig;
7
+ }
8
+ export interface InputFormatValidationResult {
9
+ valid: boolean;
10
+ message?: string;
6
11
  }
7
12
  export declare const validateChileanRut: (rutCompleto: string) => boolean;
8
13
  export declare const validateEmail: (email: string) => boolean;
9
14
  export declare const validateTime: (time: string) => boolean;
15
+ export declare const toRegExp: (pattern: RegExp | string) => RegExp | undefined;
10
16
  /**
11
17
  * Verifica si un valor contiene solo caracteres válidos para aplicar formato visual.
12
18
  */
13
19
  export declare const isFormattableValue: (value: string, formatType: FormatType) => boolean;
20
+ /**
21
+ * Aplica una máscara visual usando `#` como placeholder de caracteres del raw.
22
+ * Los caracteres estáticos se consumen del raw si coinciden, lo que permite que
23
+ * una máscara con prefijo (`+56 # ...`) funcione con raw que incluye el prefijo (`569...`).
24
+ */
25
+ export declare const applyMask: (rawValue: string, mask: string) => string;
26
+ export declare const stripInputValue: (value: string, formatType: FormatType, formatConfig?: EFWInputFormatConfig) => string;
27
+ export declare const applyInputFormatting: (value: string, formatType: FormatType, options?: FormatOptions) => string;
14
28
  /**
15
29
  * Quita el formato de un valor según el tipo especificado
16
30
  */
17
- export declare const stripFormatting: (value: string, formatType: FormatType) => string;
31
+ export declare const stripFormatting: (value: string, formatType: FormatType, formatConfig?: EFWInputFormatConfig) => string;
18
32
  /**
19
33
  * Aplica formato a un valor según el tipo y opciones especificadas
20
34
  */
21
35
  export declare const applyFormatting: (value: string, formatType: FormatType, options?: FormatOptions) => string;
36
+ export declare const validateInputFormat: ({ rawValue, formattedValue, formatConfig, defaultMessage, }: {
37
+ rawValue: string;
38
+ formattedValue: string;
39
+ formatConfig?: EFWInputFormatConfig;
40
+ defaultMessage: string;
41
+ }) => InputFormatValidationResult;
22
42
  /**
23
43
  * Retorna el valor formateado que EFWInput muestra cuando no está en modo editable.
24
44
  * Combina stripFormatting + applyFormatting en una sola llamada.
@@ -26,5 +46,5 @@ export declare const applyFormatting: (value: string, formatType: FormatType, op
26
46
  export declare const getInputFormattedValue: (value: EFWInputValue, formatType?: FormatType, options?: {
27
47
  formatPattern?: string;
28
48
  formatFunction?: (value: EFWInputValue) => EFWInputValue;
49
+ formatConfig?: EFWInputFormatConfig;
29
50
  }) => string;
30
- export {};