@itcase/forms 1.0.32 → 1.0.34
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.
|
@@ -156,45 +156,6 @@
|
|
|
156
156
|
position: relative;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
.form-response {
|
|
160
|
-
background: var(--color-surface-primary);
|
|
161
|
-
padding: 30px;
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-flow: column nowrap;
|
|
164
|
-
align-items: center;
|
|
165
|
-
@mixin elevation-2;
|
|
166
|
-
&__icon {
|
|
167
|
-
width: 100px;
|
|
168
|
-
height: 100px;
|
|
169
|
-
display: flex;
|
|
170
|
-
justify-content: center;
|
|
171
|
-
align-items: center;
|
|
172
|
-
& svg {
|
|
173
|
-
fill: var(--color-surface-item-accent);
|
|
174
|
-
transform: scale(4.18);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
&__title {
|
|
178
|
-
max-width: 240px;
|
|
179
|
-
color: var(--color-surface-text-primary);
|
|
180
|
-
text-align: center;
|
|
181
|
-
padding: 0;
|
|
182
|
-
margin: 0 0 8px 0;
|
|
183
|
-
@mixin h5;
|
|
184
|
-
}
|
|
185
|
-
&__text {
|
|
186
|
-
max-width: 240px;
|
|
187
|
-
color: var(--color-surface-text-primary);
|
|
188
|
-
text-align: center;
|
|
189
|
-
padding: 0;
|
|
190
|
-
margin: 0;
|
|
191
|
-
@mixin text-l;
|
|
192
|
-
}
|
|
193
|
-
&__button {
|
|
194
|
-
width: 100%;
|
|
195
|
-
margin: 30px 0 0 0;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
159
|
.form-notification {
|
|
199
160
|
&_type {
|
|
200
161
|
&_sticky {
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -1128,9 +1128,14 @@ function _convertToFiles() {
|
|
|
1128
1128
|
newFile.preview = URL.createObjectURL(newFile);
|
|
1129
1129
|
}
|
|
1130
1130
|
newFiles.push(newFile);
|
|
1131
|
-
} else if (value) {
|
|
1132
|
-
newFiles.push(value);
|
|
1133
1131
|
}
|
|
1132
|
+
|
|
1133
|
+
// else if (value) {
|
|
1134
|
+
// newFiles.push({
|
|
1135
|
+
// name: value,
|
|
1136
|
+
// error: 'File is unavailable',
|
|
1137
|
+
// })
|
|
1138
|
+
// }
|
|
1134
1139
|
case 18:
|
|
1135
1140
|
_iteratorAbruptCompletion = false;
|
|
1136
1141
|
_context4.next = 5;
|
|
@@ -1201,6 +1206,7 @@ var FileInputDropzone = /*#__PURE__*/React__default.default.memo(function FileIn
|
|
|
1201
1206
|
var inputName = props.inputName,
|
|
1202
1207
|
size = props.size,
|
|
1203
1208
|
className = props.className,
|
|
1209
|
+
fileErrorText = props.fileErrorText,
|
|
1204
1210
|
hintTitleTextSize = props.hintTitleTextSize,
|
|
1205
1211
|
removeThumbTextSize = props.removeThumbTextSize,
|
|
1206
1212
|
removeThumbTextColor = props.removeThumbTextColor,
|
|
@@ -1231,8 +1237,8 @@ var FileInputDropzone = /*#__PURE__*/React__default.default.memo(function FileIn
|
|
|
1231
1237
|
isPreviews = props.isPreviews;
|
|
1232
1238
|
props.loadingText;
|
|
1233
1239
|
var _props$dropzoneProps = props.dropzoneProps,
|
|
1234
|
-
dropzoneProps = _props$dropzoneProps === void 0 ? {} : _props$dropzoneProps
|
|
1235
|
-
|
|
1240
|
+
dropzoneProps = _props$dropzoneProps === void 0 ? {} : _props$dropzoneProps,
|
|
1241
|
+
onAddFiles = props.onAddFiles,
|
|
1236
1242
|
onDeleteFile = props.onDeleteFile;
|
|
1237
1243
|
var _useState = React.useState(''),
|
|
1238
1244
|
fileError = _useState[0],
|
|
@@ -1292,7 +1298,9 @@ var FileInputDropzone = /*#__PURE__*/React__default.default.memo(function FileIn
|
|
|
1292
1298
|
if (isPreviews) {
|
|
1293
1299
|
// Add preview to every file
|
|
1294
1300
|
acceptedFiles.forEach(function (file) {
|
|
1295
|
-
|
|
1301
|
+
if (!file.error) {
|
|
1302
|
+
file.preview = URL.createObjectURL(file);
|
|
1303
|
+
}
|
|
1296
1304
|
});
|
|
1297
1305
|
}
|
|
1298
1306
|
// Save to form data (including empty when files are not valid)
|
|
@@ -1450,7 +1458,7 @@ var FileInputDropzone = /*#__PURE__*/React__default.default.memo(function FileIn
|
|
|
1450
1458
|
return /*#__PURE__*/React__default.default.createElement("aside", {
|
|
1451
1459
|
className: clsx__default.default('form-dropzone__thumb', fillClass, thumbDirectionClass, thumbBorderWidthClass, thumbBorderColorClass, thumbBorderColorHoverClass, thumbBorderTypeClass),
|
|
1452
1460
|
key: "" + (file.id || file.name + "_" + i || 'i' + i)
|
|
1453
|
-
}, isPreviews && /*#__PURE__*/React__default.default.createElement("div", {
|
|
1461
|
+
}, isPreviews && !file.error && /*#__PURE__*/React__default.default.createElement("div", {
|
|
1454
1462
|
className: "form-dropzone__thumb-image"
|
|
1455
1463
|
}, /*#__PURE__*/React__default.default.createElement("img", {
|
|
1456
1464
|
className: "form-dropzone__thumb-image-inner",
|
|
@@ -1459,7 +1467,12 @@ var FileInputDropzone = /*#__PURE__*/React__default.default.memo(function FileIn
|
|
|
1459
1467
|
// Revoke data uri after image is loaded
|
|
1460
1468
|
URL.revokeObjectURL(file.preview);
|
|
1461
1469
|
}
|
|
1462
|
-
})),
|
|
1470
|
+
})), file.error && /*#__PURE__*/React__default.default.createElement("div", null, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1471
|
+
size: thumbNameTextSize,
|
|
1472
|
+
textColor: thumbNameTextColor,
|
|
1473
|
+
textWrap: thumbNameTextWrap,
|
|
1474
|
+
textWeight: thumbNameTextWeight
|
|
1475
|
+
}, fileErrorText || file.error)), isShowFilename && /*#__PURE__*/React__default.default.createElement("div", {
|
|
1463
1476
|
className: "form-dropzone__thumb-name"
|
|
1464
1477
|
}, /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1465
1478
|
size: thumbNameTextSize,
|
|
@@ -1583,6 +1596,7 @@ var FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(prop
|
|
|
1583
1596
|
thumbDirection = props.thumbDirection,
|
|
1584
1597
|
hintDescription = props.hintDescription,
|
|
1585
1598
|
isShowFilename = props.isShowFilename,
|
|
1599
|
+
fileErrorText = props.fileErrorText,
|
|
1586
1600
|
dropzoneProps = props.dropzoneProps,
|
|
1587
1601
|
maxFiles = props.maxFiles,
|
|
1588
1602
|
maxSize = props.maxSize,
|
|
@@ -1625,6 +1639,7 @@ var FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(prop
|
|
|
1625
1639
|
thumbBorderColor: thumbBorderColor,
|
|
1626
1640
|
thumbBorderColorHover: thumbBorderColorHover,
|
|
1627
1641
|
thumbBorderType: thumbBorderType,
|
|
1642
|
+
fileErrorText: fileErrorText,
|
|
1628
1643
|
fill: fill,
|
|
1629
1644
|
size: size,
|
|
1630
1645
|
maxFiles: maxFiles,
|
|
@@ -1746,7 +1761,10 @@ var Group = /*#__PURE__*/React__default.default.memo(function Group(props) {
|
|
|
1746
1761
|
size: messageTextSize,
|
|
1747
1762
|
textWeight: messageTextWeight,
|
|
1748
1763
|
textColor: messageTextColor
|
|
1749
|
-
}, message))
|
|
1764
|
+
}, message), Boolean(!showError) && Boolean(!message) && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1765
|
+
className: "form__group-message",
|
|
1766
|
+
size: messageTextSize
|
|
1767
|
+
}, "\xA0"));
|
|
1750
1768
|
});
|
|
1751
1769
|
});
|
|
1752
1770
|
Group.defaultProps = {
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -1118,9 +1118,14 @@ function _convertToFiles() {
|
|
|
1118
1118
|
newFile.preview = URL.createObjectURL(newFile);
|
|
1119
1119
|
}
|
|
1120
1120
|
newFiles.push(newFile);
|
|
1121
|
-
} else if (value) {
|
|
1122
|
-
newFiles.push(value);
|
|
1123
1121
|
}
|
|
1122
|
+
|
|
1123
|
+
// else if (value) {
|
|
1124
|
+
// newFiles.push({
|
|
1125
|
+
// name: value,
|
|
1126
|
+
// error: 'File is unavailable',
|
|
1127
|
+
// })
|
|
1128
|
+
// }
|
|
1124
1129
|
case 18:
|
|
1125
1130
|
_iteratorAbruptCompletion = false;
|
|
1126
1131
|
_context4.next = 5;
|
|
@@ -1191,6 +1196,7 @@ var FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props
|
|
|
1191
1196
|
var inputName = props.inputName,
|
|
1192
1197
|
size = props.size,
|
|
1193
1198
|
className = props.className,
|
|
1199
|
+
fileErrorText = props.fileErrorText,
|
|
1194
1200
|
hintTitleTextSize = props.hintTitleTextSize,
|
|
1195
1201
|
removeThumbTextSize = props.removeThumbTextSize,
|
|
1196
1202
|
removeThumbTextColor = props.removeThumbTextColor,
|
|
@@ -1221,8 +1227,8 @@ var FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props
|
|
|
1221
1227
|
isPreviews = props.isPreviews;
|
|
1222
1228
|
props.loadingText;
|
|
1223
1229
|
var _props$dropzoneProps = props.dropzoneProps,
|
|
1224
|
-
dropzoneProps = _props$dropzoneProps === void 0 ? {} : _props$dropzoneProps
|
|
1225
|
-
|
|
1230
|
+
dropzoneProps = _props$dropzoneProps === void 0 ? {} : _props$dropzoneProps,
|
|
1231
|
+
onAddFiles = props.onAddFiles,
|
|
1226
1232
|
onDeleteFile = props.onDeleteFile;
|
|
1227
1233
|
var _useState = useState(''),
|
|
1228
1234
|
fileError = _useState[0],
|
|
@@ -1282,7 +1288,9 @@ var FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props
|
|
|
1282
1288
|
if (isPreviews) {
|
|
1283
1289
|
// Add preview to every file
|
|
1284
1290
|
acceptedFiles.forEach(function (file) {
|
|
1285
|
-
|
|
1291
|
+
if (!file.error) {
|
|
1292
|
+
file.preview = URL.createObjectURL(file);
|
|
1293
|
+
}
|
|
1286
1294
|
});
|
|
1287
1295
|
}
|
|
1288
1296
|
// Save to form data (including empty when files are not valid)
|
|
@@ -1440,7 +1448,7 @@ var FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props
|
|
|
1440
1448
|
return /*#__PURE__*/React.createElement("aside", {
|
|
1441
1449
|
className: clsx('form-dropzone__thumb', fillClass, thumbDirectionClass, thumbBorderWidthClass, thumbBorderColorClass, thumbBorderColorHoverClass, thumbBorderTypeClass),
|
|
1442
1450
|
key: "" + (file.id || file.name + "_" + i || 'i' + i)
|
|
1443
|
-
}, isPreviews && /*#__PURE__*/React.createElement("div", {
|
|
1451
|
+
}, isPreviews && !file.error && /*#__PURE__*/React.createElement("div", {
|
|
1444
1452
|
className: "form-dropzone__thumb-image"
|
|
1445
1453
|
}, /*#__PURE__*/React.createElement("img", {
|
|
1446
1454
|
className: "form-dropzone__thumb-image-inner",
|
|
@@ -1449,7 +1457,12 @@ var FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(props
|
|
|
1449
1457
|
// Revoke data uri after image is loaded
|
|
1450
1458
|
URL.revokeObjectURL(file.preview);
|
|
1451
1459
|
}
|
|
1452
|
-
})),
|
|
1460
|
+
})), file.error && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
|
|
1461
|
+
size: thumbNameTextSize,
|
|
1462
|
+
textColor: thumbNameTextColor,
|
|
1463
|
+
textWrap: thumbNameTextWrap,
|
|
1464
|
+
textWeight: thumbNameTextWeight
|
|
1465
|
+
}, fileErrorText || file.error)), isShowFilename && /*#__PURE__*/React.createElement("div", {
|
|
1453
1466
|
className: "form-dropzone__thumb-name"
|
|
1454
1467
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1455
1468
|
size: thumbNameTextSize,
|
|
@@ -1573,6 +1586,7 @@ var FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
1573
1586
|
thumbDirection = props.thumbDirection,
|
|
1574
1587
|
hintDescription = props.hintDescription,
|
|
1575
1588
|
isShowFilename = props.isShowFilename,
|
|
1589
|
+
fileErrorText = props.fileErrorText,
|
|
1576
1590
|
dropzoneProps = props.dropzoneProps,
|
|
1577
1591
|
maxFiles = props.maxFiles,
|
|
1578
1592
|
maxSize = props.maxSize,
|
|
@@ -1615,6 +1629,7 @@ var FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
1615
1629
|
thumbBorderColor: thumbBorderColor,
|
|
1616
1630
|
thumbBorderColorHover: thumbBorderColorHover,
|
|
1617
1631
|
thumbBorderType: thumbBorderType,
|
|
1632
|
+
fileErrorText: fileErrorText,
|
|
1618
1633
|
fill: fill,
|
|
1619
1634
|
size: size,
|
|
1620
1635
|
maxFiles: maxFiles,
|
|
@@ -1736,7 +1751,10 @@ var Group = /*#__PURE__*/React.memo(function Group(props) {
|
|
|
1736
1751
|
size: messageTextSize,
|
|
1737
1752
|
textWeight: messageTextWeight,
|
|
1738
1753
|
textColor: messageTextColor
|
|
1739
|
-
}, message))
|
|
1754
|
+
}, message), Boolean(!showError) && Boolean(!message) && /*#__PURE__*/React.createElement(Text, {
|
|
1755
|
+
className: "form__group-message",
|
|
1756
|
+
size: messageTextSize
|
|
1757
|
+
}, "\xA0"));
|
|
1740
1758
|
});
|
|
1741
1759
|
});
|
|
1742
1760
|
Group.defaultProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/forms",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"description": "Forms fields, inputs, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"forms",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@itcase/common": "^1.1.6",
|
|
38
|
-
"@itcase/ui": "^1.0.
|
|
38
|
+
"@itcase/ui": "^1.0.65",
|
|
39
39
|
"axios": "^1.5.0",
|
|
40
40
|
"clsx": "^2.0.0",
|
|
41
41
|
"date-fns": "2.0.0-alpha.7",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"react-select": "^5.7.5"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/core": "^7.
|
|
56
|
+
"@babel/core": "^7.23.0",
|
|
57
57
|
"@babel/eslint-parser": "^7.22.15",
|
|
58
58
|
"@babel/preset-env": "^7.22.20",
|
|
59
59
|
"@babel/preset-react": "^7.22.15",
|
|
@@ -67,7 +67,7 @@
|
|
|
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.50.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",
|
|
@@ -101,9 +101,9 @@
|
|
|
101
101
|
"postcss-sort-media-queries": "^5.2.0",
|
|
102
102
|
"prettier": "^3.0.3",
|
|
103
103
|
"react-datepicker": "^4.18.0",
|
|
104
|
-
"rollup": "^3.29.
|
|
104
|
+
"rollup": "^3.29.3",
|
|
105
105
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
106
|
-
"semantic-release": "^22.0.
|
|
106
|
+
"semantic-release": "^22.0.5",
|
|
107
107
|
"stylelint": "^15.10.3",
|
|
108
108
|
"stylelint-config-standard": "^34.0.0",
|
|
109
109
|
"stylelint-no-unsupported-browser-features": "^7.0.0",
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
.form-response {
|
|
2
|
-
background: var(--color-surface-primary);
|
|
3
|
-
padding: 30px;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-flow: column nowrap;
|
|
6
|
-
align-items: center;
|
|
7
|
-
@mixin elevation-2;
|
|
8
|
-
&__icon {
|
|
9
|
-
width: 100px;
|
|
10
|
-
height: 100px;
|
|
11
|
-
display: flex;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
align-items: center;
|
|
14
|
-
& svg {
|
|
15
|
-
fill: var(--color-surface-item-accent);
|
|
16
|
-
transform: scale(4.18);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
&__title {
|
|
20
|
-
max-width: 240px;
|
|
21
|
-
color: var(--color-surface-text-primary);
|
|
22
|
-
text-align: center;
|
|
23
|
-
padding: 0;
|
|
24
|
-
margin: 0 0 8px 0;
|
|
25
|
-
@mixin h5;
|
|
26
|
-
}
|
|
27
|
-
&__text {
|
|
28
|
-
max-width: 240px;
|
|
29
|
-
color: var(--color-surface-text-primary);
|
|
30
|
-
text-align: center;
|
|
31
|
-
padding: 0;
|
|
32
|
-
margin: 0;
|
|
33
|
-
@mixin text-l;
|
|
34
|
-
}
|
|
35
|
-
&__button {
|
|
36
|
-
width: 100%;
|
|
37
|
-
margin: 30px 0 0 0;
|
|
38
|
-
}
|
|
39
|
-
}
|