@itcase/forms 1.1.32 → 1.1.33
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.form {
|
|
2
|
-
&-
|
|
2
|
+
&-masked-input {
|
|
3
3
|
position: relative;
|
|
4
4
|
&&_state {
|
|
5
5
|
&_success {
|
|
@@ -34,12 +34,4 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:root {
|
|
40
|
-
--input-success-border: var(--color-success-border-primary);
|
|
41
|
-
--input-success-border-hover: var(--color-surface-border-quaternary);
|
|
42
|
-
--input-error-border: var(--color-error-border-primary);
|
|
43
|
-
--input-focus-background: var(--color-surface-primary);
|
|
44
|
-
--input-focus-border: var(--color-surface-border-quaternary);
|
|
45
|
-
}
|
|
37
|
+
}
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -229,8 +229,10 @@ function useValidationAppearanceInputProps(props) {
|
|
|
229
229
|
updatedInputProps[propKey] = propValue;
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
|
+
return updatedInputProps;
|
|
233
|
+
} else {
|
|
234
|
+
return inputProps;
|
|
232
235
|
}
|
|
233
|
-
return updatedInputProps;
|
|
234
236
|
}, [validationStateKey, inputProps]);
|
|
235
237
|
return validationAppearanceInputProps;
|
|
236
238
|
}
|
|
@@ -1104,6 +1106,7 @@ const FormFieldCheckbox = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
1104
1106
|
errorKey,
|
|
1105
1107
|
errorMessage,
|
|
1106
1108
|
isErrorState,
|
|
1109
|
+
successKey,
|
|
1107
1110
|
isValidState
|
|
1108
1111
|
} = useFieldValidationState({
|
|
1109
1112
|
fieldProps: fieldProps,
|
|
@@ -1112,7 +1115,7 @@ const FormFieldCheckbox = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
1112
1115
|
});
|
|
1113
1116
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1114
1117
|
inputProps: inputProps,
|
|
1115
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1118
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1116
1119
|
});
|
|
1117
1120
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1118
1121
|
className: clsx__default.default('form-field-checkbox', 'form__item_checkbox', classNameGroupItem),
|
|
@@ -1151,6 +1154,8 @@ const defaultChipsProps = {
|
|
|
1151
1154
|
errorAppearance: 'errorPrimary sizeM solid rounded',
|
|
1152
1155
|
// Required
|
|
1153
1156
|
requiredAppearance: 'requirePrimary sizeM solid rounded'
|
|
1157
|
+
// Success
|
|
1158
|
+
// successAppearance: 'successPrimary sizeM solid rounded',
|
|
1154
1159
|
};
|
|
1155
1160
|
|
|
1156
1161
|
function FormFieldChips(props) {
|
|
@@ -1195,6 +1200,7 @@ function FormFieldChips(props) {
|
|
|
1195
1200
|
errorKey,
|
|
1196
1201
|
errorMessage,
|
|
1197
1202
|
isErrorState,
|
|
1203
|
+
successKey,
|
|
1198
1204
|
isValidState
|
|
1199
1205
|
} = useFieldValidationState({
|
|
1200
1206
|
fieldProps: fieldProps,
|
|
@@ -1203,7 +1209,7 @@ function FormFieldChips(props) {
|
|
|
1203
1209
|
});
|
|
1204
1210
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1205
1211
|
inputProps: inputProps,
|
|
1206
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1212
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1207
1213
|
});
|
|
1208
1214
|
const activeOptionsList = React.useMemo(() => {
|
|
1209
1215
|
const emptyOptionsList = [{
|
|
@@ -1264,11 +1270,11 @@ const FormFieldChoice = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1264
1270
|
name,
|
|
1265
1271
|
initialValue,
|
|
1266
1272
|
label,
|
|
1273
|
+
messageType,
|
|
1267
1274
|
isDisabled,
|
|
1268
1275
|
classNameGroupItem,
|
|
1269
1276
|
fieldProps,
|
|
1270
1277
|
inputProps,
|
|
1271
|
-
messageType,
|
|
1272
1278
|
options,
|
|
1273
1279
|
placeholder,
|
|
1274
1280
|
showMessage,
|
|
@@ -1310,10 +1316,11 @@ const FormFieldChoice = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1310
1316
|
return emptyOption;
|
|
1311
1317
|
}, [input.value]);
|
|
1312
1318
|
const {
|
|
1313
|
-
isErrorState,
|
|
1314
|
-
isValidState,
|
|
1315
1319
|
errorKey,
|
|
1316
|
-
errorMessage
|
|
1320
|
+
errorMessage,
|
|
1321
|
+
isErrorState,
|
|
1322
|
+
successKey,
|
|
1323
|
+
isValidState
|
|
1317
1324
|
} = useFieldValidationState({
|
|
1318
1325
|
fieldProps: fieldProps,
|
|
1319
1326
|
input: input,
|
|
@@ -1321,7 +1328,7 @@ const FormFieldChoice = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1321
1328
|
});
|
|
1322
1329
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1323
1330
|
inputProps: inputProps,
|
|
1324
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1331
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1325
1332
|
});
|
|
1326
1333
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1327
1334
|
className: clsx__default.default('form-field_choice', 'form__item_choice', classNameGroupItem),
|
|
@@ -1347,9 +1354,9 @@ const FormFieldChoice = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1347
1354
|
inputValue: input.value || [],
|
|
1348
1355
|
options: options,
|
|
1349
1356
|
placeholder: placeholder,
|
|
1357
|
+
setActiveSegment: setActiveSegment,
|
|
1350
1358
|
isCheckbox: isCheckbox,
|
|
1351
|
-
isRequired: isRequired
|
|
1352
|
-
setActiveSegment: setActiveSegment
|
|
1359
|
+
isRequired: isRequired
|
|
1353
1360
|
}, updatedInputProps)));
|
|
1354
1361
|
});
|
|
1355
1362
|
});
|
|
@@ -1367,6 +1374,8 @@ const FormFieldCode = /*#__PURE__*/React__default.default.memo(function FormFiel
|
|
|
1367
1374
|
const {
|
|
1368
1375
|
name,
|
|
1369
1376
|
initialValue,
|
|
1377
|
+
messageType,
|
|
1378
|
+
label,
|
|
1370
1379
|
isDisabled,
|
|
1371
1380
|
classNameGroupItem,
|
|
1372
1381
|
fieldProps = {},
|
|
@@ -1389,19 +1398,27 @@ const FormFieldCode = /*#__PURE__*/React__default.default.memo(function FormFiel
|
|
|
1389
1398
|
*/
|
|
1390
1399
|
|
|
1391
1400
|
const {
|
|
1401
|
+
errorKey,
|
|
1402
|
+
errorMessage,
|
|
1392
1403
|
isErrorState,
|
|
1393
|
-
|
|
1394
|
-
|
|
1404
|
+
successKey,
|
|
1405
|
+
isValidState
|
|
1406
|
+
} = useFieldValidationState({
|
|
1395
1407
|
fieldProps: fieldProps,
|
|
1396
1408
|
input: input,
|
|
1397
1409
|
meta: meta
|
|
1398
1410
|
});
|
|
1399
1411
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1400
1412
|
inputProps: inputProps,
|
|
1401
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1413
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1402
1414
|
});
|
|
1403
1415
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1404
1416
|
className: clsx__default.default('form-field-code', 'form__item_code', classNameGroupItem),
|
|
1417
|
+
label: label,
|
|
1418
|
+
messageType: messageType,
|
|
1419
|
+
errorKey: errorKey,
|
|
1420
|
+
errorMessage: errorMessage,
|
|
1421
|
+
isErrorState: isErrorState,
|
|
1405
1422
|
fieldClassName: 'form-code',
|
|
1406
1423
|
inputName: input.name,
|
|
1407
1424
|
inputValue: input.value,
|
|
@@ -1601,7 +1618,9 @@ const defaultInputProps = {
|
|
|
1601
1618
|
// Error
|
|
1602
1619
|
errorAppearance: 'errorPrimary sizeM solid rounded',
|
|
1603
1620
|
// Required
|
|
1604
|
-
requiredAppearance: 'requirePrimary sizeM solid rounded'
|
|
1621
|
+
requiredAppearance: 'requirePrimary sizeM solid rounded',
|
|
1622
|
+
// Success
|
|
1623
|
+
successAppearance: 'successPrimary sizeM solid rounded'
|
|
1605
1624
|
};
|
|
1606
1625
|
|
|
1607
1626
|
const FormFieldInput = /*#__PURE__*/React__default.default.memo(function FormFieldInput(props) {
|
|
@@ -1651,6 +1670,7 @@ const FormFieldInput = /*#__PURE__*/React__default.default.memo(function FormFie
|
|
|
1651
1670
|
errorKey,
|
|
1652
1671
|
errorMessage,
|
|
1653
1672
|
isErrorState,
|
|
1673
|
+
successKey,
|
|
1654
1674
|
isValidState
|
|
1655
1675
|
} = useFieldValidationState({
|
|
1656
1676
|
fieldProps: fieldProps,
|
|
@@ -1659,7 +1679,7 @@ const FormFieldInput = /*#__PURE__*/React__default.default.memo(function FormFie
|
|
|
1659
1679
|
});
|
|
1660
1680
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1661
1681
|
inputProps: inputProps,
|
|
1662
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1682
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1663
1683
|
});
|
|
1664
1684
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1665
1685
|
className: clsx__default.default('form-field_input', 'form__item_input', classNameGroupItem),
|
|
@@ -1756,6 +1776,7 @@ const FormFieldPassword = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
1756
1776
|
errorKey,
|
|
1757
1777
|
errorMessage,
|
|
1758
1778
|
isErrorState,
|
|
1779
|
+
successKey,
|
|
1759
1780
|
isValidState
|
|
1760
1781
|
} = useFieldValidationState({
|
|
1761
1782
|
fieldProps: fieldProps,
|
|
@@ -1764,7 +1785,7 @@ const FormFieldPassword = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
1764
1785
|
});
|
|
1765
1786
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1766
1787
|
inputProps: inputProps,
|
|
1767
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1788
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1768
1789
|
});
|
|
1769
1790
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1770
1791
|
className: clsx__default.default('form-field_input', 'form__item_input', classNameGroupItem),
|
|
@@ -1855,6 +1876,7 @@ function FormFieldSegmented(props) {
|
|
|
1855
1876
|
errorKey,
|
|
1856
1877
|
errorMessage,
|
|
1857
1878
|
isErrorState,
|
|
1879
|
+
successKey,
|
|
1858
1880
|
isValidState
|
|
1859
1881
|
} = useFieldValidationState({
|
|
1860
1882
|
fieldProps: fieldProps,
|
|
@@ -1863,7 +1885,7 @@ function FormFieldSegmented(props) {
|
|
|
1863
1885
|
});
|
|
1864
1886
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1865
1887
|
inputProps: inputProps,
|
|
1866
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1888
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1867
1889
|
});
|
|
1868
1890
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1869
1891
|
className: clsx__default.default('form-field_segmented', 'form__item_segmented'),
|
|
@@ -1969,10 +1991,11 @@ const FormFieldSelect = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1969
1991
|
setSelectedOptions(defaultValue);
|
|
1970
1992
|
}, [defaultValue]);
|
|
1971
1993
|
const {
|
|
1972
|
-
isErrorState,
|
|
1973
|
-
isValidState,
|
|
1974
1994
|
errorKey,
|
|
1975
|
-
errorMessage
|
|
1995
|
+
errorMessage,
|
|
1996
|
+
isErrorState,
|
|
1997
|
+
successKey,
|
|
1998
|
+
isValidState
|
|
1976
1999
|
} = useFieldValidationState({
|
|
1977
2000
|
fieldProps: fieldProps,
|
|
1978
2001
|
input: input,
|
|
@@ -1980,7 +2003,7 @@ const FormFieldSelect = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1980
2003
|
});
|
|
1981
2004
|
const updatedSelectProps = useValidationAppearanceInputProps({
|
|
1982
2005
|
inputProps: selectProps,
|
|
1983
|
-
validationStateKey: isErrorState ? errorKey :
|
|
2006
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1984
2007
|
});
|
|
1985
2008
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1986
2009
|
className: clsx__default.default('form-field_select', 'form__item_select', classNameGroupItem),
|
|
@@ -2053,6 +2076,7 @@ const FormFieldSwitch = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
2053
2076
|
errorKey,
|
|
2054
2077
|
errorMessage,
|
|
2055
2078
|
isErrorState,
|
|
2079
|
+
successKey,
|
|
2056
2080
|
isValidState
|
|
2057
2081
|
} = useFieldValidationState({
|
|
2058
2082
|
fieldProps: fieldProps,
|
|
@@ -2061,7 +2085,7 @@ const FormFieldSwitch = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
2061
2085
|
});
|
|
2062
2086
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
2063
2087
|
inputProps: inputProps,
|
|
2064
|
-
validationStateKey: isErrorState ? errorKey :
|
|
2088
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
2065
2089
|
});
|
|
2066
2090
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
2067
2091
|
className: clsx__default.default('form-field-switch', 'form__item_switch', classNameGroupItem),
|
|
@@ -2127,6 +2151,7 @@ const FormFieldTextarea = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
2127
2151
|
errorKey,
|
|
2128
2152
|
errorMessage,
|
|
2129
2153
|
isErrorState,
|
|
2154
|
+
successKey,
|
|
2130
2155
|
isValidState
|
|
2131
2156
|
} = useFieldValidationState({
|
|
2132
2157
|
fieldProps: fieldProps,
|
|
@@ -2135,7 +2160,7 @@ const FormFieldTextarea = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
2135
2160
|
});
|
|
2136
2161
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
2137
2162
|
inputProps: inputProps,
|
|
2138
|
-
validationStateKey: isErrorState ? errorKey :
|
|
2163
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
2139
2164
|
});
|
|
2140
2165
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
2141
2166
|
className: clsx__default.default('form-field_textarea', 'form__item_textarea', classNameGroupItem),
|
|
@@ -2219,6 +2244,7 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
2219
2244
|
errorKey,
|
|
2220
2245
|
errorMessage,
|
|
2221
2246
|
isErrorState,
|
|
2247
|
+
successKey,
|
|
2222
2248
|
isValidState
|
|
2223
2249
|
} = useFieldValidationState({
|
|
2224
2250
|
fieldProps: fieldProps,
|
|
@@ -2227,10 +2253,10 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
2227
2253
|
});
|
|
2228
2254
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
2229
2255
|
inputProps: inputProps,
|
|
2230
|
-
validationStateKey: isErrorState ? errorKey :
|
|
2256
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
2231
2257
|
});
|
|
2232
2258
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
2233
|
-
className: clsx__default.default('form-
|
|
2259
|
+
className: clsx__default.default('form-field-masked-input', 'form__item_masked-input', classNameGroupItem),
|
|
2234
2260
|
errorKey: errorKey,
|
|
2235
2261
|
errorMessage: errorMessage,
|
|
2236
2262
|
isErrorState: isErrorState,
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -218,8 +218,10 @@ function useValidationAppearanceInputProps(props) {
|
|
|
218
218
|
updatedInputProps[propKey] = propValue;
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
|
+
return updatedInputProps;
|
|
222
|
+
} else {
|
|
223
|
+
return inputProps;
|
|
221
224
|
}
|
|
222
|
-
return updatedInputProps;
|
|
223
225
|
}, [validationStateKey, inputProps]);
|
|
224
226
|
return validationAppearanceInputProps;
|
|
225
227
|
}
|
|
@@ -1093,6 +1095,7 @@ const FormFieldCheckbox = /*#__PURE__*/React.memo(function FormFieldCheckbox(pro
|
|
|
1093
1095
|
errorKey,
|
|
1094
1096
|
errorMessage,
|
|
1095
1097
|
isErrorState,
|
|
1098
|
+
successKey,
|
|
1096
1099
|
isValidState
|
|
1097
1100
|
} = useFieldValidationState({
|
|
1098
1101
|
fieldProps: fieldProps,
|
|
@@ -1101,7 +1104,7 @@ const FormFieldCheckbox = /*#__PURE__*/React.memo(function FormFieldCheckbox(pro
|
|
|
1101
1104
|
});
|
|
1102
1105
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1103
1106
|
inputProps: inputProps,
|
|
1104
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1107
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1105
1108
|
});
|
|
1106
1109
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1107
1110
|
className: clsx('form-field-checkbox', 'form__item_checkbox', classNameGroupItem),
|
|
@@ -1140,6 +1143,8 @@ const defaultChipsProps = {
|
|
|
1140
1143
|
errorAppearance: 'errorPrimary sizeM solid rounded',
|
|
1141
1144
|
// Required
|
|
1142
1145
|
requiredAppearance: 'requirePrimary sizeM solid rounded'
|
|
1146
|
+
// Success
|
|
1147
|
+
// successAppearance: 'successPrimary sizeM solid rounded',
|
|
1143
1148
|
};
|
|
1144
1149
|
|
|
1145
1150
|
function FormFieldChips(props) {
|
|
@@ -1184,6 +1189,7 @@ function FormFieldChips(props) {
|
|
|
1184
1189
|
errorKey,
|
|
1185
1190
|
errorMessage,
|
|
1186
1191
|
isErrorState,
|
|
1192
|
+
successKey,
|
|
1187
1193
|
isValidState
|
|
1188
1194
|
} = useFieldValidationState({
|
|
1189
1195
|
fieldProps: fieldProps,
|
|
@@ -1192,7 +1198,7 @@ function FormFieldChips(props) {
|
|
|
1192
1198
|
});
|
|
1193
1199
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1194
1200
|
inputProps: inputProps,
|
|
1195
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1201
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1196
1202
|
});
|
|
1197
1203
|
const activeOptionsList = useMemo(() => {
|
|
1198
1204
|
const emptyOptionsList = [{
|
|
@@ -1253,11 +1259,11 @@ const FormFieldChoice = /*#__PURE__*/React.memo(function FormFieldChoice(props)
|
|
|
1253
1259
|
name,
|
|
1254
1260
|
initialValue,
|
|
1255
1261
|
label,
|
|
1262
|
+
messageType,
|
|
1256
1263
|
isDisabled,
|
|
1257
1264
|
classNameGroupItem,
|
|
1258
1265
|
fieldProps,
|
|
1259
1266
|
inputProps,
|
|
1260
|
-
messageType,
|
|
1261
1267
|
options,
|
|
1262
1268
|
placeholder,
|
|
1263
1269
|
showMessage,
|
|
@@ -1299,10 +1305,11 @@ const FormFieldChoice = /*#__PURE__*/React.memo(function FormFieldChoice(props)
|
|
|
1299
1305
|
return emptyOption;
|
|
1300
1306
|
}, [input.value]);
|
|
1301
1307
|
const {
|
|
1302
|
-
isErrorState,
|
|
1303
|
-
isValidState,
|
|
1304
1308
|
errorKey,
|
|
1305
|
-
errorMessage
|
|
1309
|
+
errorMessage,
|
|
1310
|
+
isErrorState,
|
|
1311
|
+
successKey,
|
|
1312
|
+
isValidState
|
|
1306
1313
|
} = useFieldValidationState({
|
|
1307
1314
|
fieldProps: fieldProps,
|
|
1308
1315
|
input: input,
|
|
@@ -1310,7 +1317,7 @@ const FormFieldChoice = /*#__PURE__*/React.memo(function FormFieldChoice(props)
|
|
|
1310
1317
|
});
|
|
1311
1318
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1312
1319
|
inputProps: inputProps,
|
|
1313
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1320
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1314
1321
|
});
|
|
1315
1322
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1316
1323
|
className: clsx('form-field_choice', 'form__item_choice', classNameGroupItem),
|
|
@@ -1336,9 +1343,9 @@ const FormFieldChoice = /*#__PURE__*/React.memo(function FormFieldChoice(props)
|
|
|
1336
1343
|
inputValue: input.value || [],
|
|
1337
1344
|
options: options,
|
|
1338
1345
|
placeholder: placeholder,
|
|
1346
|
+
setActiveSegment: setActiveSegment,
|
|
1339
1347
|
isCheckbox: isCheckbox,
|
|
1340
|
-
isRequired: isRequired
|
|
1341
|
-
setActiveSegment: setActiveSegment
|
|
1348
|
+
isRequired: isRequired
|
|
1342
1349
|
}, updatedInputProps)));
|
|
1343
1350
|
});
|
|
1344
1351
|
});
|
|
@@ -1356,6 +1363,8 @@ const FormFieldCode = /*#__PURE__*/React.memo(function FormFieldCode(props) {
|
|
|
1356
1363
|
const {
|
|
1357
1364
|
name,
|
|
1358
1365
|
initialValue,
|
|
1366
|
+
messageType,
|
|
1367
|
+
label,
|
|
1359
1368
|
isDisabled,
|
|
1360
1369
|
classNameGroupItem,
|
|
1361
1370
|
fieldProps = {},
|
|
@@ -1378,19 +1387,27 @@ const FormFieldCode = /*#__PURE__*/React.memo(function FormFieldCode(props) {
|
|
|
1378
1387
|
*/
|
|
1379
1388
|
|
|
1380
1389
|
const {
|
|
1390
|
+
errorKey,
|
|
1391
|
+
errorMessage,
|
|
1381
1392
|
isErrorState,
|
|
1382
|
-
|
|
1383
|
-
|
|
1393
|
+
successKey,
|
|
1394
|
+
isValidState
|
|
1395
|
+
} = useFieldValidationState({
|
|
1384
1396
|
fieldProps: fieldProps,
|
|
1385
1397
|
input: input,
|
|
1386
1398
|
meta: meta
|
|
1387
1399
|
});
|
|
1388
1400
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1389
1401
|
inputProps: inputProps,
|
|
1390
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1402
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1391
1403
|
});
|
|
1392
1404
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1393
1405
|
className: clsx('form-field-code', 'form__item_code', classNameGroupItem),
|
|
1406
|
+
label: label,
|
|
1407
|
+
messageType: messageType,
|
|
1408
|
+
errorKey: errorKey,
|
|
1409
|
+
errorMessage: errorMessage,
|
|
1410
|
+
isErrorState: isErrorState,
|
|
1394
1411
|
fieldClassName: 'form-code',
|
|
1395
1412
|
inputName: input.name,
|
|
1396
1413
|
inputValue: input.value,
|
|
@@ -1590,7 +1607,9 @@ const defaultInputProps = {
|
|
|
1590
1607
|
// Error
|
|
1591
1608
|
errorAppearance: 'errorPrimary sizeM solid rounded',
|
|
1592
1609
|
// Required
|
|
1593
|
-
requiredAppearance: 'requirePrimary sizeM solid rounded'
|
|
1610
|
+
requiredAppearance: 'requirePrimary sizeM solid rounded',
|
|
1611
|
+
// Success
|
|
1612
|
+
successAppearance: 'successPrimary sizeM solid rounded'
|
|
1594
1613
|
};
|
|
1595
1614
|
|
|
1596
1615
|
const FormFieldInput = /*#__PURE__*/React.memo(function FormFieldInput(props) {
|
|
@@ -1640,6 +1659,7 @@ const FormFieldInput = /*#__PURE__*/React.memo(function FormFieldInput(props) {
|
|
|
1640
1659
|
errorKey,
|
|
1641
1660
|
errorMessage,
|
|
1642
1661
|
isErrorState,
|
|
1662
|
+
successKey,
|
|
1643
1663
|
isValidState
|
|
1644
1664
|
} = useFieldValidationState({
|
|
1645
1665
|
fieldProps: fieldProps,
|
|
@@ -1648,7 +1668,7 @@ const FormFieldInput = /*#__PURE__*/React.memo(function FormFieldInput(props) {
|
|
|
1648
1668
|
});
|
|
1649
1669
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1650
1670
|
inputProps: inputProps,
|
|
1651
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1671
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1652
1672
|
});
|
|
1653
1673
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1654
1674
|
className: clsx('form-field_input', 'form__item_input', classNameGroupItem),
|
|
@@ -1745,6 +1765,7 @@ const FormFieldPassword = /*#__PURE__*/React.memo(function FormFieldPassword(pro
|
|
|
1745
1765
|
errorKey,
|
|
1746
1766
|
errorMessage,
|
|
1747
1767
|
isErrorState,
|
|
1768
|
+
successKey,
|
|
1748
1769
|
isValidState
|
|
1749
1770
|
} = useFieldValidationState({
|
|
1750
1771
|
fieldProps: fieldProps,
|
|
@@ -1753,7 +1774,7 @@ const FormFieldPassword = /*#__PURE__*/React.memo(function FormFieldPassword(pro
|
|
|
1753
1774
|
});
|
|
1754
1775
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1755
1776
|
inputProps: inputProps,
|
|
1756
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1777
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1757
1778
|
});
|
|
1758
1779
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1759
1780
|
className: clsx('form-field_input', 'form__item_input', classNameGroupItem),
|
|
@@ -1844,6 +1865,7 @@ function FormFieldSegmented(props) {
|
|
|
1844
1865
|
errorKey,
|
|
1845
1866
|
errorMessage,
|
|
1846
1867
|
isErrorState,
|
|
1868
|
+
successKey,
|
|
1847
1869
|
isValidState
|
|
1848
1870
|
} = useFieldValidationState({
|
|
1849
1871
|
fieldProps: fieldProps,
|
|
@@ -1852,7 +1874,7 @@ function FormFieldSegmented(props) {
|
|
|
1852
1874
|
});
|
|
1853
1875
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
1854
1876
|
inputProps: inputProps,
|
|
1855
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1877
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1856
1878
|
});
|
|
1857
1879
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1858
1880
|
className: clsx('form-field_segmented', 'form__item_segmented'),
|
|
@@ -1958,10 +1980,11 @@ const FormFieldSelect = /*#__PURE__*/React.memo(function FormFieldSelect(props)
|
|
|
1958
1980
|
setSelectedOptions(defaultValue);
|
|
1959
1981
|
}, [defaultValue]);
|
|
1960
1982
|
const {
|
|
1961
|
-
isErrorState,
|
|
1962
|
-
isValidState,
|
|
1963
1983
|
errorKey,
|
|
1964
|
-
errorMessage
|
|
1984
|
+
errorMessage,
|
|
1985
|
+
isErrorState,
|
|
1986
|
+
successKey,
|
|
1987
|
+
isValidState
|
|
1965
1988
|
} = useFieldValidationState({
|
|
1966
1989
|
fieldProps: fieldProps,
|
|
1967
1990
|
input: input,
|
|
@@ -1969,7 +1992,7 @@ const FormFieldSelect = /*#__PURE__*/React.memo(function FormFieldSelect(props)
|
|
|
1969
1992
|
});
|
|
1970
1993
|
const updatedSelectProps = useValidationAppearanceInputProps({
|
|
1971
1994
|
inputProps: selectProps,
|
|
1972
|
-
validationStateKey: isErrorState ? errorKey :
|
|
1995
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1973
1996
|
});
|
|
1974
1997
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1975
1998
|
className: clsx('form-field_select', 'form__item_select', classNameGroupItem),
|
|
@@ -2042,6 +2065,7 @@ const FormFieldSwitch = /*#__PURE__*/React.memo(function FormFieldSwitch(props)
|
|
|
2042
2065
|
errorKey,
|
|
2043
2066
|
errorMessage,
|
|
2044
2067
|
isErrorState,
|
|
2068
|
+
successKey,
|
|
2045
2069
|
isValidState
|
|
2046
2070
|
} = useFieldValidationState({
|
|
2047
2071
|
fieldProps: fieldProps,
|
|
@@ -2050,7 +2074,7 @@ const FormFieldSwitch = /*#__PURE__*/React.memo(function FormFieldSwitch(props)
|
|
|
2050
2074
|
});
|
|
2051
2075
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
2052
2076
|
inputProps: inputProps,
|
|
2053
|
-
validationStateKey: isErrorState ? errorKey :
|
|
2077
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
2054
2078
|
});
|
|
2055
2079
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2056
2080
|
className: clsx('form-field-switch', 'form__item_switch', classNameGroupItem),
|
|
@@ -2116,6 +2140,7 @@ const FormFieldTextarea = /*#__PURE__*/React.memo(function FormFieldTextarea(pro
|
|
|
2116
2140
|
errorKey,
|
|
2117
2141
|
errorMessage,
|
|
2118
2142
|
isErrorState,
|
|
2143
|
+
successKey,
|
|
2119
2144
|
isValidState
|
|
2120
2145
|
} = useFieldValidationState({
|
|
2121
2146
|
fieldProps: fieldProps,
|
|
@@ -2124,7 +2149,7 @@ const FormFieldTextarea = /*#__PURE__*/React.memo(function FormFieldTextarea(pro
|
|
|
2124
2149
|
});
|
|
2125
2150
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
2126
2151
|
inputProps: inputProps,
|
|
2127
|
-
validationStateKey: isErrorState ? errorKey :
|
|
2152
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
2128
2153
|
});
|
|
2129
2154
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2130
2155
|
className: clsx('form-field_textarea', 'form__item_textarea', classNameGroupItem),
|
|
@@ -2208,6 +2233,7 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
2208
2233
|
errorKey,
|
|
2209
2234
|
errorMessage,
|
|
2210
2235
|
isErrorState,
|
|
2236
|
+
successKey,
|
|
2211
2237
|
isValidState
|
|
2212
2238
|
} = useFieldValidationState({
|
|
2213
2239
|
fieldProps: fieldProps,
|
|
@@ -2216,10 +2242,10 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
2216
2242
|
});
|
|
2217
2243
|
const updatedInputProps = useValidationAppearanceInputProps({
|
|
2218
2244
|
inputProps: inputProps,
|
|
2219
|
-
validationStateKey: isErrorState ? errorKey :
|
|
2245
|
+
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
2220
2246
|
});
|
|
2221
2247
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2222
|
-
className: clsx('form-
|
|
2248
|
+
className: clsx('form-field-masked-input', 'form__item_masked-input', classNameGroupItem),
|
|
2223
2249
|
errorKey: errorKey,
|
|
2224
2250
|
errorMessage: errorMessage,
|
|
2225
2251
|
isErrorState: isErrorState,
|