@envisiongroup/porygon 1.0.0-rc.40 → 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.
- package/dist/index.js +53 -49
- package/dist/react-components/fields/DatePicker/EFWDatePicker.utils.js +1 -1
- package/dist/react-components/fields/Input/EFWInput.d.ts +5 -20
- package/dist/react-components/fields/Input/EFWInput.js +193 -151
- package/dist/react-components/fields/Input/EFWInput.types.d.ts +47 -3
- package/dist/react-components/fields/Input/EFWInput.utils.d.ts +24 -4
- package/dist/react-components/fields/Input/EFWInput.utils.js +103 -53
- package/dist/react-components/fields/Input/EFWInput.validation.d.ts +20 -0
- package/dist/react-components/fields/Input/EFWInput.validation.js +62 -0
- package/dist/react-components/fields/Input/EFWInputField.js +28 -26
- package/dist/react-components/fields/Input/index.d.ts +2 -2
- package/dist/react-components/fields/NumberInput/EFWNumberInput.utils.d.ts +1 -1
- package/dist/react-components/fields/NumberInput/EFWNumberInput.utils.js +52 -46
- package/dist/react-components/fields/TextArea/EFWTextArea.utils.d.ts +1 -1
- package/dist/react-components/fields/test-utils/testUtils.js +10 -0
- package/dist/react-components/forms/EFWForm/EFWForm.converter.js +19 -10
- package/dist/react-components/forms/EFWForm/EFWForm.flatConverter.d.ts +130 -0
- package/dist/react-components/forms/EFWForm/EFWForm.flatConverter.js +279 -0
- package/dist/react-components/forms/EFWForm/EFWForm.utils.js +83 -43
- package/dist/react-components/forms/EFWForm/index.d.ts +2 -0
- package/dist/react-components/forms/EFWForm/index.js +8 -4
- package/dist/vite-raw.d.js +0 -0
- package/package.json +21 -5
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { formatFileSize as o, getErrorMessage as t, getFileIconUrl as
|
|
1
|
+
import { formatFileSize as o, getErrorMessage as t, getFileIconUrl as F } from "./react-components/commons/utils.js";
|
|
2
2
|
import { EFWMessageBarManager as a } from "./react-components/forms/EFWMessageBarManager/EFWMessageBarManager.js";
|
|
3
|
-
import { EFWButton as
|
|
4
|
-
import { useEFWButton as
|
|
3
|
+
import { EFWButton as p } from "./react-components/buttons/EFWButton/EFWButton.js";
|
|
4
|
+
import { useEFWButton as l } from "./react-components/buttons/EFWButton/EFWButton.hooks.js";
|
|
5
5
|
import { EFWDrawerButton as u } from "./react-components/buttons/EFWDrawerButton/EFWDrawerButton.js";
|
|
6
6
|
import { EFWGroupButton as i } from "./react-components/buttons/EFWGroupButton/EFWGroupButton.js";
|
|
7
|
-
import { EFWField as
|
|
7
|
+
import { EFWField as L } from "./react-components/fields/_shared/EFWField/EFWField.js";
|
|
8
8
|
import { EFWAttachment as s } from "./react-components/fields/Attachments/EFWAttachments.js";
|
|
9
9
|
import { getAttachmentsFormattedValue as g } from "./react-components/fields/Attachments/EFWAttachments.utils.js";
|
|
10
10
|
import { EFWAttachmentsField as d } from "./react-components/fields/Attachments/EFWAttachmentsField.js";
|
|
11
11
|
import { EFWDatePicker as O } from "./react-components/fields/DatePicker/EFWDatePicker.js";
|
|
12
|
-
import { enLocalizedStrings as D, esLocalizedStrings as B, getDatePickerFormattedValue as
|
|
12
|
+
import { enLocalizedStrings as D, esLocalizedStrings as B, getDatePickerFormattedValue as C, ptLocalizedStrings as S } from "./react-components/fields/DatePicker/EFWDatePicker.utils.js";
|
|
13
13
|
import { EFWDatePickerField as N } from "./react-components/fields/DatePicker/EFWDatePickerField.js";
|
|
14
|
-
import { EFWInput as
|
|
14
|
+
import { EFWInput as b } from "./react-components/fields/Input/EFWInput.js";
|
|
15
15
|
import { getInputFormattedValue as k } from "./react-components/fields/Input/EFWInput.utils.js";
|
|
16
16
|
import { EFWInputField as R } from "./react-components/fields/Input/EFWInputField.js";
|
|
17
17
|
import { EFWNumberInput as w } from "./react-components/fields/NumberInput/EFWNumberInput.js";
|
|
@@ -24,76 +24,80 @@ import { EFWTagPicker as Q } from "./react-components/fields/TagPicker/EFWTagPic
|
|
|
24
24
|
import { getTagPickerFormattedValue as $ } from "./react-components/fields/TagPicker/EFWTagPicker.utils.js";
|
|
25
25
|
import { EFWTagPickerField as re } from "./react-components/fields/TagPicker/EFWTagPickerField.js";
|
|
26
26
|
import { EFWTextArea as te } from "./react-components/fields/TextArea/EFWTextArea.js";
|
|
27
|
-
import { getTextAreaFormattedValue as
|
|
28
|
-
import { EFWTextAreaField as
|
|
27
|
+
import { getTextAreaFormattedValue as me } from "./react-components/fields/TextArea/EFWTextArea.utils.js";
|
|
28
|
+
import { EFWTextAreaField as Ee } from "./react-components/fields/TextArea/EFWTextAreaField.js";
|
|
29
29
|
import { getFormFieldDisplayText as xe } from "./react-components/forms/EFWForm/EFWForm.converter.js";
|
|
30
|
-
import { useFormController as
|
|
30
|
+
import { useFormController as fe } from "./react-components/forms/EFWForm/EFWForm.hooks.js";
|
|
31
31
|
import { EFWForm as Te } from "./react-components/forms/EFWForm/EFWForm.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
32
|
+
import { EFWConversionError as We, EFWValuesToFlat as Le, flatToEFWValues as ne } from "./react-components/forms/EFWForm/EFWForm.flatConverter.js";
|
|
33
|
+
import { EFWFormMessageBarGroup as _e } from "./react-components/forms/EFWFormMessageBarGroup/EFWFormMessageBarGroup.js";
|
|
34
|
+
import { useDrawer as ce } from "./react-components/hooks/useDrawer/useDrawer.js";
|
|
35
|
+
import { PorygonI18nProvider as Ae, useButtonsLocaleText as Oe, useFieldsLocaleText as Pe, useFormLocaleText as De, usePorygonLocaleText as Be, useTableLocaleText as Ce } from "./react-components/i18n/PorygonI18nProvider.js";
|
|
36
|
+
import { DEFAULT_EFW_BUTTONS_LOCALE_TEXT as Ie, DEFAULT_EFW_FIELDS_LOCALE_TEXT as Ne, DEFAULT_EFW_FORM_LOCALE_TEXT as Ve, DEFAULT_EFW_TABLE_LOCALE_TEXT as be } from "./react-components/i18n/defaultLocaleText.js";
|
|
37
|
+
import { PORYGON_LOCALES as ke, PORYGON_LOCALE_EN as Ge, PORYGON_LOCALE_ES as Re, PORYGON_LOCALE_PT_BR as Ue } from "./react-components/i18n/localePresets.js";
|
|
38
|
+
import { EFWTable as ye } from "./react-components/tables/EFWTable/EFWTable.js";
|
|
39
|
+
import { useTableController as ze } from "./react-components/tables/EFWTable/hooks/useTableController/useTableController.js";
|
|
40
|
+
import { useDefaultFilterButton as Ye } from "./react-components/tables/EFWTable/hooks/useDefaultFilterButton/useDefaultFilterButton.js";
|
|
41
|
+
import { EFWTableEmpty as je, EFWTableOverlay as qe } from "./react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.js";
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
Ie as DEFAULT_EFW_BUTTONS_LOCALE_TEXT,
|
|
44
|
+
Ne as DEFAULT_EFW_FIELDS_LOCALE_TEXT,
|
|
45
|
+
Ve as DEFAULT_EFW_FORM_LOCALE_TEXT,
|
|
46
|
+
be as DEFAULT_EFW_TABLE_LOCALE_TEXT,
|
|
46
47
|
s as EFWAttachment,
|
|
47
48
|
d as EFWAttachmentsField,
|
|
48
|
-
|
|
49
|
+
p as EFWButton,
|
|
50
|
+
We as EFWConversionError,
|
|
49
51
|
O as EFWDatePicker,
|
|
50
52
|
N as EFWDatePickerField,
|
|
51
53
|
u as EFWDrawerButton,
|
|
52
|
-
|
|
54
|
+
L as EFWField,
|
|
53
55
|
Te as EFWForm,
|
|
54
|
-
|
|
56
|
+
_e as EFWFormMessageBarGroup,
|
|
55
57
|
i as EFWGroupButton,
|
|
56
|
-
|
|
58
|
+
b as EFWInput,
|
|
57
59
|
R as EFWInputField,
|
|
58
60
|
a as EFWMessageBarManager,
|
|
59
61
|
w as EFWNumberInput,
|
|
60
62
|
X as EFWNumberInputField,
|
|
61
63
|
v as EFWSwitch,
|
|
62
64
|
J as EFWSwitchField,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
ye as EFWTable,
|
|
66
|
+
je as EFWTableEmpty,
|
|
67
|
+
qe as EFWTableOverlay,
|
|
66
68
|
Q as EFWTagPicker,
|
|
67
69
|
re as EFWTagPickerField,
|
|
68
70
|
te as EFWTextArea,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
Ee as EFWTextAreaField,
|
|
72
|
+
Le as EFWValuesToFlat,
|
|
73
|
+
ke as PORYGON_LOCALES,
|
|
74
|
+
Ge as PORYGON_LOCALE_EN,
|
|
75
|
+
Re as PORYGON_LOCALE_ES,
|
|
76
|
+
Ue as PORYGON_LOCALE_PT_BR,
|
|
77
|
+
Ae as PorygonI18nProvider,
|
|
75
78
|
D as enLocalizedStrings,
|
|
76
79
|
B as esLocalizedStrings,
|
|
80
|
+
ne as flatToEFWValues,
|
|
77
81
|
o as formatFileSize,
|
|
78
82
|
g as getAttachmentsFormattedValue,
|
|
79
|
-
|
|
83
|
+
C as getDatePickerFormattedValue,
|
|
80
84
|
t as getErrorMessage,
|
|
81
|
-
|
|
85
|
+
F as getFileIconUrl,
|
|
82
86
|
xe as getFormFieldDisplayText,
|
|
83
87
|
k as getInputFormattedValue,
|
|
84
88
|
M as getNumberInputFormattedValue,
|
|
85
89
|
q as getSwitchFormattedValue,
|
|
86
90
|
$ as getTagPickerFormattedValue,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
me as getTextAreaFormattedValue,
|
|
92
|
+
S as ptLocalizedStrings,
|
|
93
|
+
Oe as useButtonsLocaleText,
|
|
94
|
+
Ye as useDefaultFilterButton,
|
|
95
|
+
ce as useDrawer,
|
|
96
|
+
l as useEFWButton,
|
|
97
|
+
Pe as useFieldsLocaleText,
|
|
98
|
+
fe as useFormController,
|
|
99
|
+
De as useFormLocaleText,
|
|
100
|
+
Be as usePorygonLocaleText,
|
|
101
|
+
ze as useTableController,
|
|
102
|
+
Ce as useTableLocaleText
|
|
99
103
|
};
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
import { EFWInputProps } from './EFWInput.types';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
2
|
-
import { makeStyles as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { stripFormatting as
|
|
5
|
-
import {
|
|
6
|
-
|
|
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:
|
|
9
|
+
backgroundColor: I.colorPaletteRedBackground1,
|
|
9
10
|
"::after": {
|
|
10
|
-
borderBottomColor:
|
|
11
|
+
borderBottomColor: I.colorPaletteRedBorder2,
|
|
11
12
|
borderBottomStyle: "solid",
|
|
12
13
|
borderBottomWidth: "2px"
|
|
13
14
|
}
|
|
14
15
|
},
|
|
15
16
|
efwInput: {
|
|
16
17
|
"& [disabled]": {
|
|
17
|
-
backgroundColor:
|
|
18
|
-
color:
|
|
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:
|
|
26
|
+
backgroundColor: I.colorNeutralBackground3
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
}),
|
|
29
|
+
}), Je = (ve) => {
|
|
29
30
|
const {
|
|
30
|
-
value:
|
|
31
|
-
defaultValue:
|
|
32
|
-
onChange:
|
|
33
|
-
editable:
|
|
31
|
+
value: d,
|
|
32
|
+
defaultValue: R,
|
|
33
|
+
onChange: S,
|
|
34
|
+
editable: he = !0,
|
|
34
35
|
disabled: ge = !1,
|
|
35
|
-
className:
|
|
36
|
-
autoComplete:
|
|
37
|
-
type:
|
|
38
|
-
contentBefore:
|
|
39
|
-
contentAfter:
|
|
40
|
-
formatType:
|
|
41
|
-
formatPattern:
|
|
42
|
-
formatFunction:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
),
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
]),
|
|
62
|
-
minLength:
|
|
63
|
-
maxLength:
|
|
64
|
-
phoneInvalid:
|
|
65
|
-
creditCardInvalid: oe ??
|
|
66
|
-
chileanRutInvalid:
|
|
67
|
-
dateInvalid:
|
|
68
|
-
dateInvalidWithFormat:
|
|
69
|
-
timeInvalid:
|
|
70
|
-
emailInvalid:
|
|
71
|
-
formatInvalid:
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
93
|
+
H,
|
|
94
|
+
J,
|
|
95
|
+
K,
|
|
96
|
+
Q,
|
|
84
97
|
U,
|
|
85
98
|
X,
|
|
86
99
|
Y,
|
|
87
100
|
Z,
|
|
88
101
|
$,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
() =>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
};
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
163
|
+
t,
|
|
164
|
+
v,
|
|
165
|
+
C,
|
|
150
166
|
s
|
|
151
|
-
]),
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
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
|
-
}, [
|
|
157
|
-
|
|
158
|
-
}, [
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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 (!
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
211
|
+
if (!he) {
|
|
212
|
+
const a = F || G.emptyState, n = ye?.(
|
|
213
|
+
t ? d : c,
|
|
214
|
+
a
|
|
173
215
|
);
|
|
174
|
-
return
|
|
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__ */
|
|
177
|
-
|
|
218
|
+
return /* @__PURE__ */ L(
|
|
219
|
+
Pe,
|
|
178
220
|
{
|
|
179
|
-
className:
|
|
180
|
-
id:
|
|
181
|
-
name:
|
|
182
|
-
type:
|
|
183
|
-
placeholder:
|
|
184
|
-
contentBefore:
|
|
185
|
-
contentAfter:
|
|
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:
|
|
188
|
-
"data-raw-value":
|
|
189
|
-
autoComplete:
|
|
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:
|
|
235
|
+
onChange: Re
|
|
194
236
|
}
|
|
195
237
|
);
|
|
196
238
|
};
|
|
197
239
|
export {
|
|
198
|
-
|
|
240
|
+
Je as EFWInput
|
|
199
241
|
};
|