formik-form-components 0.2.16 → 0.2.18
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.d.ts +5 -35
- package/dist/index.js +223 -316
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +221 -315
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,12 +6,12 @@ var material = require('@mui/material');
|
|
|
6
6
|
var DatePicker = require('@mui/x-date-pickers/DatePicker');
|
|
7
7
|
var LocalizationProvider = require('@mui/x-date-pickers/LocalizationProvider');
|
|
8
8
|
var AdapterDayjs = require('@mui/x-date-pickers/AdapterDayjs');
|
|
9
|
-
var
|
|
9
|
+
var CalendarMonthIcon = require('@mui/icons-material/CalendarMonth');
|
|
10
10
|
var _19 = require('lodash');
|
|
11
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
12
|
var DateTimePicker = require('@mui/x-date-pickers/DateTimePicker');
|
|
13
13
|
var Autocomplete3 = require('@mui/material/Autocomplete');
|
|
14
|
-
var
|
|
14
|
+
var Typography9 = require('@mui/material/Typography');
|
|
15
15
|
var react$1 = require('@iconify/react');
|
|
16
16
|
var Select = require('@mui/material/Select');
|
|
17
17
|
var PhoneInput = require('react-phone-input-2');
|
|
@@ -42,9 +42,10 @@ var reactI18next = require('react-i18next');
|
|
|
42
42
|
|
|
43
43
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
44
44
|
|
|
45
|
+
var CalendarMonthIcon__default = /*#__PURE__*/_interopDefault(CalendarMonthIcon);
|
|
45
46
|
var _19__default = /*#__PURE__*/_interopDefault(_19);
|
|
46
47
|
var Autocomplete3__default = /*#__PURE__*/_interopDefault(Autocomplete3);
|
|
47
|
-
var
|
|
48
|
+
var Typography9__default = /*#__PURE__*/_interopDefault(Typography9);
|
|
48
49
|
var Select__default = /*#__PURE__*/_interopDefault(Select);
|
|
49
50
|
var PhoneInput__default = /*#__PURE__*/_interopDefault(PhoneInput);
|
|
50
51
|
var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
|
|
@@ -70,129 +71,35 @@ var AppDatePicker = react.forwardRef(
|
|
|
70
71
|
({
|
|
71
72
|
name,
|
|
72
73
|
label,
|
|
73
|
-
required = false,
|
|
74
74
|
disabled = false,
|
|
75
|
-
variant = "outlined",
|
|
76
|
-
showIcon = true,
|
|
77
75
|
format = "DD/MM/YYYY",
|
|
78
76
|
sx,
|
|
79
|
-
formControlSx,
|
|
80
77
|
textFieldSx,
|
|
81
|
-
labelSx,
|
|
82
|
-
inputSx,
|
|
83
|
-
errorSx,
|
|
84
|
-
iconSx,
|
|
85
|
-
onChange: externalOnChange,
|
|
86
|
-
onBlur: externalOnBlur,
|
|
87
78
|
...otherProps
|
|
88
79
|
}, ref) => {
|
|
89
80
|
const { values, setFieldValue, touched, errors, setFieldTouched } = formik.useFormikContext();
|
|
90
81
|
const fieldValue = _19__default.default.get(values, name);
|
|
91
82
|
const fieldError = _19__default.default.get(errors, name);
|
|
92
83
|
const isTouched = _19__default.default.get(touched, name);
|
|
93
|
-
const handleChange = (newValue
|
|
84
|
+
const handleChange = (newValue) => {
|
|
94
85
|
setFieldValue(name, newValue);
|
|
95
|
-
if (externalOnChange) {
|
|
96
|
-
externalOnChange(newValue, context);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
const handleBlur = (event) => {
|
|
100
|
-
setFieldTouched(name, true);
|
|
101
|
-
if (externalOnBlur) {
|
|
102
|
-
externalOnBlur(event);
|
|
103
|
-
}
|
|
104
86
|
};
|
|
105
87
|
return /* @__PURE__ */ jsxRuntime.jsx(LocalizationProvider.LocalizationProvider, { dateAdapter: AdapterDayjs.AdapterDayjs, children: /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx, ref, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
88
|
DatePicker.DatePicker,
|
|
107
89
|
{
|
|
108
90
|
label,
|
|
109
|
-
value: fieldValue
|
|
91
|
+
value: fieldValue,
|
|
110
92
|
onChange: handleChange,
|
|
111
93
|
format,
|
|
112
94
|
disabled,
|
|
113
95
|
slotProps: {
|
|
114
96
|
textField: {
|
|
97
|
+
variant: "outlined",
|
|
115
98
|
fullWidth: true,
|
|
116
|
-
variant,
|
|
117
99
|
error: isTouched && Boolean(fieldError),
|
|
118
100
|
helperText: isTouched && fieldError ? fieldError : void 0,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
"& .MuiOutlinedInput-root": {
|
|
123
|
-
backgroundColor: "background.paper",
|
|
124
|
-
"&.Mui-focused": {
|
|
125
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
126
|
-
borderColor: "primary.main"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
"&.Mui-error": {
|
|
130
|
-
backgroundColor: "error.lighter",
|
|
131
|
-
"& .MuiOutlinedInput-input": {
|
|
132
|
-
color: "error.main"
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
"&.Mui-disabled": {
|
|
136
|
-
backgroundColor: "action.disabledBackground",
|
|
137
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
138
|
-
borderColor: "action.disabled"
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
...inputSx
|
|
142
|
-
},
|
|
143
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
144
|
-
borderColor: isTouched && fieldError ? "error.main" : "divider"
|
|
145
|
-
},
|
|
146
|
-
"&:hover .MuiOutlinedInput-notchedOutline": {
|
|
147
|
-
borderColor: isTouched && fieldError ? "error.main" : "primary.main"
|
|
148
|
-
},
|
|
149
|
-
...textFieldSx
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
FormHelperTextProps: {
|
|
153
|
-
sx: [
|
|
154
|
-
{
|
|
155
|
-
color: "error.main",
|
|
156
|
-
mx: 0,
|
|
157
|
-
mt: 0.5,
|
|
158
|
-
...errorSx
|
|
159
|
-
}
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
InputLabelProps: {
|
|
163
|
-
sx: [
|
|
164
|
-
{
|
|
165
|
-
color: "text.secondary",
|
|
166
|
-
"&.Mui-focused": {
|
|
167
|
-
color: "primary.main"
|
|
168
|
-
},
|
|
169
|
-
"&.Mui-error": {
|
|
170
|
-
color: "error.main"
|
|
171
|
-
},
|
|
172
|
-
...labelSx
|
|
173
|
-
}
|
|
174
|
-
]
|
|
175
|
-
},
|
|
176
|
-
InputProps: {
|
|
177
|
-
endAdornment: showIcon ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
178
|
-
material.Box,
|
|
179
|
-
{
|
|
180
|
-
component: "span",
|
|
181
|
-
sx: [
|
|
182
|
-
{
|
|
183
|
-
color: "text.secondary",
|
|
184
|
-
"&:hover": {
|
|
185
|
-
color: "primary.main"
|
|
186
|
-
},
|
|
187
|
-
"&.Mui-disabled": {
|
|
188
|
-
color: "action.disabled"
|
|
189
|
-
},
|
|
190
|
-
...iconSx
|
|
191
|
-
}
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
) : null
|
|
195
|
-
}
|
|
101
|
+
sx: textFieldSx,
|
|
102
|
+
openPickerIcon: CalendarMonthIcon__default.default
|
|
196
103
|
}
|
|
197
104
|
},
|
|
198
105
|
...otherProps
|
|
@@ -1122,7 +1029,7 @@ var AppCheckBox = ({
|
|
|
1122
1029
|
}, ...Array.isArray(sx) ? sx : [sx]],
|
|
1123
1030
|
children: [
|
|
1124
1031
|
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1125
|
-
|
|
1032
|
+
Typography9__default.default,
|
|
1126
1033
|
{
|
|
1127
1034
|
variant: "subtitle2",
|
|
1128
1035
|
gutterBottom: true,
|
|
@@ -1199,7 +1106,7 @@ var AppCheckBox = ({
|
|
|
1199
1106
|
}
|
|
1200
1107
|
),
|
|
1201
1108
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1202
|
-
|
|
1109
|
+
Typography9__default.default,
|
|
1203
1110
|
{
|
|
1204
1111
|
variant: "body2",
|
|
1205
1112
|
sx: [{
|
|
@@ -1218,7 +1125,7 @@ var AppCheckBox = ({
|
|
|
1218
1125
|
}
|
|
1219
1126
|
),
|
|
1220
1127
|
isTouched && fieldError && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1221
|
-
|
|
1128
|
+
Typography9__default.default,
|
|
1222
1129
|
{
|
|
1223
1130
|
variant: "caption",
|
|
1224
1131
|
sx: [{
|
|
@@ -1834,206 +1741,208 @@ var AppRadioGroup = react.forwardRef(({
|
|
|
1834
1741
|
});
|
|
1835
1742
|
AppRadioGroup.displayName = "AppRadioGroup";
|
|
1836
1743
|
var AppRadioGroup_default = AppRadioGroup;
|
|
1837
|
-
var AppRating = react.forwardRef(
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
externalOnChange
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
display: "flex",
|
|
1898
|
-
flexDirection: "column",
|
|
1899
|
-
width: "100%",
|
|
1900
|
-
"&:hover": {
|
|
1901
|
-
"& .MuiRating-iconEmpty": {
|
|
1902
|
-
color: "primary.light"
|
|
1903
|
-
}
|
|
1904
|
-
}
|
|
1905
|
-
},
|
|
1906
|
-
...Array.isArray(sx) ? sx : [sx]
|
|
1907
|
-
],
|
|
1908
|
-
...otherProps,
|
|
1909
|
-
children: [
|
|
1910
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1911
|
-
material.Stack,
|
|
1744
|
+
var AppRating = react.forwardRef(
|
|
1745
|
+
({
|
|
1746
|
+
name,
|
|
1747
|
+
label,
|
|
1748
|
+
required = false,
|
|
1749
|
+
readOnly = false,
|
|
1750
|
+
disabled = false,
|
|
1751
|
+
max = 5,
|
|
1752
|
+
precision = 1,
|
|
1753
|
+
size = "medium",
|
|
1754
|
+
emptyIcon,
|
|
1755
|
+
icon,
|
|
1756
|
+
IconContainerComponent,
|
|
1757
|
+
getLabelText,
|
|
1758
|
+
onChange: externalOnChange,
|
|
1759
|
+
onChangeActive,
|
|
1760
|
+
sx,
|
|
1761
|
+
labelSx,
|
|
1762
|
+
ratingSx,
|
|
1763
|
+
errorSx,
|
|
1764
|
+
helperTextSx,
|
|
1765
|
+
showHelperText = false,
|
|
1766
|
+
helperText,
|
|
1767
|
+
labelComponent: LabelComponent = material.Typography,
|
|
1768
|
+
ratingComponent: RatingComponent = material.Rating,
|
|
1769
|
+
errorComponent: ErrorComponent = material.Typography,
|
|
1770
|
+
helperTextComponent: HelperTextComponent = material.FormHelperText,
|
|
1771
|
+
labelProps = {},
|
|
1772
|
+
ratingProps = {},
|
|
1773
|
+
errorProps = {},
|
|
1774
|
+
helperTextProps = {},
|
|
1775
|
+
className = "",
|
|
1776
|
+
labelClassName = "",
|
|
1777
|
+
ratingClassName = "",
|
|
1778
|
+
errorClassName = "",
|
|
1779
|
+
helperTextClassName = "",
|
|
1780
|
+
...otherProps
|
|
1781
|
+
}, ref) => {
|
|
1782
|
+
material.useTheme();
|
|
1783
|
+
const { errors, touched, setFieldValue, values, setFieldTouched } = formik.useFormikContext();
|
|
1784
|
+
const val = _19__default.default.get(values, name);
|
|
1785
|
+
const fieldError = _19__default.default.get(errors, name);
|
|
1786
|
+
const isTouched = _19__default.default.get(touched, name);
|
|
1787
|
+
const hasError = Boolean(fieldError) && isTouched;
|
|
1788
|
+
const handleChange = (event, newValue) => {
|
|
1789
|
+
setFieldValue(name, newValue);
|
|
1790
|
+
setFieldTouched(name, true, false);
|
|
1791
|
+
if (externalOnChange) {
|
|
1792
|
+
externalOnChange(event, newValue);
|
|
1793
|
+
}
|
|
1794
|
+
};
|
|
1795
|
+
const handleBlur = () => {
|
|
1796
|
+
setFieldTouched(name, true, true);
|
|
1797
|
+
};
|
|
1798
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1799
|
+
material.Box,
|
|
1800
|
+
{
|
|
1801
|
+
ref,
|
|
1802
|
+
className: `app-rating ${className}`,
|
|
1803
|
+
sx: [
|
|
1912
1804
|
{
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
"
|
|
1918
|
-
|
|
1919
|
-
cursor: "not-allowed"
|
|
1805
|
+
display: "flex",
|
|
1806
|
+
flexDirection: "column",
|
|
1807
|
+
width: "100%",
|
|
1808
|
+
"&:hover": {
|
|
1809
|
+
"& .MuiRating-iconEmpty": {
|
|
1810
|
+
color: "primary.light"
|
|
1920
1811
|
}
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
},
|
|
1938
|
-
...Array.isArray(labelSx) ? labelSx : [labelSx]
|
|
1939
|
-
],
|
|
1940
|
-
...labelProps,
|
|
1941
|
-
children: [
|
|
1942
|
-
label,
|
|
1943
|
-
required && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1944
|
-
material.Box,
|
|
1945
|
-
{
|
|
1946
|
-
component: "span",
|
|
1947
|
-
sx: {
|
|
1948
|
-
color: "error.main",
|
|
1949
|
-
ml: 0.5
|
|
1950
|
-
},
|
|
1951
|
-
children: "*"
|
|
1952
|
-
}
|
|
1953
|
-
)
|
|
1954
|
-
]
|
|
1812
|
+
}
|
|
1813
|
+
},
|
|
1814
|
+
...Array.isArray(sx) ? sx : [sx]
|
|
1815
|
+
],
|
|
1816
|
+
...otherProps,
|
|
1817
|
+
children: [
|
|
1818
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1819
|
+
material.Stack,
|
|
1820
|
+
{
|
|
1821
|
+
direction: "row",
|
|
1822
|
+
alignItems: "center",
|
|
1823
|
+
spacing: 1,
|
|
1824
|
+
sx: {
|
|
1825
|
+
"&.Mui-disabled": {
|
|
1826
|
+
opacity: 0.5,
|
|
1827
|
+
cursor: "not-allowed"
|
|
1955
1828
|
}
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
},
|
|
1973
|
-
"& .MuiRating-iconHover": {
|
|
1974
|
-
color: "primary.dark"
|
|
1975
|
-
},
|
|
1976
|
-
"&.Mui-disabled": {
|
|
1977
|
-
opacity: 0.5,
|
|
1978
|
-
cursor: "not-allowed"
|
|
1829
|
+
},
|
|
1830
|
+
className: disabled ? "Mui-disabled" : "",
|
|
1831
|
+
children: [
|
|
1832
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1833
|
+
LabelComponent,
|
|
1834
|
+
{
|
|
1835
|
+
variant: "body2",
|
|
1836
|
+
color: hasError ? "error" : "text.primary",
|
|
1837
|
+
className: `app-rating-label ${labelClassName}`,
|
|
1838
|
+
sx: [
|
|
1839
|
+
{
|
|
1840
|
+
margin: 0,
|
|
1841
|
+
fontWeight: 500,
|
|
1842
|
+
...disabled && {
|
|
1843
|
+
color: "text.disabled"
|
|
1844
|
+
}
|
|
1979
1845
|
},
|
|
1980
|
-
...
|
|
1846
|
+
...Array.isArray(labelSx) ? labelSx : [labelSx]
|
|
1847
|
+
],
|
|
1848
|
+
...labelProps,
|
|
1849
|
+
children: [
|
|
1850
|
+
label,
|
|
1851
|
+
required && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1852
|
+
material.Box,
|
|
1853
|
+
{
|
|
1854
|
+
component: "span",
|
|
1855
|
+
sx: {
|
|
1856
|
+
color: "error.main",
|
|
1857
|
+
ml: 0.5
|
|
1858
|
+
},
|
|
1859
|
+
children: "*"
|
|
1860
|
+
}
|
|
1861
|
+
)
|
|
1862
|
+
]
|
|
1863
|
+
}
|
|
1864
|
+
),
|
|
1865
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1866
|
+
material.Box,
|
|
1867
|
+
{
|
|
1868
|
+
onBlur: handleBlur,
|
|
1869
|
+
sx: [
|
|
1870
|
+
{
|
|
1871
|
+
display: "inline-flex",
|
|
1981
1872
|
"& .MuiRating-icon": {
|
|
1982
|
-
color: "
|
|
1873
|
+
color: "primary.main"
|
|
1874
|
+
},
|
|
1875
|
+
"& .MuiRating-iconEmpty": {
|
|
1876
|
+
color: "action.disabled"
|
|
1877
|
+
},
|
|
1878
|
+
"& .MuiRating-iconFilled": {
|
|
1879
|
+
color: "primary.main"
|
|
1880
|
+
},
|
|
1881
|
+
"& .MuiRating-iconHover": {
|
|
1882
|
+
color: "primary.dark"
|
|
1883
|
+
},
|
|
1884
|
+
"&.Mui-disabled": {
|
|
1885
|
+
opacity: 0.5,
|
|
1886
|
+
cursor: "not-allowed"
|
|
1887
|
+
},
|
|
1888
|
+
...hasError && {
|
|
1889
|
+
"& .MuiRating-icon": {
|
|
1890
|
+
color: "error.main"
|
|
1891
|
+
}
|
|
1983
1892
|
}
|
|
1893
|
+
},
|
|
1894
|
+
...Array.isArray(ratingSx) ? ratingSx : [ratingSx]
|
|
1895
|
+
],
|
|
1896
|
+
className: `app-rating-stars ${ratingClassName} ${disabled ? "Mui-disabled" : ""}`,
|
|
1897
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1898
|
+
RatingComponent,
|
|
1899
|
+
{
|
|
1900
|
+
value: val != null ? val : null,
|
|
1901
|
+
onChange: handleChange,
|
|
1902
|
+
onChangeActive,
|
|
1903
|
+
max,
|
|
1904
|
+
precision,
|
|
1905
|
+
size,
|
|
1906
|
+
readOnly,
|
|
1907
|
+
disabled,
|
|
1908
|
+
emptyIcon,
|
|
1909
|
+
icon,
|
|
1910
|
+
IconContainerComponent,
|
|
1911
|
+
getLabelText,
|
|
1912
|
+
className: ratingClassName,
|
|
1913
|
+
...ratingProps
|
|
1984
1914
|
}
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
className: ratingClassName,
|
|
2005
|
-
...ratingProps
|
|
2006
|
-
}
|
|
2007
|
-
)
|
|
1915
|
+
)
|
|
1916
|
+
}
|
|
1917
|
+
)
|
|
1918
|
+
]
|
|
1919
|
+
}
|
|
1920
|
+
),
|
|
1921
|
+
(showHelperText || hasError) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1922
|
+
HelperTextComponent,
|
|
1923
|
+
{
|
|
1924
|
+
error: hasError,
|
|
1925
|
+
sx: [
|
|
1926
|
+
{
|
|
1927
|
+
mx: 0,
|
|
1928
|
+
mt: 0.5,
|
|
1929
|
+
...hasError && {
|
|
1930
|
+
color: "error.main",
|
|
1931
|
+
...errorSx
|
|
1932
|
+
},
|
|
1933
|
+
...helperTextSx
|
|
2008
1934
|
}
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
mt: 0.5,
|
|
2021
|
-
...hasError && {
|
|
2022
|
-
color: "error.main",
|
|
2023
|
-
...errorSx
|
|
2024
|
-
},
|
|
2025
|
-
...helperTextSx
|
|
2026
|
-
}
|
|
2027
|
-
],
|
|
2028
|
-
className: `app-rating-helper-text ${helperTextClassName} ${hasError ? "Mui-error" : ""}`,
|
|
2029
|
-
...helperTextProps,
|
|
2030
|
-
children: hasError ? fieldError : helperText
|
|
2031
|
-
}
|
|
2032
|
-
)
|
|
2033
|
-
]
|
|
2034
|
-
}
|
|
2035
|
-
);
|
|
2036
|
-
});
|
|
1935
|
+
],
|
|
1936
|
+
className: `app-rating-helper-text ${helperTextClassName} ${hasError ? "Mui-error" : ""}`,
|
|
1937
|
+
...helperTextProps,
|
|
1938
|
+
children: hasError ? fieldError : helperText
|
|
1939
|
+
}
|
|
1940
|
+
)
|
|
1941
|
+
]
|
|
1942
|
+
}
|
|
1943
|
+
);
|
|
1944
|
+
}
|
|
1945
|
+
);
|
|
2037
1946
|
AppRating.displayName = "AppRating";
|
|
2038
1947
|
var AppRating_default = AppRating;
|
|
2039
1948
|
|
|
@@ -13793,16 +13702,7 @@ function Upload({
|
|
|
13793
13702
|
},
|
|
13794
13703
|
children: [
|
|
13795
13704
|
/* @__PURE__ */ jsxRuntime.jsx("input", { ...getInputProps() }),
|
|
13796
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13797
|
-
Placeholder,
|
|
13798
|
-
{
|
|
13799
|
-
sx: {
|
|
13800
|
-
...hasFile && {
|
|
13801
|
-
opacity: 0
|
|
13802
|
-
}
|
|
13803
|
-
}
|
|
13804
|
-
}
|
|
13805
|
-
),
|
|
13705
|
+
hasFile ? null : /* @__PURE__ */ jsxRuntime.jsx(Placeholder, {}),
|
|
13806
13706
|
hasFile && /* @__PURE__ */ jsxRuntime.jsx(SingleFilePreview, { file })
|
|
13807
13707
|
]
|
|
13808
13708
|
}
|
|
@@ -13955,15 +13855,22 @@ var AppUploadFile = ({ name, ...rest }) => {
|
|
|
13955
13855
|
setFieldValue(name, "", true);
|
|
13956
13856
|
}
|
|
13957
13857
|
},
|
|
13958
|
-
onRemove: (
|
|
13959
|
-
|
|
13960
|
-
|
|
13961
|
-
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13858
|
+
onRemove: (fileToRemove) => {
|
|
13859
|
+
if (rest.multiple) {
|
|
13860
|
+
const currentFiles = Array.isArray(val) ? val : [];
|
|
13861
|
+
const updatedFiles = currentFiles.filter((f) => {
|
|
13862
|
+
if (f.file && f.file === fileToRemove)
|
|
13863
|
+
return false;
|
|
13864
|
+
if (f === fileToRemove)
|
|
13865
|
+
return false;
|
|
13866
|
+
if (f.preview === fileToRemove)
|
|
13867
|
+
return false;
|
|
13868
|
+
return true;
|
|
13869
|
+
});
|
|
13870
|
+
setFieldValue(name, updatedFiles, true);
|
|
13871
|
+
} else {
|
|
13872
|
+
setFieldValue(name, null, true);
|
|
13873
|
+
}
|
|
13967
13874
|
}
|
|
13968
13875
|
}
|
|
13969
13876
|
),
|