@itcase/forms 1.0.25 → 1.0.27
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.form-dropzone {
|
|
2
|
+
flex-direction: column;
|
|
2
3
|
&__dropzone {
|
|
3
4
|
width: 100%;
|
|
4
5
|
box-shadow: none;
|
|
@@ -6,10 +7,9 @@
|
|
|
6
7
|
outline: 0;
|
|
7
8
|
@mixin easing easeOutQuart, all, 0.2s;
|
|
8
9
|
&-wrapper {
|
|
9
|
-
display:
|
|
10
|
-
gap:
|
|
11
|
-
|
|
12
|
-
flex-flow: row wrap;
|
|
10
|
+
display: grid;
|
|
11
|
+
gap: 16px;
|
|
12
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
13
13
|
}
|
|
14
14
|
&_size {
|
|
15
15
|
@each $size in normal, compact {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
align-content: center;
|
|
30
30
|
align-items: center;
|
|
31
31
|
cursor: pointer;
|
|
32
|
+
grid-column: span 3;
|
|
32
33
|
&-title {
|
|
33
34
|
padding: 0 0 8px 0;
|
|
34
35
|
margin: 0;
|
|
@@ -48,13 +49,20 @@
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
&__thumb {
|
|
51
|
-
flex: 30%;
|
|
52
52
|
display: grid;
|
|
53
53
|
column-gap: 8px;
|
|
54
54
|
grid-template-columns: min-content 1fr;
|
|
55
55
|
grid-template-rows: auto 1fr;
|
|
56
|
-
margin: 0 0 16px 0;
|
|
57
56
|
padding: 8px 16px 8px 8px;
|
|
57
|
+
position: relative;
|
|
58
|
+
&-loader {
|
|
59
|
+
position: absolute;
|
|
60
|
+
left: 0;
|
|
61
|
+
top: 0;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
display: flex;
|
|
65
|
+
}
|
|
58
66
|
&-image {
|
|
59
67
|
width: 160px;
|
|
60
68
|
height: 160px;
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -19,6 +19,7 @@ var reactDropzone = require('react-dropzone');
|
|
|
19
19
|
var fileSelector = require('file-selector');
|
|
20
20
|
var castArray = require('lodash/castArray');
|
|
21
21
|
var common = require('@itcase/common');
|
|
22
|
+
var Loader = require('@itcase/ui/components/Loader');
|
|
22
23
|
var Title = require('@itcase/ui/components/Title');
|
|
23
24
|
var Input = require('@itcase/ui/components/Input');
|
|
24
25
|
var Icon = require('@itcase/ui/components/Icon');
|
|
@@ -29,7 +30,6 @@ var Switch = require('@itcase/ui/components/Switch');
|
|
|
29
30
|
var Textarea = require('@itcase/ui/components/Textarea');
|
|
30
31
|
var Button = require('@itcase/ui/components/Button');
|
|
31
32
|
var Group$1 = require('@itcase/ui/components/Group');
|
|
32
|
-
var Loader = require('@itcase/ui/components/Loader');
|
|
33
33
|
var Notification = require('@itcase/ui/components/Notification');
|
|
34
34
|
var createDecorator = require('final-form-focus');
|
|
35
35
|
|
|
@@ -1204,14 +1204,17 @@ var FileInputDropzone = /*#__PURE__*/React__default.default.memo(function FileIn
|
|
|
1204
1204
|
hintDescriptionTextColor = props.hintDescriptionTextColor,
|
|
1205
1205
|
hintDescriptionTextWrap = props.hintDescriptionTextWrap,
|
|
1206
1206
|
hintDescriptionTextWeight = props.hintDescriptionTextWeight,
|
|
1207
|
+
errorMessageTextSize = props.errorMessageTextSize,
|
|
1208
|
+
errorMessageTextWeight = props.errorMessageTextWeight,
|
|
1209
|
+
errorMessageTextColor = props.errorMessageTextColor,
|
|
1207
1210
|
inputValue = props.inputValue,
|
|
1208
1211
|
removeThumbText = props.removeThumbText,
|
|
1209
1212
|
hintTitle = props.hintTitle,
|
|
1210
1213
|
hintDescription = props.hintDescription,
|
|
1211
1214
|
isShowFilename = props.isShowFilename,
|
|
1212
|
-
isPreviews = props.isPreviews
|
|
1213
|
-
|
|
1214
|
-
_props$dropzoneProps = props.dropzoneProps,
|
|
1215
|
+
isPreviews = props.isPreviews;
|
|
1216
|
+
props.loadingText;
|
|
1217
|
+
var _props$dropzoneProps = props.dropzoneProps,
|
|
1215
1218
|
dropzoneProps = _props$dropzoneProps === void 0 ? {} : _props$dropzoneProps;
|
|
1216
1219
|
var onAddFiles = props.onAddFiles,
|
|
1217
1220
|
onDeleteFile = props.onDeleteFile;
|
|
@@ -1371,20 +1374,6 @@ var FileInputDropzone = /*#__PURE__*/React__default.default.memo(function FileIn
|
|
|
1371
1374
|
};
|
|
1372
1375
|
}, []); // eslint-disable-line
|
|
1373
1376
|
|
|
1374
|
-
// prettier-ignore
|
|
1375
|
-
/*
|
|
1376
|
-
const itemClass = useMemo(
|
|
1377
|
-
() => clsx(
|
|
1378
|
-
'form__item',
|
|
1379
|
-
'form__item_type_dropzone',
|
|
1380
|
-
// itemClassName,
|
|
1381
|
-
// metaError || fileError && 'form__item_state_error',
|
|
1382
|
-
files.length && 'form__item_state_success'
|
|
1383
|
-
),
|
|
1384
|
-
[files.length]
|
|
1385
|
-
)
|
|
1386
|
-
*/
|
|
1387
|
-
|
|
1388
1377
|
var fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
1389
1378
|
prefix: 'fill_',
|
|
1390
1379
|
propsKey: 'fill'
|
|
@@ -1457,8 +1446,14 @@ var FileInputDropzone = /*#__PURE__*/React__default.default.memo(function FileIn
|
|
|
1457
1446
|
textWeight: thumbNameTextWeight,
|
|
1458
1447
|
className: "form-dropzone__thumb-name-inner"
|
|
1459
1448
|
}, file.name)), fileIsLoading && /*#__PURE__*/React__default.default.createElement("div", {
|
|
1460
|
-
className: "form-dropzone__thumb-
|
|
1461
|
-
},
|
|
1449
|
+
className: "form-dropzone__thumb-loader"
|
|
1450
|
+
}, /*#__PURE__*/React__default.default.createElement(Loader.Loader, {
|
|
1451
|
+
fill: "surfacePrimary",
|
|
1452
|
+
height: "fill",
|
|
1453
|
+
itemFill: "surfaceItemAccent",
|
|
1454
|
+
set: "simple",
|
|
1455
|
+
width: "fill"
|
|
1456
|
+
})), /*#__PURE__*/React__default.default.createElement("div", {
|
|
1462
1457
|
className: "form-dropzone__thumb-remove",
|
|
1463
1458
|
onClick: function onClick(event) {
|
|
1464
1459
|
return removeFile(event, i);
|
|
@@ -1499,8 +1494,13 @@ var FileInputDropzone = /*#__PURE__*/React__default.default.memo(function FileIn
|
|
|
1499
1494
|
textWeight: hintDescriptionTextWeight,
|
|
1500
1495
|
className: "form-dropzone__hint-text"
|
|
1501
1496
|
}, hintDescription)))), fileError && /*#__PURE__*/React__default.default.createElement("div", {
|
|
1502
|
-
className: "
|
|
1503
|
-
},
|
|
1497
|
+
className: "form-field__message"
|
|
1498
|
+
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1499
|
+
className: "form-field__message-item form-field__message-item_type_message",
|
|
1500
|
+
size: errorMessageTextSize,
|
|
1501
|
+
textWeight: errorMessageTextWeight,
|
|
1502
|
+
textColor: errorMessageTextColor
|
|
1503
|
+
}, fileError)));
|
|
1504
1504
|
});
|
|
1505
1505
|
FileInputDropzone.propTypes = {
|
|
1506
1506
|
dropzoneProps: PropTypes__default.default.object,
|
|
@@ -1545,6 +1545,9 @@ var FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(prop
|
|
|
1545
1545
|
removeThumbTextColor = props.removeThumbTextColor,
|
|
1546
1546
|
removeThumbTextWeight = props.removeThumbTextWeight,
|
|
1547
1547
|
hintTitle = props.hintTitle,
|
|
1548
|
+
errorMessageTextSize = props.errorMessageTextSize,
|
|
1549
|
+
errorMessageTextWeight = props.errorMessageTextWeight,
|
|
1550
|
+
errorMessageTextColor = props.errorMessageTextColor,
|
|
1548
1551
|
fieldProps = props.fieldProps,
|
|
1549
1552
|
hintTitleTextSize = props.hintTitleTextSize,
|
|
1550
1553
|
hintTitleTextColor = props.hintTitleTextColor,
|
|
@@ -1618,6 +1621,9 @@ var FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(prop
|
|
|
1618
1621
|
hintDescriptionTextColor: hintDescriptionTextColor,
|
|
1619
1622
|
hintDescriptionTextWrap: hintDescriptionTextWrap,
|
|
1620
1623
|
hintDescriptionTextWeight: hintDescriptionTextWeight,
|
|
1624
|
+
errorMessageTextSize: errorMessageTextSize,
|
|
1625
|
+
errorMessageWeight: errorMessageTextWeight,
|
|
1626
|
+
errorMessageTextColor: errorMessageTextColor,
|
|
1621
1627
|
isPreviews: isPreviews,
|
|
1622
1628
|
shape: shape,
|
|
1623
1629
|
isShowFilename: isShowFilename,
|
|
@@ -1629,6 +1635,10 @@ var FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(prop
|
|
|
1629
1635
|
}));
|
|
1630
1636
|
});
|
|
1631
1637
|
});
|
|
1638
|
+
FileInput.defaultProps = {
|
|
1639
|
+
errorMessageTextSize: 's',
|
|
1640
|
+
errorMessageTextColor: 'errorTextPrimary'
|
|
1641
|
+
};
|
|
1632
1642
|
FileInput.propTypes = {
|
|
1633
1643
|
name: PropTypes__default.default.string.isRequired,
|
|
1634
1644
|
className: PropTypes__default.default.string,
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -18,6 +18,7 @@ import { useDropzone } from 'react-dropzone';
|
|
|
18
18
|
import { fromEvent } from 'file-selector';
|
|
19
19
|
import castArray from 'lodash/castArray';
|
|
20
20
|
import { createFileFromDataURL } from '@itcase/common';
|
|
21
|
+
import { Loader } from '@itcase/ui/components/Loader';
|
|
21
22
|
import { Title } from '@itcase/ui/components/Title';
|
|
22
23
|
import { Input } from '@itcase/ui/components/Input';
|
|
23
24
|
import { Icon } from '@itcase/ui/components/Icon';
|
|
@@ -28,7 +29,6 @@ import { Switch } from '@itcase/ui/components/Switch';
|
|
|
28
29
|
import { Textarea } from '@itcase/ui/components/Textarea';
|
|
29
30
|
import { Button } from '@itcase/ui/components/Button';
|
|
30
31
|
import { Group as Group$1 } from '@itcase/ui/components/Group';
|
|
31
|
-
import { Loader } from '@itcase/ui/components/Loader';
|
|
32
32
|
import { NotificationItem } from '@itcase/ui/components/Notification';
|
|
33
33
|
import createDecorator from 'final-form-focus';
|
|
34
34
|
|
|
@@ -1194,14 +1194,17 @@ var FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props
|
|
|
1194
1194
|
hintDescriptionTextColor = props.hintDescriptionTextColor,
|
|
1195
1195
|
hintDescriptionTextWrap = props.hintDescriptionTextWrap,
|
|
1196
1196
|
hintDescriptionTextWeight = props.hintDescriptionTextWeight,
|
|
1197
|
+
errorMessageTextSize = props.errorMessageTextSize,
|
|
1198
|
+
errorMessageTextWeight = props.errorMessageTextWeight,
|
|
1199
|
+
errorMessageTextColor = props.errorMessageTextColor,
|
|
1197
1200
|
inputValue = props.inputValue,
|
|
1198
1201
|
removeThumbText = props.removeThumbText,
|
|
1199
1202
|
hintTitle = props.hintTitle,
|
|
1200
1203
|
hintDescription = props.hintDescription,
|
|
1201
1204
|
isShowFilename = props.isShowFilename,
|
|
1202
|
-
isPreviews = props.isPreviews
|
|
1203
|
-
|
|
1204
|
-
_props$dropzoneProps = props.dropzoneProps,
|
|
1205
|
+
isPreviews = props.isPreviews;
|
|
1206
|
+
props.loadingText;
|
|
1207
|
+
var _props$dropzoneProps = props.dropzoneProps,
|
|
1205
1208
|
dropzoneProps = _props$dropzoneProps === void 0 ? {} : _props$dropzoneProps;
|
|
1206
1209
|
var onAddFiles = props.onAddFiles,
|
|
1207
1210
|
onDeleteFile = props.onDeleteFile;
|
|
@@ -1361,20 +1364,6 @@ var FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props
|
|
|
1361
1364
|
};
|
|
1362
1365
|
}, []); // eslint-disable-line
|
|
1363
1366
|
|
|
1364
|
-
// prettier-ignore
|
|
1365
|
-
/*
|
|
1366
|
-
const itemClass = useMemo(
|
|
1367
|
-
() => clsx(
|
|
1368
|
-
'form__item',
|
|
1369
|
-
'form__item_type_dropzone',
|
|
1370
|
-
// itemClassName,
|
|
1371
|
-
// metaError || fileError && 'form__item_state_error',
|
|
1372
|
-
files.length && 'form__item_state_success'
|
|
1373
|
-
),
|
|
1374
|
-
[files.length]
|
|
1375
|
-
)
|
|
1376
|
-
*/
|
|
1377
|
-
|
|
1378
1367
|
var fillClass = useDeviceTargetClass(props, {
|
|
1379
1368
|
prefix: 'fill_',
|
|
1380
1369
|
propsKey: 'fill'
|
|
@@ -1447,8 +1436,14 @@ var FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props
|
|
|
1447
1436
|
textWeight: thumbNameTextWeight,
|
|
1448
1437
|
className: "form-dropzone__thumb-name-inner"
|
|
1449
1438
|
}, file.name)), fileIsLoading && /*#__PURE__*/React.createElement("div", {
|
|
1450
|
-
className: "form-dropzone__thumb-
|
|
1451
|
-
},
|
|
1439
|
+
className: "form-dropzone__thumb-loader"
|
|
1440
|
+
}, /*#__PURE__*/React.createElement(Loader, {
|
|
1441
|
+
fill: "surfacePrimary",
|
|
1442
|
+
height: "fill",
|
|
1443
|
+
itemFill: "surfaceItemAccent",
|
|
1444
|
+
set: "simple",
|
|
1445
|
+
width: "fill"
|
|
1446
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1452
1447
|
className: "form-dropzone__thumb-remove",
|
|
1453
1448
|
onClick: function onClick(event) {
|
|
1454
1449
|
return removeFile(event, i);
|
|
@@ -1489,8 +1484,13 @@ var FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props
|
|
|
1489
1484
|
textWeight: hintDescriptionTextWeight,
|
|
1490
1485
|
className: "form-dropzone__hint-text"
|
|
1491
1486
|
}, hintDescription)))), fileError && /*#__PURE__*/React.createElement("div", {
|
|
1492
|
-
className: "
|
|
1493
|
-
},
|
|
1487
|
+
className: "form-field__message"
|
|
1488
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
1489
|
+
className: "form-field__message-item form-field__message-item_type_message",
|
|
1490
|
+
size: errorMessageTextSize,
|
|
1491
|
+
textWeight: errorMessageTextWeight,
|
|
1492
|
+
textColor: errorMessageTextColor
|
|
1493
|
+
}, fileError)));
|
|
1494
1494
|
});
|
|
1495
1495
|
FileInputDropzone.propTypes = {
|
|
1496
1496
|
dropzoneProps: PropTypes.object,
|
|
@@ -1535,6 +1535,9 @@ var FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
1535
1535
|
removeThumbTextColor = props.removeThumbTextColor,
|
|
1536
1536
|
removeThumbTextWeight = props.removeThumbTextWeight,
|
|
1537
1537
|
hintTitle = props.hintTitle,
|
|
1538
|
+
errorMessageTextSize = props.errorMessageTextSize,
|
|
1539
|
+
errorMessageTextWeight = props.errorMessageTextWeight,
|
|
1540
|
+
errorMessageTextColor = props.errorMessageTextColor,
|
|
1538
1541
|
fieldProps = props.fieldProps,
|
|
1539
1542
|
hintTitleTextSize = props.hintTitleTextSize,
|
|
1540
1543
|
hintTitleTextColor = props.hintTitleTextColor,
|
|
@@ -1608,6 +1611,9 @@ var FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
1608
1611
|
hintDescriptionTextColor: hintDescriptionTextColor,
|
|
1609
1612
|
hintDescriptionTextWrap: hintDescriptionTextWrap,
|
|
1610
1613
|
hintDescriptionTextWeight: hintDescriptionTextWeight,
|
|
1614
|
+
errorMessageTextSize: errorMessageTextSize,
|
|
1615
|
+
errorMessageWeight: errorMessageTextWeight,
|
|
1616
|
+
errorMessageTextColor: errorMessageTextColor,
|
|
1611
1617
|
isPreviews: isPreviews,
|
|
1612
1618
|
shape: shape,
|
|
1613
1619
|
isShowFilename: isShowFilename,
|
|
@@ -1619,6 +1625,10 @@ var FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
1619
1625
|
}));
|
|
1620
1626
|
});
|
|
1621
1627
|
});
|
|
1628
|
+
FileInput.defaultProps = {
|
|
1629
|
+
errorMessageTextSize: 's',
|
|
1630
|
+
errorMessageTextColor: 'errorTextPrimary'
|
|
1631
|
+
};
|
|
1622
1632
|
FileInput.propTypes = {
|
|
1623
1633
|
name: PropTypes.string.isRequired,
|
|
1624
1634
|
className: PropTypes.string,
|