tenjin-ui-kit 0.2.188 → 0.2.190
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.
|
@@ -56,12 +56,18 @@ var FileUploader = function FileUploader(props) {
|
|
|
56
56
|
if (selectedFile) {
|
|
57
57
|
var _selectedFile$name, _selectedFile$name$sp, _selectedFile$name$sp2;
|
|
58
58
|
var excludedExtensions = [".zip", ".exe", ".batch", ".webm", ".mp4", ".mp3", ".bat", ".js", ".vbs", ".html", ".scr", ".cmd", ".rar", ".svg", ".lnk"];
|
|
59
|
+
var includedExtensions = [".xlsx", ".xls", ".csv", ".png", ".jpg", ".txt", ".pdf", ".doc", ".docx", ".ppt"];
|
|
59
60
|
var fileExtension = selectedFile === null || selectedFile === void 0 ? void 0 : (_selectedFile$name = selectedFile.name) === null || _selectedFile$name === void 0 ? void 0 : (_selectedFile$name$sp = _selectedFile$name.split(".")) === null || _selectedFile$name$sp === void 0 ? void 0 : (_selectedFile$name$sp2 = _selectedFile$name$sp.pop()) === null || _selectedFile$name$sp2 === void 0 ? void 0 : _selectedFile$name$sp2.toLowerCase();
|
|
60
61
|
if (excludedExtensions.some(function (ext) {
|
|
61
62
|
return selectedFile.name.endsWith(ext);
|
|
62
63
|
})) {
|
|
63
64
|
alert("Selected file type .".concat(fileExtension, " is not allowed."));
|
|
64
65
|
e.target.value = null;
|
|
66
|
+
} else if (!includedExtensions.some(function (ext) {
|
|
67
|
+
return selectedFile.name.endsWith(ext);
|
|
68
|
+
})) {
|
|
69
|
+
alert("Selected file type .".concat(fileExtension, " is not supported."));
|
|
70
|
+
e.target.value = null;
|
|
65
71
|
} else {
|
|
66
72
|
e.target.files[0] && setSelectedFile(e.target.files);
|
|
67
73
|
}
|
|
@@ -75,12 +81,18 @@ var FileUploader = function FileUploader(props) {
|
|
|
75
81
|
if (droppedFiles.length > 0) {
|
|
76
82
|
var _droppedFiles$, _droppedFiles$$name, _droppedFiles$$name$s, _droppedFiles$$name$s2;
|
|
77
83
|
var excludedExtensions = [".zip", ".exe", ".batch", ".webm", ".mp4", ".mp3", ".bat", ".js", ".vbs", ".html", ".scr", ".cmd", ".rar", ".svg", ".lnk"];
|
|
84
|
+
var includedExtensions = [".xlsx", ".xls", ".csv", ".png", ".jpg", ".txt", ".pdf", ".doc", ".docx", ".ppt"];
|
|
78
85
|
var fileExtension = (_droppedFiles$ = droppedFiles[0]) === null || _droppedFiles$ === void 0 ? void 0 : (_droppedFiles$$name = _droppedFiles$.name) === null || _droppedFiles$$name === void 0 ? void 0 : (_droppedFiles$$name$s = _droppedFiles$$name.split(".")) === null || _droppedFiles$$name$s === void 0 ? void 0 : (_droppedFiles$$name$s2 = _droppedFiles$$name$s.pop()) === null || _droppedFiles$$name$s2 === void 0 ? void 0 : _droppedFiles$$name$s2.toLowerCase();
|
|
79
86
|
if (excludedExtensions !== null && excludedExtensions !== void 0 && excludedExtensions.some(function (ext) {
|
|
80
87
|
var _droppedFiles$2, _droppedFiles$2$name;
|
|
81
88
|
return (_droppedFiles$2 = droppedFiles[0]) === null || _droppedFiles$2 === void 0 ? void 0 : (_droppedFiles$2$name = _droppedFiles$2.name) === null || _droppedFiles$2$name === void 0 ? void 0 : _droppedFiles$2$name.endsWith(ext);
|
|
82
89
|
})) {
|
|
83
90
|
alert("Selected file type .".concat(fileExtension, " is not allowed."));
|
|
91
|
+
} else if (!includedExtensions.some(function (ext) {
|
|
92
|
+
var _droppedFiles$3, _droppedFiles$3$name;
|
|
93
|
+
return (_droppedFiles$3 = droppedFiles[0]) === null || _droppedFiles$3 === void 0 ? void 0 : (_droppedFiles$3$name = _droppedFiles$3.name) === null || _droppedFiles$3$name === void 0 ? void 0 : _droppedFiles$3$name.endsWith(ext);
|
|
94
|
+
})) {
|
|
95
|
+
alert("Selected file type .".concat(fileExtension, " is not supported."));
|
|
84
96
|
} else {
|
|
85
97
|
setSelectedFile(droppedFiles);
|
|
86
98
|
}
|
|
@@ -140,7 +140,7 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
140
140
|
autoFocus: true,
|
|
141
141
|
style: {
|
|
142
142
|
paddingLeft: "2.5rem",
|
|
143
|
-
background: 'url("https://static.thenounproject.com/png/101791-200.png") no-repeat left',
|
|
143
|
+
background: 'white url("https://static.thenounproject.com/png/101791-200.png") no-repeat left',
|
|
144
144
|
backgroundPosition: "0.875rem center",
|
|
145
145
|
backgroundSize: "1.125rem",
|
|
146
146
|
position: "sticky",
|
|
@@ -152,7 +152,20 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
152
152
|
width: "100%",
|
|
153
153
|
border: "1px solid #949494",
|
|
154
154
|
borderRadius: "4px"
|
|
155
|
+
// paddingLeft: "2.5rem",
|
|
156
|
+
// background:
|
|
157
|
+
// "white url('https://static.thenounproject.com/png/101791-200.png') no-repeat left center",
|
|
158
|
+
// backgroundSize: "1.125rem",
|
|
159
|
+
// position: "sticky",
|
|
160
|
+
// top: 0,
|
|
161
|
+
// zIndex: 9999,
|
|
162
|
+
// height: "2.188rem",
|
|
163
|
+
// margin: 0,
|
|
164
|
+
// width: "100%",
|
|
165
|
+
// border: "1px solid #949494",
|
|
166
|
+
// borderRadius: "4px",
|
|
155
167
|
},
|
|
168
|
+
|
|
156
169
|
placeholder: "Type to search...",
|
|
157
170
|
onChange: function onChange(e) {
|
|
158
171
|
return setSearchText(e.target.value);
|