@itcase/forms 1.0.19 → 1.0.21
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/css/form/Field/Checkbox/Checkbox.css +2 -2
- package/dist/css/form/Field/Group/Group.css +23 -11
- package/dist/css/form/Field/Segmented/Segmented.css +8 -4
- package/dist/css/form/Form/Form.css +3 -14
- package/dist/css/form/Form/css/form-notification/form-notification.css +3 -0
- package/dist/itcase-forms.cjs.js +14 -13
- package/dist/itcase-forms.esm.js +14 -13
- package/package.json +1 -1
- package/dist/css/form/Form/css/__group/form__group.css +0 -14
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
&_focus {
|
|
14
14
|
& .checkbox__state {
|
|
15
|
-
|
|
15
|
+
/* border: solid 1px var(--color-error-border-primary); */
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
align-self: flex-start;
|
|
31
31
|
grid-row: 1;
|
|
32
32
|
&-inner {
|
|
33
|
-
padding:
|
|
33
|
+
padding: 2px 0 0 0;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
^&__message {
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
.form
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
.form {
|
|
2
|
+
&__group {
|
|
3
|
+
width: 100%;
|
|
4
|
+
margin: 0;
|
|
5
|
+
&-wrapper {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-flow: column nowrap;
|
|
8
|
+
^&-label {
|
|
9
|
+
}
|
|
10
|
+
^&-items {
|
|
11
|
+
}
|
|
12
|
+
^&-message {
|
|
13
|
+
&_type_error {
|
|
14
|
+
color: var(--color-error-text-primary);
|
|
15
|
+
}
|
|
16
|
+
&_type_require {
|
|
17
|
+
color: var(--color-require-text-primary);
|
|
18
|
+
}
|
|
19
|
+
&_type_success {
|
|
20
|
+
color: var(--color-success-text-primary);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
12
23
|
}
|
|
13
24
|
}
|
|
25
|
+
|
|
14
26
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
.form-segmented {
|
|
2
|
-
&
|
|
2
|
+
&_state_error {
|
|
3
3
|
& .segmented {
|
|
4
|
-
|
|
4
|
+
&__item-label-text {
|
|
5
|
+
color: var(--color-error-text-primary);
|
|
6
|
+
}
|
|
5
7
|
}
|
|
6
8
|
}
|
|
7
|
-
&
|
|
9
|
+
&_state_required {
|
|
8
10
|
& .segmented {
|
|
9
|
-
|
|
11
|
+
&__item-label-text {
|
|
12
|
+
color: var(--color-active-text-primary);
|
|
13
|
+
}
|
|
10
14
|
}
|
|
11
15
|
}
|
|
12
16
|
}
|
|
@@ -7,20 +7,6 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
.form {
|
|
11
|
-
&__group {
|
|
12
|
-
width: 100%;
|
|
13
|
-
margin: 0;
|
|
14
|
-
&-wrapper {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-flow: column nowrap;
|
|
17
|
-
^&-label {
|
|
18
|
-
}
|
|
19
|
-
^&-items {
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
10
|
.form {
|
|
25
11
|
&__header {
|
|
26
12
|
width: 100%;
|
|
@@ -217,6 +203,9 @@
|
|
|
217
203
|
top: 20px;
|
|
218
204
|
left: 0;
|
|
219
205
|
}
|
|
206
|
+
&_global {
|
|
207
|
+
margin: 0 0 16px 0;
|
|
208
|
+
}
|
|
220
209
|
}
|
|
221
210
|
&__item {
|
|
222
211
|
text-align: center;
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -56,9 +56,10 @@ var emailValidation = function emailValidation(value, context) {
|
|
|
56
56
|
var addRequiredFieldsParamToSchema = function addRequiredFieldsParamToSchema(schema) {
|
|
57
57
|
var fields = Object.entries(schema.fields);
|
|
58
58
|
schema.requiredFields = fields.reduce(function (list, _ref) {
|
|
59
|
+
var _validationProps$excl;
|
|
59
60
|
var fieldName = _ref[0],
|
|
60
61
|
validationProps = _ref[1];
|
|
61
|
-
if (validationProps.exclusiveTests.required) {
|
|
62
|
+
if ((_validationProps$excl = validationProps.exclusiveTests) != null && _validationProps$excl.required) {
|
|
62
63
|
list.push(fieldName);
|
|
63
64
|
}
|
|
64
65
|
return list;
|
|
@@ -1627,22 +1628,18 @@ var Group = /*#__PURE__*/React__default.default.memo(function Group(props) {
|
|
|
1627
1628
|
textWeight: labelTextWeight
|
|
1628
1629
|
}, label)), /*#__PURE__*/React__default.default.createElement("div", {
|
|
1629
1630
|
className: "form__group-items"
|
|
1630
|
-
}, children), after), Boolean(showError) && /*#__PURE__*/React__default.default.createElement(
|
|
1631
|
-
className: "
|
|
1632
|
-
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1633
|
-
className: "form-field__message-item form-field__message-item_type-error",
|
|
1631
|
+
}, children), after), Boolean(showError) && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1632
|
+
className: "form__group-message form__group-message_type-error",
|
|
1634
1633
|
size: errorMessageTextSize,
|
|
1635
1634
|
textWeight: errorMessageTextWeight,
|
|
1636
1635
|
textColor: errorMessageTextColor,
|
|
1637
1636
|
id: name + "-error"
|
|
1638
|
-
}, error)
|
|
1639
|
-
className: "
|
|
1640
|
-
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1641
|
-
className: "form-field__message-item form-field__message-item_type_message",
|
|
1637
|
+
}, error), Boolean(message) && !showError && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1638
|
+
className: "form__group-message",
|
|
1642
1639
|
size: messageTextSize,
|
|
1643
1640
|
textWeight: messageTextWeight,
|
|
1644
1641
|
textColor: messageTextColor
|
|
1645
|
-
}, message))
|
|
1642
|
+
}, message));
|
|
1646
1643
|
});
|
|
1647
1644
|
});
|
|
1648
1645
|
Group.defaultProps = {
|
|
@@ -1650,7 +1647,9 @@ Group.defaultProps = {
|
|
|
1650
1647
|
fieldProps: {},
|
|
1651
1648
|
type: 'normal',
|
|
1652
1649
|
errorMessageTextSize: 's',
|
|
1653
|
-
errorMessageTextColor: '
|
|
1650
|
+
errorMessageTextColor: 'errorTextPrimary',
|
|
1651
|
+
messageTextSize: 's',
|
|
1652
|
+
messageTextColor: 'surfaceTextTertiary'
|
|
1654
1653
|
};
|
|
1655
1654
|
Group.propTypes = {
|
|
1656
1655
|
name: PropTypes__default.default.string.isRequired,
|
|
@@ -2575,10 +2574,12 @@ var FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalFor
|
|
|
2575
2574
|
textColor: descriptionTextColor,
|
|
2576
2575
|
textWeight: descriptionTextWeight
|
|
2577
2576
|
}, description), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React__default.default.createElement("div", {
|
|
2578
|
-
className: clsx__default.default('notification', 'form-notification', notificationType
|
|
2577
|
+
className: clsx__default.default('notification', 'form-notification', notificationType ? "form-notification_type_" + notificationType : 'form-notification_type_global')
|
|
2579
2578
|
}, /*#__PURE__*/React__default.default.createElement(Notification.NotificationItem, {
|
|
2580
2579
|
className: "form-notification__item",
|
|
2581
|
-
|
|
2580
|
+
titleTextSize: "h6",
|
|
2581
|
+
title: form.getState().submitError,
|
|
2582
|
+
set: "form",
|
|
2582
2583
|
status: "error"
|
|
2583
2584
|
})), onChangeFormValues && /*#__PURE__*/React__default.default.createElement(reactFinalForm.FormSpy, {
|
|
2584
2585
|
subscription: {
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -46,9 +46,10 @@ var emailValidation = function emailValidation(value, context) {
|
|
|
46
46
|
var addRequiredFieldsParamToSchema = function addRequiredFieldsParamToSchema(schema) {
|
|
47
47
|
var fields = Object.entries(schema.fields);
|
|
48
48
|
schema.requiredFields = fields.reduce(function (list, _ref) {
|
|
49
|
+
var _validationProps$excl;
|
|
49
50
|
var fieldName = _ref[0],
|
|
50
51
|
validationProps = _ref[1];
|
|
51
|
-
if (validationProps.exclusiveTests.required) {
|
|
52
|
+
if ((_validationProps$excl = validationProps.exclusiveTests) != null && _validationProps$excl.required) {
|
|
52
53
|
list.push(fieldName);
|
|
53
54
|
}
|
|
54
55
|
return list;
|
|
@@ -1617,22 +1618,18 @@ var Group = /*#__PURE__*/React.memo(function Group(props) {
|
|
|
1617
1618
|
textWeight: labelTextWeight
|
|
1618
1619
|
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
1619
1620
|
className: "form__group-items"
|
|
1620
|
-
}, children), after), Boolean(showError) && /*#__PURE__*/React.createElement(
|
|
1621
|
-
className: "
|
|
1622
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
1623
|
-
className: "form-field__message-item form-field__message-item_type-error",
|
|
1621
|
+
}, children), after), Boolean(showError) && /*#__PURE__*/React.createElement(Text, {
|
|
1622
|
+
className: "form__group-message form__group-message_type-error",
|
|
1624
1623
|
size: errorMessageTextSize,
|
|
1625
1624
|
textWeight: errorMessageTextWeight,
|
|
1626
1625
|
textColor: errorMessageTextColor,
|
|
1627
1626
|
id: name + "-error"
|
|
1628
|
-
}, error)
|
|
1629
|
-
className: "
|
|
1630
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
1631
|
-
className: "form-field__message-item form-field__message-item_type_message",
|
|
1627
|
+
}, error), Boolean(message) && !showError && /*#__PURE__*/React.createElement(Text, {
|
|
1628
|
+
className: "form__group-message",
|
|
1632
1629
|
size: messageTextSize,
|
|
1633
1630
|
textWeight: messageTextWeight,
|
|
1634
1631
|
textColor: messageTextColor
|
|
1635
|
-
}, message))
|
|
1632
|
+
}, message));
|
|
1636
1633
|
});
|
|
1637
1634
|
});
|
|
1638
1635
|
Group.defaultProps = {
|
|
@@ -1640,7 +1637,9 @@ Group.defaultProps = {
|
|
|
1640
1637
|
fieldProps: {},
|
|
1641
1638
|
type: 'normal',
|
|
1642
1639
|
errorMessageTextSize: 's',
|
|
1643
|
-
errorMessageTextColor: '
|
|
1640
|
+
errorMessageTextColor: 'errorTextPrimary',
|
|
1641
|
+
messageTextSize: 's',
|
|
1642
|
+
messageTextColor: 'surfaceTextTertiary'
|
|
1644
1643
|
};
|
|
1645
1644
|
Group.propTypes = {
|
|
1646
1645
|
name: PropTypes.string.isRequired,
|
|
@@ -2565,10 +2564,12 @@ var FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
|
2565
2564
|
textColor: descriptionTextColor,
|
|
2566
2565
|
textWeight: descriptionTextWeight
|
|
2567
2566
|
}, description), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React.createElement("div", {
|
|
2568
|
-
className: clsx('notification', 'form-notification', notificationType
|
|
2567
|
+
className: clsx('notification', 'form-notification', notificationType ? "form-notification_type_" + notificationType : 'form-notification_type_global')
|
|
2569
2568
|
}, /*#__PURE__*/React.createElement(NotificationItem, {
|
|
2570
2569
|
className: "form-notification__item",
|
|
2571
|
-
|
|
2570
|
+
titleTextSize: "h6",
|
|
2571
|
+
title: form.getState().submitError,
|
|
2572
|
+
set: "form",
|
|
2572
2573
|
status: "error"
|
|
2573
2574
|
})), onChangeFormValues && /*#__PURE__*/React.createElement(FormSpy, {
|
|
2574
2575
|
subscription: {
|
package/package.json
CHANGED