@itcase/forms 1.0.20 → 1.0.22
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/Choice/Choice.css +8 -39
- package/dist/css/form/Field/Segmented/Segmented.css +8 -4
- package/dist/css/form/Form/Form.css +3 -0
- package/dist/css/form/Form/css/form-notification/form-notification.css +3 -0
- package/dist/itcase-forms.cjs.js +14 -11
- package/dist/itcase-forms.esm.js +14 -11
- package/package.json +14 -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,44 +1,13 @@
|
|
|
1
|
-
.form-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
flex-flow: row wrap;
|
|
6
|
-
gap: 16px;
|
|
7
|
-
}
|
|
8
|
-
&__item {
|
|
9
|
-
background: var(--color-surface-primary);
|
|
10
|
-
padding: 3px 12px;
|
|
11
|
-
border: solid 1px var(--color-surface-border-secondary);
|
|
12
|
-
border-radius: 4px;
|
|
13
|
-
z-index: 1;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
@mixin easing easeOutQuart, all, 0.2s;
|
|
16
|
-
@mixin h5 300;
|
|
17
|
-
@media (--mobile) {
|
|
18
|
-
padding: 6px 6px;
|
|
19
|
-
}
|
|
20
|
-
&:hover {
|
|
21
|
-
background: var(--color-surface-secondary-hover);
|
|
22
|
-
}
|
|
23
|
-
&:focus {
|
|
24
|
-
background: var(--color-surface-secondary-hover);
|
|
25
|
-
}
|
|
26
|
-
&&_state_active {
|
|
27
|
-
color: var(--color-accent-text-primary);
|
|
28
|
-
background: var(--color-accent);
|
|
29
|
-
border: solid 1px var(--color-surface-border-accent);
|
|
30
|
-
&:hover {
|
|
31
|
-
color: var(--color-accent-text-primary);
|
|
32
|
-
background: var(--color-accent-hover-primary);
|
|
33
|
-
border: solid 1px var(--color-surface-border-accent);
|
|
34
|
-
}
|
|
1
|
+
.form-choice {
|
|
2
|
+
&&_state {
|
|
3
|
+
&_success {
|
|
4
|
+
border: solid 1px var(--color-success-border-primary);
|
|
35
5
|
}
|
|
36
|
-
|
|
37
|
-
&&_state_error {
|
|
38
|
-
^&__item {
|
|
6
|
+
&_error {
|
|
39
7
|
border: solid 1px var(--color-error-border-primary);
|
|
40
8
|
}
|
|
41
|
-
|
|
42
|
-
|
|
9
|
+
&_focus {
|
|
10
|
+
/* border: solid 1px var(--color-error-border-primary); */
|
|
11
|
+
}
|
|
43
12
|
}
|
|
44
13
|
}
|
|
@@ -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
|
}
|
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;
|
|
@@ -795,10 +796,10 @@ CheckboxField.propTypes = {
|
|
|
795
796
|
};
|
|
796
797
|
|
|
797
798
|
var ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceField(props) {
|
|
798
|
-
var options = props.options
|
|
799
|
-
props.
|
|
800
|
-
props.
|
|
801
|
-
|
|
799
|
+
var options = props.options,
|
|
800
|
+
classNameGroupItem = props.classNameGroupItem,
|
|
801
|
+
fieldProps = props.fieldProps,
|
|
802
|
+
inputProps = props.inputProps,
|
|
802
803
|
isMultiple = props.isMultiple,
|
|
803
804
|
isRequired = props.isRequired,
|
|
804
805
|
label = props.label,
|
|
@@ -813,8 +814,8 @@ var ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceField(
|
|
|
813
814
|
}, function (_ref) {
|
|
814
815
|
var input = _ref.input,
|
|
815
816
|
meta = _ref.meta;
|
|
816
|
-
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, {
|
|
817
|
-
className: clsx__default.default('form-
|
|
817
|
+
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
818
|
+
className: clsx__default.default('form-field_type_choice', 'form__item_type_choice', classNameGroupItem),
|
|
818
819
|
inputName: input.name,
|
|
819
820
|
inputValue: input.value || [],
|
|
820
821
|
isRequired: isRequired,
|
|
@@ -828,7 +829,7 @@ var ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceField(
|
|
|
828
829
|
metaTouched: meta.touched,
|
|
829
830
|
metaValid: meta.valid,
|
|
830
831
|
hideMessage: hideMessage
|
|
831
|
-
}, /*#__PURE__*/React__default.default.createElement(Choice.Choice, {
|
|
832
|
+
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Choice.Choice, Object.assign({
|
|
832
833
|
options: options,
|
|
833
834
|
inputName: input.name,
|
|
834
835
|
inputValue: input.value || [],
|
|
@@ -836,7 +837,7 @@ var ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceField(
|
|
|
836
837
|
isRequired: isRequired,
|
|
837
838
|
placeholder: placeholder,
|
|
838
839
|
onChange: change
|
|
839
|
-
}));
|
|
840
|
+
}, inputProps)));
|
|
840
841
|
});
|
|
841
842
|
});
|
|
842
843
|
ChoiceField.propTypes = {
|
|
@@ -2573,10 +2574,12 @@ var FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalFor
|
|
|
2573
2574
|
textColor: descriptionTextColor,
|
|
2574
2575
|
textWeight: descriptionTextWeight
|
|
2575
2576
|
}, description), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React__default.default.createElement("div", {
|
|
2576
|
-
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')
|
|
2577
2578
|
}, /*#__PURE__*/React__default.default.createElement(Notification.NotificationItem, {
|
|
2578
2579
|
className: "form-notification__item",
|
|
2579
|
-
|
|
2580
|
+
titleTextSize: "h6",
|
|
2581
|
+
title: form.getState().submitError,
|
|
2582
|
+
set: "form",
|
|
2580
2583
|
status: "error"
|
|
2581
2584
|
})), onChangeFormValues && /*#__PURE__*/React__default.default.createElement(reactFinalForm.FormSpy, {
|
|
2582
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;
|
|
@@ -785,10 +786,10 @@ CheckboxField.propTypes = {
|
|
|
785
786
|
};
|
|
786
787
|
|
|
787
788
|
var ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
788
|
-
var options = props.options
|
|
789
|
-
props.
|
|
790
|
-
props.
|
|
791
|
-
|
|
789
|
+
var options = props.options,
|
|
790
|
+
classNameGroupItem = props.classNameGroupItem,
|
|
791
|
+
fieldProps = props.fieldProps,
|
|
792
|
+
inputProps = props.inputProps,
|
|
792
793
|
isMultiple = props.isMultiple,
|
|
793
794
|
isRequired = props.isRequired,
|
|
794
795
|
label = props.label,
|
|
@@ -803,8 +804,8 @@ var ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
|
803
804
|
}, function (_ref) {
|
|
804
805
|
var input = _ref.input,
|
|
805
806
|
meta = _ref.meta;
|
|
806
|
-
return /*#__PURE__*/React.createElement(FieldWrapper, {
|
|
807
|
-
className: clsx('form-
|
|
807
|
+
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
808
|
+
className: clsx('form-field_type_choice', 'form__item_type_choice', classNameGroupItem),
|
|
808
809
|
inputName: input.name,
|
|
809
810
|
inputValue: input.value || [],
|
|
810
811
|
isRequired: isRequired,
|
|
@@ -818,7 +819,7 @@ var ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
|
818
819
|
metaTouched: meta.touched,
|
|
819
820
|
metaValid: meta.valid,
|
|
820
821
|
hideMessage: hideMessage
|
|
821
|
-
}, /*#__PURE__*/React.createElement(Choice, {
|
|
822
|
+
}, fieldProps), /*#__PURE__*/React.createElement(Choice, Object.assign({
|
|
822
823
|
options: options,
|
|
823
824
|
inputName: input.name,
|
|
824
825
|
inputValue: input.value || [],
|
|
@@ -826,7 +827,7 @@ var ChoiceField = /*#__PURE__*/React.memo(function ChoiceField(props) {
|
|
|
826
827
|
isRequired: isRequired,
|
|
827
828
|
placeholder: placeholder,
|
|
828
829
|
onChange: change
|
|
829
|
-
}));
|
|
830
|
+
}, inputProps)));
|
|
830
831
|
});
|
|
831
832
|
});
|
|
832
833
|
ChoiceField.propTypes = {
|
|
@@ -2563,10 +2564,12 @@ var FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
|
|
|
2563
2564
|
textColor: descriptionTextColor,
|
|
2564
2565
|
textWeight: descriptionTextWeight
|
|
2565
2566
|
}, description), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React.createElement("div", {
|
|
2566
|
-
className: clsx('notification', 'form-notification', notificationType
|
|
2567
|
+
className: clsx('notification', 'form-notification', notificationType ? "form-notification_type_" + notificationType : 'form-notification_type_global')
|
|
2567
2568
|
}, /*#__PURE__*/React.createElement(NotificationItem, {
|
|
2568
2569
|
className: "form-notification__item",
|
|
2569
|
-
|
|
2570
|
+
titleTextSize: "h6",
|
|
2571
|
+
title: form.getState().submitError,
|
|
2572
|
+
set: "form",
|
|
2570
2573
|
status: "error"
|
|
2571
2574
|
})), onChangeFormValues && /*#__PURE__*/React.createElement(FormSpy, {
|
|
2572
2575
|
subscription: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/forms",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "Forms fields, inputs, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"forms",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@itcase/common": "^1.1.6",
|
|
38
|
-
"@itcase/ui": "^1.0.
|
|
38
|
+
"@itcase/ui": "^1.0.46",
|
|
39
39
|
"axios": "^1.5.0",
|
|
40
40
|
"clsx": "^2.0.0",
|
|
41
41
|
"date-fns": "2.0.0-alpha.7",
|
|
42
42
|
"final-form": "^4.20.10",
|
|
43
43
|
"final-form-focus": "^1.1.2",
|
|
44
|
-
"libphonenumber-js": "^1.10.
|
|
44
|
+
"libphonenumber-js": "^1.10.44",
|
|
45
45
|
"lodash": "^4.17.21",
|
|
46
|
-
"luxon": "^3.4.
|
|
46
|
+
"luxon": "^3.4.3",
|
|
47
47
|
"prop-types": "^15.8.1",
|
|
48
48
|
"react": "^18.2.0",
|
|
49
49
|
"react-date-range": "^1.4.0",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"react-select": "^5.7.4"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/core": "^7.22.
|
|
57
|
-
"@babel/eslint-parser": "^7.22.
|
|
58
|
-
"@babel/preset-env": "^7.22.
|
|
59
|
-
"@babel/preset-react": "^7.22.
|
|
56
|
+
"@babel/core": "^7.22.17",
|
|
57
|
+
"@babel/eslint-parser": "^7.22.15",
|
|
58
|
+
"@babel/preset-env": "^7.22.15",
|
|
59
|
+
"@babel/preset-react": "^7.22.15",
|
|
60
60
|
"@commitlint/cli": "^17.7.1",
|
|
61
61
|
"@commitlint/config-conventional": "^17.7.0",
|
|
62
62
|
"@rollup/plugin-babel": "^6.0.3",
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
"@semantic-release/git": "^10.0.1",
|
|
68
68
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
69
69
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
70
|
-
"eslint": "8.
|
|
70
|
+
"eslint": "8.49.0",
|
|
71
71
|
"eslint-config-prettier": "^9.0.0",
|
|
72
72
|
"eslint-config-standard": "^17.1.0",
|
|
73
73
|
"eslint-plugin-import": "^2.28.1",
|
|
74
|
-
"eslint-plugin-n": "^16.0
|
|
74
|
+
"eslint-plugin-n": "^16.1.0",
|
|
75
75
|
"eslint-plugin-prettier": "^5.0.0",
|
|
76
76
|
"eslint-plugin-promise": "^6.1.1",
|
|
77
77
|
"eslint-plugin-react": "^7.33.2",
|
|
78
78
|
"eslint-plugin-standard": "^5.0.0",
|
|
79
79
|
"husky": "^8.0.3",
|
|
80
|
-
"npm": "^
|
|
80
|
+
"npm": "^10.1.0",
|
|
81
81
|
"postcss-aspect-ratio-polyfill": "^2.0.0",
|
|
82
82
|
"postcss-cli": "^10.1.0",
|
|
83
83
|
"postcss-combine-duplicated-selectors": "^10.0.3",
|
|
@@ -95,13 +95,13 @@
|
|
|
95
95
|
"postcss-nested-ancestors": "^3.0.0",
|
|
96
96
|
"postcss-normalize": "^10.0.1",
|
|
97
97
|
"postcss-prepend-imports": "^1.0.1",
|
|
98
|
-
"postcss-preset-env": "^9.1.
|
|
98
|
+
"postcss-preset-env": "^9.1.3",
|
|
99
99
|
"postcss-pxtorem": "^6.0.0",
|
|
100
100
|
"postcss-responsive-type": "github:ITCase/postcss-responsive-type",
|
|
101
101
|
"postcss-sort-media-queries": "^5.2.0",
|
|
102
102
|
"prettier": "^3.0.3",
|
|
103
|
-
"react-datepicker": "^4.
|
|
104
|
-
"rollup": "^3.
|
|
103
|
+
"react-datepicker": "^4.17.0",
|
|
104
|
+
"rollup": "^3.29.1",
|
|
105
105
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
106
106
|
"semantic-release": "^21.1.1",
|
|
107
107
|
"stylelint": "^15.10.3",
|