@itcase/forms 1.1.36 → 1.1.37
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
outline: 0;
|
|
8
8
|
@mixin easing easeOutQuart, all, 0.2s;
|
|
9
9
|
&_size {
|
|
10
|
-
@each $size in
|
|
10
|
+
@each $size in xl, l, m, s {
|
|
11
11
|
&_$(size) {
|
|
12
12
|
^^&-wrapper {
|
|
13
13
|
padding: var(--fileinput-size-$(size)-padding);
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
display: grid;
|
|
20
20
|
gap: 16px;
|
|
21
21
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
22
|
+
transition: var(--fileinput-transition);
|
|
22
23
|
}
|
|
23
24
|
^&__hint {
|
|
24
25
|
width: 100%;
|
|
@@ -91,10 +92,10 @@
|
|
|
91
92
|
}
|
|
92
93
|
&-name {
|
|
93
94
|
width: 100%;
|
|
95
|
+
white-space: wrap;
|
|
94
96
|
padding: 12px 0 0 0;
|
|
95
|
-
grid-column-start: 2;
|
|
96
97
|
align-self: flex-start;
|
|
97
|
-
|
|
98
|
+
grid-column-start: 2;
|
|
98
99
|
&-inner {
|
|
99
100
|
display: inline-block;
|
|
100
101
|
@mixin word-wrap;
|
|
@@ -116,7 +117,7 @@
|
|
|
116
117
|
.form-dropzone {
|
|
117
118
|
&_shape {
|
|
118
119
|
&_rounded {
|
|
119
|
-
@each $size in
|
|
120
|
+
@each $size in xl, l, m, s {
|
|
120
121
|
&.form-dropzone__dropzone_size_$(size) {
|
|
121
122
|
& .form-dropzone__dropzone-wrapper {
|
|
122
123
|
border-radius: var(--fileinput-size-$(size)-shape-rounded);
|
|
@@ -155,4 +156,5 @@
|
|
|
155
156
|
:root {
|
|
156
157
|
--fileinput-size-normal-padding: 16px 16px;
|
|
157
158
|
--fileinput-size-normal-shape-rounded: 6px;
|
|
159
|
+
--fileinput-transition: all 0.2s ease 0s;
|
|
158
160
|
}
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -132,8 +132,8 @@ function useYupValidationSchema(schema, language) {
|
|
|
132
132
|
function useFieldValidationState(props) {
|
|
133
133
|
const {
|
|
134
134
|
fieldProps = {},
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
input = {},
|
|
136
|
+
meta = {}
|
|
137
137
|
} = props;
|
|
138
138
|
// Determines if there's a submission error that hasn't been rectified since the last submission.
|
|
139
139
|
const submitError = !meta.modifiedSinceLastSubmit && meta.submitError;
|
|
@@ -179,10 +179,10 @@ function useFieldValidationState(props) {
|
|
|
179
179
|
}, [meta.error, submitError]);
|
|
180
180
|
return {
|
|
181
181
|
errorKey,
|
|
182
|
-
|
|
182
|
+
errorMessage,
|
|
183
183
|
isErrorState,
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
successKey,
|
|
185
|
+
isValidState
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -371,13 +371,13 @@ function FieldWrapperBase(props) {
|
|
|
371
371
|
const errorTextColor = props[`${errorKey}MessageTextColor`];
|
|
372
372
|
const errorTextWeight = props[`${errorKey}MessageTextWeight`];
|
|
373
373
|
return /*#__PURE__*/React__default.default.createElement(Tag, {
|
|
374
|
-
dataTestId: `${inputName}Field`,
|
|
375
|
-
dataTour: dataTour,
|
|
376
374
|
className: clsx__default.default(formFieldClass, 'form__item', 'form-field', type && `form-field_type_${type}`, sizeClass, fillClass, shapeClass, isDisabled && `form-field_state_disabled`, isHidden && `form-field_state_hidden`, directionClass, widthClass),
|
|
375
|
+
"data-test-id": `${inputName}Field`,
|
|
376
|
+
"data-tour": dataTour,
|
|
377
377
|
style: formFieldStyles
|
|
378
378
|
}, before, (label || labelHidden) && /*#__PURE__*/React__default.default.createElement("div", {
|
|
379
|
-
dataTestId: `${inputName}FieldLabel`,
|
|
380
379
|
className: clsx__default.default('form-field__label'),
|
|
380
|
+
"data-test-id": `${inputName}FieldLabel`,
|
|
381
381
|
htmlFor: id
|
|
382
382
|
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
383
383
|
size: labelTextSize,
|
|
@@ -386,8 +386,8 @@ function FieldWrapperBase(props) {
|
|
|
386
386
|
sizeMobile: labelTextSizeMobile,
|
|
387
387
|
sizeTablet: labelTextSizeTablet
|
|
388
388
|
}, label, labelHidden && '\u00A0')), desc && /*#__PURE__*/React__default.default.createElement("div", {
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
className: "form-field__desc",
|
|
390
|
+
"data-test-id": `${inputName}FieldDesc`
|
|
391
391
|
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
392
392
|
size: descTextSize,
|
|
393
393
|
textColor: descTextColor,
|
|
@@ -403,8 +403,8 @@ function FieldWrapperBase(props) {
|
|
|
403
403
|
size: dividerSize,
|
|
404
404
|
fill: dividerFill
|
|
405
405
|
})), showMessage && /*#__PURE__*/React__default.default.createElement("div", {
|
|
406
|
-
|
|
407
|
-
|
|
406
|
+
className: "form-field__message",
|
|
407
|
+
"data-test-id": `${inputName}FieldMessage`
|
|
408
408
|
}, isErrorState && errorMessage && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
409
409
|
id: `${inputName}-error`,
|
|
410
410
|
dataTestId: `${inputName}FieldMessageError`,
|
|
@@ -443,8 +443,9 @@ function FieldWrapper(props) {
|
|
|
443
443
|
|
|
444
444
|
const defaultDropzoneProps = {
|
|
445
445
|
fill: 'surfaceSecondary',
|
|
446
|
-
|
|
447
|
-
|
|
446
|
+
fillHover: 'surfaceTertiary',
|
|
447
|
+
// borderColor: 'surfaceBorderTertiary',
|
|
448
|
+
// borderColorHover: 'surfaceBorderQuaternary',
|
|
448
449
|
hintTitle: 'Перетащите изображение или выберите файл с компьютера',
|
|
449
450
|
hintTitleTextColor: 'surfaceTextPrimary',
|
|
450
451
|
hintTitleTextSize: 'm',
|
|
@@ -1686,6 +1687,8 @@ const FormFieldInput = /*#__PURE__*/React__default.default.memo(function FormFie
|
|
|
1686
1687
|
inputProps: inputProps,
|
|
1687
1688
|
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1688
1689
|
});
|
|
1690
|
+
console.log('updatedInputProps');
|
|
1691
|
+
console.log(updatedInputProps);
|
|
1689
1692
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1690
1693
|
className: clsx__default.default('form-field_input', 'form__item_input', classNameGroupItem),
|
|
1691
1694
|
errorKey: errorKey,
|
|
@@ -1834,7 +1837,7 @@ const defaultSegmentedProps = {
|
|
|
1834
1837
|
// Error
|
|
1835
1838
|
errorAppearance: 'errorPrimary sizeM solid rounded',
|
|
1836
1839
|
// Required
|
|
1837
|
-
requiredAppearance: '
|
|
1840
|
+
requiredAppearance: 'warningPrimary sizeM solid rounded'
|
|
1838
1841
|
};
|
|
1839
1842
|
|
|
1840
1843
|
function FormFieldSegmented(props) {
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -121,8 +121,8 @@ function useYupValidationSchema(schema, language) {
|
|
|
121
121
|
function useFieldValidationState(props) {
|
|
122
122
|
const {
|
|
123
123
|
fieldProps = {},
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
input = {},
|
|
125
|
+
meta = {}
|
|
126
126
|
} = props;
|
|
127
127
|
// Determines if there's a submission error that hasn't been rectified since the last submission.
|
|
128
128
|
const submitError = !meta.modifiedSinceLastSubmit && meta.submitError;
|
|
@@ -168,10 +168,10 @@ function useFieldValidationState(props) {
|
|
|
168
168
|
}, [meta.error, submitError]);
|
|
169
169
|
return {
|
|
170
170
|
errorKey,
|
|
171
|
-
|
|
171
|
+
errorMessage,
|
|
172
172
|
isErrorState,
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
successKey,
|
|
174
|
+
isValidState
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -360,13 +360,13 @@ function FieldWrapperBase(props) {
|
|
|
360
360
|
const errorTextColor = props[`${errorKey}MessageTextColor`];
|
|
361
361
|
const errorTextWeight = props[`${errorKey}MessageTextWeight`];
|
|
362
362
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
363
|
-
dataTestId: `${inputName}Field`,
|
|
364
|
-
dataTour: dataTour,
|
|
365
363
|
className: clsx(formFieldClass, 'form__item', 'form-field', type && `form-field_type_${type}`, sizeClass, fillClass, shapeClass, isDisabled && `form-field_state_disabled`, isHidden && `form-field_state_hidden`, directionClass, widthClass),
|
|
364
|
+
"data-test-id": `${inputName}Field`,
|
|
365
|
+
"data-tour": dataTour,
|
|
366
366
|
style: formFieldStyles
|
|
367
367
|
}, before, (label || labelHidden) && /*#__PURE__*/React.createElement("div", {
|
|
368
|
-
dataTestId: `${inputName}FieldLabel`,
|
|
369
368
|
className: clsx('form-field__label'),
|
|
369
|
+
"data-test-id": `${inputName}FieldLabel`,
|
|
370
370
|
htmlFor: id
|
|
371
371
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
372
372
|
size: labelTextSize,
|
|
@@ -375,8 +375,8 @@ function FieldWrapperBase(props) {
|
|
|
375
375
|
sizeMobile: labelTextSizeMobile,
|
|
376
376
|
sizeTablet: labelTextSizeTablet
|
|
377
377
|
}, label, labelHidden && '\u00A0')), desc && /*#__PURE__*/React.createElement("div", {
|
|
378
|
-
|
|
379
|
-
|
|
378
|
+
className: "form-field__desc",
|
|
379
|
+
"data-test-id": `${inputName}FieldDesc`
|
|
380
380
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
381
381
|
size: descTextSize,
|
|
382
382
|
textColor: descTextColor,
|
|
@@ -392,8 +392,8 @@ function FieldWrapperBase(props) {
|
|
|
392
392
|
size: dividerSize,
|
|
393
393
|
fill: dividerFill
|
|
394
394
|
})), showMessage && /*#__PURE__*/React.createElement("div", {
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
className: "form-field__message",
|
|
396
|
+
"data-test-id": `${inputName}FieldMessage`
|
|
397
397
|
}, isErrorState && errorMessage && /*#__PURE__*/React.createElement(Text, {
|
|
398
398
|
id: `${inputName}-error`,
|
|
399
399
|
dataTestId: `${inputName}FieldMessageError`,
|
|
@@ -432,8 +432,9 @@ function FieldWrapper(props) {
|
|
|
432
432
|
|
|
433
433
|
const defaultDropzoneProps = {
|
|
434
434
|
fill: 'surfaceSecondary',
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
fillHover: 'surfaceTertiary',
|
|
436
|
+
// borderColor: 'surfaceBorderTertiary',
|
|
437
|
+
// borderColorHover: 'surfaceBorderQuaternary',
|
|
437
438
|
hintTitle: 'Перетащите изображение или выберите файл с компьютера',
|
|
438
439
|
hintTitleTextColor: 'surfaceTextPrimary',
|
|
439
440
|
hintTitleTextSize: 'm',
|
|
@@ -1675,6 +1676,8 @@ const FormFieldInput = /*#__PURE__*/React.memo(function FormFieldInput(props) {
|
|
|
1675
1676
|
inputProps: inputProps,
|
|
1676
1677
|
validationStateKey: isErrorState ? errorKey : isValidState ? successKey : null
|
|
1677
1678
|
});
|
|
1679
|
+
console.log('updatedInputProps');
|
|
1680
|
+
console.log(updatedInputProps);
|
|
1678
1681
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1679
1682
|
className: clsx('form-field_input', 'form__item_input', classNameGroupItem),
|
|
1680
1683
|
errorKey: errorKey,
|
|
@@ -1823,7 +1826,7 @@ const defaultSegmentedProps = {
|
|
|
1823
1826
|
// Error
|
|
1824
1827
|
errorAppearance: 'errorPrimary sizeM solid rounded',
|
|
1825
1828
|
// Required
|
|
1826
|
-
requiredAppearance: '
|
|
1829
|
+
requiredAppearance: 'warningPrimary sizeM solid rounded'
|
|
1827
1830
|
};
|
|
1828
1831
|
|
|
1829
1832
|
function FormFieldSegmented(props) {
|