@itcase/forms 1.0.46 → 1.0.48
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.
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.form-datepicker {
|
|
2
|
+
&&_state {
|
|
3
|
+
&_success {
|
|
4
|
+
& .input {
|
|
5
|
+
border: solid 1px var(--datepicker-success-border);
|
|
6
|
+
&:hover {
|
|
7
|
+
border: solid 1px var(--datepicker-success-border-hover);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
&_error {
|
|
12
|
+
& .input {
|
|
13
|
+
border: solid 1px var(--datepicker-error-border);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
&_focus {
|
|
17
|
+
& .input {
|
|
18
|
+
background: var(--datepicker-focus-background);
|
|
19
|
+
border: solid 1px var(--datepicker-focus-border);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:root {
|
|
26
|
+
--datepicker-success-border: var(--color-success-border-primary);
|
|
27
|
+
--datepicker-success-border-hover: var(--color-surface-border-quaternary);
|
|
28
|
+
--datepicker-error-border: var(--color-error-border-primary);
|
|
29
|
+
--datepicker-focus-background: var(--color-surface-primary);
|
|
30
|
+
--datepicker-focus-border: var(--color-surface-border-quaternary);
|
|
31
|
+
}
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -240,18 +240,18 @@ function FieldWrapperBase(props) {
|
|
|
240
240
|
fill: dividerFill
|
|
241
241
|
})), !hideMessage && /*#__PURE__*/React__default.default.createElement("div", {
|
|
242
242
|
className: "form-field__message"
|
|
243
|
-
}, Boolean(showError) && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
243
|
+
}, Boolean(showError) && error && typeof error === 'string' && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
244
244
|
className: "form-field__message-item form-field__message-item_type-error",
|
|
245
245
|
size: errorMessageTextSize,
|
|
246
246
|
textWeight: errorMessageTextWeight,
|
|
247
247
|
textColor: errorMessageTextColor,
|
|
248
248
|
id: `${inputName}-error`
|
|
249
|
-
}, error), Boolean(message) && !
|
|
249
|
+
}, error), Boolean(message) && (!error || typeof error !== 'string') && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
250
250
|
className: "form-field__message-item form-field__message-item_type_message",
|
|
251
251
|
size: messageTextSize,
|
|
252
252
|
textWeight: messageTextWeight,
|
|
253
253
|
textColor: messageTextColor
|
|
254
|
-
}, message),
|
|
254
|
+
}, message), (!showError && !message || showError && !message && (!error || typeof error !== 'string')) && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
255
255
|
className: "form-field__message-item form-field__message-item_type_message",
|
|
256
256
|
size: messageTextSize
|
|
257
257
|
}, '\u00A0')), after);
|
|
@@ -418,6 +418,7 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
418
418
|
inputProps,
|
|
419
419
|
isMultiple,
|
|
420
420
|
isRequired,
|
|
421
|
+
isDisabled,
|
|
421
422
|
label,
|
|
422
423
|
messageType,
|
|
423
424
|
name,
|
|
@@ -477,7 +478,8 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
477
478
|
isRequired: isRequired,
|
|
478
479
|
placeholder: placeholder,
|
|
479
480
|
active: activeOption,
|
|
480
|
-
setActiveSegment: setActiveSegment
|
|
481
|
+
setActiveSegment: setActiveSegment,
|
|
482
|
+
isDisabled: isDisabled
|
|
481
483
|
}, inputProps)));
|
|
482
484
|
});
|
|
483
485
|
});
|
|
@@ -485,17 +487,14 @@ ChoiceField.propTypes = {
|
|
|
485
487
|
classNameGroupItem: PropTypes__default.default.string,
|
|
486
488
|
fieldProps: PropTypes__default.default.object,
|
|
487
489
|
hideMessage: PropTypes__default.default.bool,
|
|
488
|
-
initialValue: PropTypes__default.default.string,
|
|
490
|
+
initialValue: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number, PropTypes__default.default.bool]),
|
|
489
491
|
inputProps: PropTypes__default.default.object,
|
|
490
492
|
isMultiple: PropTypes__default.default.bool,
|
|
491
493
|
isRequired: PropTypes__default.default.bool,
|
|
492
|
-
label: PropTypes__default.default.string,
|
|
494
|
+
label: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.element]),
|
|
493
495
|
messageType: PropTypes__default.default.string,
|
|
494
496
|
name: PropTypes__default.default.string,
|
|
495
|
-
options:
|
|
496
|
-
value: PropTypes__default.default.string,
|
|
497
|
-
label: PropTypes__default.default.string
|
|
498
|
-
})),
|
|
497
|
+
options: Choice.Choice.propTypes.options,
|
|
499
498
|
placeholder: PropTypes__default.default.string,
|
|
500
499
|
onChange: PropTypes__default.default.func
|
|
501
500
|
};
|
|
@@ -1214,7 +1213,7 @@ const Group = /*#__PURE__*/React__default.default.memo(function Group(props) {
|
|
|
1214
1213
|
messageTextColor,
|
|
1215
1214
|
children,
|
|
1216
1215
|
dataTour,
|
|
1217
|
-
|
|
1216
|
+
hideGroupMessage,
|
|
1218
1217
|
name,
|
|
1219
1218
|
showErrorsOnSubmit
|
|
1220
1219
|
} = props;
|
|
@@ -1245,13 +1244,13 @@ const Group = /*#__PURE__*/React__default.default.memo(function Group(props) {
|
|
|
1245
1244
|
textWeight: labelTextWeight
|
|
1246
1245
|
}, label)), /*#__PURE__*/React__default.default.createElement("div", {
|
|
1247
1246
|
className: "form__group-items"
|
|
1248
|
-
}, children), after), !
|
|
1247
|
+
}, children), after), !hideGroupMessage && /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, Boolean(showError) && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1249
1248
|
className: "form__group-message form__group-message_type-error",
|
|
1250
1249
|
size: errorMessageTextSize,
|
|
1251
1250
|
textWeight: errorMessageTextWeight,
|
|
1252
1251
|
textColor: errorMessageTextColor,
|
|
1253
1252
|
id: `${name}-error`
|
|
1254
|
-
}, error), Boolean(message) && !
|
|
1253
|
+
}, error), Boolean(message) && (!error || typeof error !== 'string') && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1255
1254
|
className: "form__group-message",
|
|
1256
1255
|
size: messageTextSize,
|
|
1257
1256
|
textWeight: messageTextWeight,
|
|
@@ -1288,6 +1287,7 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1288
1287
|
name,
|
|
1289
1288
|
parse,
|
|
1290
1289
|
iconSize,
|
|
1290
|
+
isDisabled,
|
|
1291
1291
|
iconBorder,
|
|
1292
1292
|
iconBorderHover,
|
|
1293
1293
|
iconFill,
|
|
@@ -1346,7 +1346,8 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
|
|
|
1346
1346
|
value: input.value || '',
|
|
1347
1347
|
onBlur: input.onBlur,
|
|
1348
1348
|
onChange: onChangeField,
|
|
1349
|
-
onFocus: input.onFocus
|
|
1349
|
+
onFocus: input.onFocus,
|
|
1350
|
+
isDisabled: isDisabled
|
|
1350
1351
|
}, inputProps)), isRevealable && /*#__PURE__*/React__default.default.createElement(Icon.Icon, {
|
|
1351
1352
|
className: "form-field__icon",
|
|
1352
1353
|
iconFill: iconFill,
|
|
@@ -1505,8 +1506,11 @@ RadioGroupList.propTypes = {
|
|
|
1505
1506
|
editableProps: PropTypes__default.default.object,
|
|
1506
1507
|
input: PropTypes__default.default.object,
|
|
1507
1508
|
inputProps: PropTypes__default.default.object,
|
|
1508
|
-
|
|
1509
|
-
|
|
1509
|
+
options: PropTypes__default.default.arrayOf(PropTypes__default.default.shape({
|
|
1510
|
+
value: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number, PropTypes__default.default.bool]),
|
|
1511
|
+
label: PropTypes__default.default.string
|
|
1512
|
+
})),
|
|
1513
|
+
onChange: PropTypes__default.default.func
|
|
1510
1514
|
};
|
|
1511
1515
|
|
|
1512
1516
|
const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(props) {
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -230,18 +230,18 @@ function FieldWrapperBase(props) {
|
|
|
230
230
|
fill: dividerFill
|
|
231
231
|
})), !hideMessage && /*#__PURE__*/React.createElement("div", {
|
|
232
232
|
className: "form-field__message"
|
|
233
|
-
}, Boolean(showError) && /*#__PURE__*/React.createElement(Text, {
|
|
233
|
+
}, Boolean(showError) && error && typeof error === 'string' && /*#__PURE__*/React.createElement(Text, {
|
|
234
234
|
className: "form-field__message-item form-field__message-item_type-error",
|
|
235
235
|
size: errorMessageTextSize,
|
|
236
236
|
textWeight: errorMessageTextWeight,
|
|
237
237
|
textColor: errorMessageTextColor,
|
|
238
238
|
id: `${inputName}-error`
|
|
239
|
-
}, error), Boolean(message) && !
|
|
239
|
+
}, error), Boolean(message) && (!error || typeof error !== 'string') && /*#__PURE__*/React.createElement(Text, {
|
|
240
240
|
className: "form-field__message-item form-field__message-item_type_message",
|
|
241
241
|
size: messageTextSize,
|
|
242
242
|
textWeight: messageTextWeight,
|
|
243
243
|
textColor: messageTextColor
|
|
244
|
-
}, message),
|
|
244
|
+
}, message), (!showError && !message || showError && !message && (!error || typeof error !== 'string')) && /*#__PURE__*/React.createElement(Text, {
|
|
245
245
|
className: "form-field__message-item form-field__message-item_type_message",
|
|
246
246
|
size: messageTextSize
|
|
247
247
|
}, '\u00A0')), after);
|
|
@@ -408,6 +408,7 @@ const ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
|
408
408
|
inputProps,
|
|
409
409
|
isMultiple,
|
|
410
410
|
isRequired,
|
|
411
|
+
isDisabled,
|
|
411
412
|
label,
|
|
412
413
|
messageType,
|
|
413
414
|
name,
|
|
@@ -467,7 +468,8 @@ const ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
|
467
468
|
isRequired: isRequired,
|
|
468
469
|
placeholder: placeholder,
|
|
469
470
|
active: activeOption,
|
|
470
|
-
setActiveSegment: setActiveSegment
|
|
471
|
+
setActiveSegment: setActiveSegment,
|
|
472
|
+
isDisabled: isDisabled
|
|
471
473
|
}, inputProps)));
|
|
472
474
|
});
|
|
473
475
|
});
|
|
@@ -475,17 +477,14 @@ ChoiceField.propTypes = {
|
|
|
475
477
|
classNameGroupItem: PropTypes.string,
|
|
476
478
|
fieldProps: PropTypes.object,
|
|
477
479
|
hideMessage: PropTypes.bool,
|
|
478
|
-
initialValue: PropTypes.string,
|
|
480
|
+
initialValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
479
481
|
inputProps: PropTypes.object,
|
|
480
482
|
isMultiple: PropTypes.bool,
|
|
481
483
|
isRequired: PropTypes.bool,
|
|
482
|
-
label: PropTypes.string,
|
|
484
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
483
485
|
messageType: PropTypes.string,
|
|
484
486
|
name: PropTypes.string,
|
|
485
|
-
options:
|
|
486
|
-
value: PropTypes.string,
|
|
487
|
-
label: PropTypes.string
|
|
488
|
-
})),
|
|
487
|
+
options: Choice.propTypes.options,
|
|
489
488
|
placeholder: PropTypes.string,
|
|
490
489
|
onChange: PropTypes.func
|
|
491
490
|
};
|
|
@@ -1204,7 +1203,7 @@ const Group = /*#__PURE__*/React.memo(function Group(props) {
|
|
|
1204
1203
|
messageTextColor,
|
|
1205
1204
|
children,
|
|
1206
1205
|
dataTour,
|
|
1207
|
-
|
|
1206
|
+
hideGroupMessage,
|
|
1208
1207
|
name,
|
|
1209
1208
|
showErrorsOnSubmit
|
|
1210
1209
|
} = props;
|
|
@@ -1235,13 +1234,13 @@ const Group = /*#__PURE__*/React.memo(function Group(props) {
|
|
|
1235
1234
|
textWeight: labelTextWeight
|
|
1236
1235
|
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
1237
1236
|
className: "form__group-items"
|
|
1238
|
-
}, children), after), !
|
|
1237
|
+
}, children), after), !hideGroupMessage && /*#__PURE__*/React.createElement(React.Fragment, null, Boolean(showError) && /*#__PURE__*/React.createElement(Text, {
|
|
1239
1238
|
className: "form__group-message form__group-message_type-error",
|
|
1240
1239
|
size: errorMessageTextSize,
|
|
1241
1240
|
textWeight: errorMessageTextWeight,
|
|
1242
1241
|
textColor: errorMessageTextColor,
|
|
1243
1242
|
id: `${name}-error`
|
|
1244
|
-
}, error), Boolean(message) && !
|
|
1243
|
+
}, error), Boolean(message) && (!error || typeof error !== 'string') && /*#__PURE__*/React.createElement(Text, {
|
|
1245
1244
|
className: "form__group-message",
|
|
1246
1245
|
size: messageTextSize,
|
|
1247
1246
|
textWeight: messageTextWeight,
|
|
@@ -1278,6 +1277,7 @@ const InputField = /*#__PURE__*/React.memo(function InputField(props) {
|
|
|
1278
1277
|
name,
|
|
1279
1278
|
parse,
|
|
1280
1279
|
iconSize,
|
|
1280
|
+
isDisabled,
|
|
1281
1281
|
iconBorder,
|
|
1282
1282
|
iconBorderHover,
|
|
1283
1283
|
iconFill,
|
|
@@ -1336,7 +1336,8 @@ const InputField = /*#__PURE__*/React.memo(function InputField(props) {
|
|
|
1336
1336
|
value: input.value || '',
|
|
1337
1337
|
onBlur: input.onBlur,
|
|
1338
1338
|
onChange: onChangeField,
|
|
1339
|
-
onFocus: input.onFocus
|
|
1339
|
+
onFocus: input.onFocus,
|
|
1340
|
+
isDisabled: isDisabled
|
|
1340
1341
|
}, inputProps)), isRevealable && /*#__PURE__*/React.createElement(Icon, {
|
|
1341
1342
|
className: "form-field__icon",
|
|
1342
1343
|
iconFill: iconFill,
|
|
@@ -1495,8 +1496,11 @@ RadioGroupList.propTypes = {
|
|
|
1495
1496
|
editableProps: PropTypes.object,
|
|
1496
1497
|
input: PropTypes.object,
|
|
1497
1498
|
inputProps: PropTypes.object,
|
|
1498
|
-
|
|
1499
|
-
|
|
1499
|
+
options: PropTypes.arrayOf(PropTypes.shape({
|
|
1500
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
1501
|
+
label: PropTypes.string
|
|
1502
|
+
})),
|
|
1503
|
+
onChange: PropTypes.func
|
|
1500
1504
|
};
|
|
1501
1505
|
|
|
1502
1506
|
const RadioGroup = /*#__PURE__*/React.memo(function RadioGroup(props) {
|