@itcase/forms 1.1.19 → 1.1.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.
|
@@ -6,11 +6,10 @@
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
&__message {
|
|
9
|
-
padding: 4px 0 0 0;
|
|
10
9
|
&-item {
|
|
11
10
|
height: var(--form-field-helptext-height);
|
|
12
11
|
line-height: var(--form-field-helptext-line-height);
|
|
13
|
-
padding: var(--form-field-helptext-padding
|
|
12
|
+
padding: var(--form-field-helptext-padding);
|
|
14
13
|
display: block;
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -75,16 +74,16 @@
|
|
|
75
74
|
&_type {
|
|
76
75
|
&_normal {
|
|
77
76
|
position: relative;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
@each $size in xl, l, m, s {
|
|
78
|
+
&.form-field_size_$(size) {
|
|
79
|
+
gap: var(--form-field_type_normal_$(size)-gap);
|
|
80
|
+
padding: var(--form-field_type_normal_$(size)-padding);
|
|
81
|
+
margin: var(--form-field_type_normal_$(size)-margin);
|
|
82
|
+
^^^&__label {
|
|
83
|
+
padding: var(--form-field_type_normal_$(size)-label-padding);
|
|
84
|
+
}
|
|
85
|
+
^^^&__message {
|
|
86
|
+
padding: var(--form-field_type_normal_$(size)-message-padding);
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
89
|
}
|
|
@@ -94,10 +93,10 @@
|
|
|
94
93
|
.form-field {
|
|
95
94
|
&_type {
|
|
96
95
|
&_classic {
|
|
97
|
-
position: relative;
|
|
98
|
-
gap: var(--form-field_type_normal-gap, 4px);
|
|
99
|
-
margin: var(--form-field_type_normal-margin);
|
|
100
96
|
padding: var(--form-field_type_normal-padding);
|
|
97
|
+
margin: var(--form-field_type_normal-margin);
|
|
98
|
+
position: relative;
|
|
99
|
+
gap: var(--form-field_type_normal-gap);
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
}
|
|
@@ -163,3 +162,9 @@
|
|
|
163
162
|
}
|
|
164
163
|
}
|
|
165
164
|
}
|
|
165
|
+
:root {
|
|
166
|
+
--form-field_type_normal_m-gap: 0.5m;
|
|
167
|
+
--form-field_type_normal_m-padding: 1.5m 0;
|
|
168
|
+
--form-field_type_normal_m-label-padding: 0 0.5m;
|
|
169
|
+
--form-field_type_normal_m-message-padding: 0 1.5m;
|
|
170
|
+
}
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -23,7 +23,6 @@ var castArray = require('lodash/castArray');
|
|
|
23
23
|
var reactDropzone = require('react-dropzone');
|
|
24
24
|
var common = require('@itcase/common');
|
|
25
25
|
var Button = require('@itcase/ui/components/Button');
|
|
26
|
-
var Group$1 = require('@itcase/ui/components/Group');
|
|
27
26
|
var Loader = require('@itcase/ui/components/Loader');
|
|
28
27
|
var Title = require('@itcase/ui/components/Title');
|
|
29
28
|
var Input = require('@itcase/ui/components/Input');
|
|
@@ -34,6 +33,7 @@ var Switch = require('@itcase/ui/components/Switch');
|
|
|
34
33
|
var Textarea = require('@itcase/ui/components/Textarea');
|
|
35
34
|
var reactImask = require('react-imask');
|
|
36
35
|
var Chips = require('@itcase/ui/components/Chips');
|
|
36
|
+
var Group$1 = require('@itcase/ui/components/Group');
|
|
37
37
|
var Notification = require('@itcase/ui/components/Notification');
|
|
38
38
|
var createDecorator = require('final-form-focus');
|
|
39
39
|
|
|
@@ -130,15 +130,16 @@ function useYupValidationSchema(schema, language) {
|
|
|
130
130
|
const defaultFieldProps = {
|
|
131
131
|
width: 'fill',
|
|
132
132
|
direction: 'vertical',
|
|
133
|
+
size: 'm',
|
|
133
134
|
labelTextColor: 'surfaceTextPrimary',
|
|
134
|
-
labelTextSize: '
|
|
135
|
+
labelTextSize: 's',
|
|
136
|
+
messageTextColor: 'surfaceTextSecondary',
|
|
137
|
+
messageTextSize: 's',
|
|
135
138
|
errorMessageTextColor: 'errorTextSecondary',
|
|
136
139
|
errorMessageTextSize: 's',
|
|
137
140
|
dividerFill: 'errorPrimary',
|
|
138
141
|
helpTextColor: 'surfaceTextQuaternary',
|
|
139
142
|
helpTextSize: 's',
|
|
140
|
-
messageTextColor: 'surfaceTextSecondary',
|
|
141
|
-
messageTextSize: 's',
|
|
142
143
|
requiredMessageTextColor: 'warningTextSecondary',
|
|
143
144
|
requiredMessageTextSize: 's',
|
|
144
145
|
showMessage: true
|
|
@@ -870,8 +871,10 @@ const defaultDropzoneProps = {
|
|
|
870
871
|
hintTitle: 'Перетащите изображение или выберите файл с компьютера',
|
|
871
872
|
hintTitleTextColor: 'surfaceTextPrimary',
|
|
872
873
|
hintTitleTextSize: 'm',
|
|
873
|
-
|
|
874
|
-
|
|
874
|
+
removeThumbText: 'удалить',
|
|
875
|
+
removeThumbTextColor: 'errorTextPrimary',
|
|
876
|
+
removeThumbTextHoverColor: 'errorTextPrimaryHover',
|
|
877
|
+
removeThumbTextSize: 's',
|
|
875
878
|
shape: 'rounded',
|
|
876
879
|
showFilename: true,
|
|
877
880
|
thumbBorderColor: 'surfaceBorderTertiary',
|
|
@@ -1070,7 +1073,7 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
|
|
|
1070
1073
|
}), /*#__PURE__*/React__default.default.createElement("input", Object.assign({}, getInputProps(), {
|
|
1071
1074
|
name: inputName
|
|
1072
1075
|
})), /*#__PURE__*/React__default.default.createElement("div", {
|
|
1073
|
-
className: clsx__default.default('form-dropzone__dropzone-wrapper', thumbColumn && `form-dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass
|
|
1076
|
+
className: clsx__default.default('form-dropzone__dropzone-wrapper', thumbColumn && `form-dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass, fillHoverClass, borderWidthClass, borderColorClass, borderColorHoverClass, borderTypeClass)
|
|
1074
1077
|
}, filesList.map((file, index) => /*#__PURE__*/React__default.default.createElement("aside", {
|
|
1075
1078
|
className: clsx__default.default('form-dropzone__thumb', fillClass, thumbDirectionClass, thumbBorderWidthClass, thumbBorderColorClass, thumbBorderColorHoverClass, thumbBorderTypeClass),
|
|
1076
1079
|
key: file.id || `${file.name}_${index}`
|
|
@@ -2384,7 +2387,11 @@ function ChipsField(props) {
|
|
|
2384
2387
|
showMessage: showMessage,
|
|
2385
2388
|
isRequired: isRequired,
|
|
2386
2389
|
isValidState: isValidState
|
|
2387
|
-
}, fieldProps), options.length ?
|
|
2390
|
+
}, fieldProps), options.length ? /*#__PURE__*/React__default.default.createElement(Chips.ChipsGroup, {
|
|
2391
|
+
direction: "horizontal",
|
|
2392
|
+
gap: "1m",
|
|
2393
|
+
wrap: "wrap"
|
|
2394
|
+
}, options.map(option => /*#__PURE__*/React__default.default.createElement(Chips.Chips, Object.assign({
|
|
2388
2395
|
className: clsx__default.default(meta.active && 'form-chips_state_focus', meta.error && meta.touched && `form-chips_state_${errorKey}`),
|
|
2389
2396
|
key: option.value,
|
|
2390
2397
|
label: option.label,
|
|
@@ -2392,7 +2399,7 @@ function ChipsField(props) {
|
|
|
2392
2399
|
value: option.value,
|
|
2393
2400
|
isActive: activeOptionsList.some(activeOption => activeOption.value === option.value),
|
|
2394
2401
|
onClick: () => onChangeSomeInput(input.value, option.value)
|
|
2395
|
-
}, updatedInputProps))) : /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
2402
|
+
}, updatedInputProps)))) : /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
2396
2403
|
size: emptyMessageTextSize,
|
|
2397
2404
|
textColor: emptyMessageTextColor
|
|
2398
2405
|
}, emptyMessage));
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -22,7 +22,6 @@ import castArray from 'lodash/castArray';
|
|
|
22
22
|
import { useDropzone, ErrorCode } from 'react-dropzone';
|
|
23
23
|
import { createFileFromDataURL } from '@itcase/common';
|
|
24
24
|
import { Button } from '@itcase/ui/components/Button';
|
|
25
|
-
import { Group as Group$1 } from '@itcase/ui/components/Group';
|
|
26
25
|
import { Loader } from '@itcase/ui/components/Loader';
|
|
27
26
|
import { Title } from '@itcase/ui/components/Title';
|
|
28
27
|
import { Input } from '@itcase/ui/components/Input';
|
|
@@ -32,7 +31,8 @@ import { Select } from '@itcase/ui/components/Select';
|
|
|
32
31
|
import { Switch } from '@itcase/ui/components/Switch';
|
|
33
32
|
import { Textarea } from '@itcase/ui/components/Textarea';
|
|
34
33
|
import { useIMask } from 'react-imask';
|
|
35
|
-
import { Chips } from '@itcase/ui/components/Chips';
|
|
34
|
+
import { ChipsGroup, Chips } from '@itcase/ui/components/Chips';
|
|
35
|
+
import { Group as Group$1 } from '@itcase/ui/components/Group';
|
|
36
36
|
import { Notification } from '@itcase/ui/components/Notification';
|
|
37
37
|
import createDecorator from 'final-form-focus';
|
|
38
38
|
|
|
@@ -119,15 +119,16 @@ function useYupValidationSchema(schema, language) {
|
|
|
119
119
|
const defaultFieldProps = {
|
|
120
120
|
width: 'fill',
|
|
121
121
|
direction: 'vertical',
|
|
122
|
+
size: 'm',
|
|
122
123
|
labelTextColor: 'surfaceTextPrimary',
|
|
123
|
-
labelTextSize: '
|
|
124
|
+
labelTextSize: 's',
|
|
125
|
+
messageTextColor: 'surfaceTextSecondary',
|
|
126
|
+
messageTextSize: 's',
|
|
124
127
|
errorMessageTextColor: 'errorTextSecondary',
|
|
125
128
|
errorMessageTextSize: 's',
|
|
126
129
|
dividerFill: 'errorPrimary',
|
|
127
130
|
helpTextColor: 'surfaceTextQuaternary',
|
|
128
131
|
helpTextSize: 's',
|
|
129
|
-
messageTextColor: 'surfaceTextSecondary',
|
|
130
|
-
messageTextSize: 's',
|
|
131
132
|
requiredMessageTextColor: 'warningTextSecondary',
|
|
132
133
|
requiredMessageTextSize: 's',
|
|
133
134
|
showMessage: true
|
|
@@ -859,8 +860,10 @@ const defaultDropzoneProps = {
|
|
|
859
860
|
hintTitle: 'Перетащите изображение или выберите файл с компьютера',
|
|
860
861
|
hintTitleTextColor: 'surfaceTextPrimary',
|
|
861
862
|
hintTitleTextSize: 'm',
|
|
862
|
-
|
|
863
|
-
|
|
863
|
+
removeThumbText: 'удалить',
|
|
864
|
+
removeThumbTextColor: 'errorTextPrimary',
|
|
865
|
+
removeThumbTextHoverColor: 'errorTextPrimaryHover',
|
|
866
|
+
removeThumbTextSize: 's',
|
|
864
867
|
shape: 'rounded',
|
|
865
868
|
showFilename: true,
|
|
866
869
|
thumbBorderColor: 'surfaceBorderTertiary',
|
|
@@ -1059,7 +1062,7 @@ const FileInputDropzone = /*#__PURE__*/React$1.memo(function FileInputDropzone(p
|
|
|
1059
1062
|
}), /*#__PURE__*/React$1.createElement("input", Object.assign({}, getInputProps(), {
|
|
1060
1063
|
name: inputName
|
|
1061
1064
|
})), /*#__PURE__*/React$1.createElement("div", {
|
|
1062
|
-
className: clsx('form-dropzone__dropzone-wrapper', thumbColumn && `form-dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass
|
|
1065
|
+
className: clsx('form-dropzone__dropzone-wrapper', thumbColumn && `form-dropzone__dropzone-wrapper_column_${thumbColumn}`, fillClass, fillHoverClass, borderWidthClass, borderColorClass, borderColorHoverClass, borderTypeClass)
|
|
1063
1066
|
}, filesList.map((file, index) => /*#__PURE__*/React$1.createElement("aside", {
|
|
1064
1067
|
className: clsx('form-dropzone__thumb', fillClass, thumbDirectionClass, thumbBorderWidthClass, thumbBorderColorClass, thumbBorderColorHoverClass, thumbBorderTypeClass),
|
|
1065
1068
|
key: file.id || `${file.name}_${index}`
|
|
@@ -2373,7 +2376,11 @@ function ChipsField(props) {
|
|
|
2373
2376
|
showMessage: showMessage,
|
|
2374
2377
|
isRequired: isRequired,
|
|
2375
2378
|
isValidState: isValidState
|
|
2376
|
-
}, fieldProps), options.length ?
|
|
2379
|
+
}, fieldProps), options.length ? /*#__PURE__*/React$1.createElement(ChipsGroup, {
|
|
2380
|
+
direction: "horizontal",
|
|
2381
|
+
gap: "1m",
|
|
2382
|
+
wrap: "wrap"
|
|
2383
|
+
}, options.map(option => /*#__PURE__*/React$1.createElement(Chips, Object.assign({
|
|
2377
2384
|
className: clsx(meta.active && 'form-chips_state_focus', meta.error && meta.touched && `form-chips_state_${errorKey}`),
|
|
2378
2385
|
key: option.value,
|
|
2379
2386
|
label: option.label,
|
|
@@ -2381,7 +2388,7 @@ function ChipsField(props) {
|
|
|
2381
2388
|
value: option.value,
|
|
2382
2389
|
isActive: activeOptionsList.some(activeOption => activeOption.value === option.value),
|
|
2383
2390
|
onClick: () => onChangeSomeInput(input.value, option.value)
|
|
2384
|
-
}, updatedInputProps))) : /*#__PURE__*/React$1.createElement(Text, {
|
|
2391
|
+
}, updatedInputProps)))) : /*#__PURE__*/React$1.createElement(Text, {
|
|
2385
2392
|
size: emptyMessageTextSize,
|
|
2386
2393
|
textColor: emptyMessageTextColor
|
|
2387
2394
|
}, emptyMessage));
|