fui-material 2.1.7 → 2.1.8
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.
- package/dist/f-ui-kit.es.js +28 -15
- package/dist/f-ui-kit.es.js.map +1 -1
- package/package.json +1 -1
package/dist/f-ui-kit.es.js
CHANGED
|
@@ -2636,13 +2636,18 @@ const FInputFileForm = ({
|
|
|
2636
2636
|
}
|
|
2637
2637
|
if (accept) {
|
|
2638
2638
|
const fileType = file.type;
|
|
2639
|
+
const fileName = file.name.toLowerCase();
|
|
2639
2640
|
const acceptedTypes = accept.split(",").map((type) => type.trim());
|
|
2640
2641
|
const isValidType = acceptedTypes.some((type) => {
|
|
2641
|
-
if (type.
|
|
2642
|
-
|
|
2643
|
-
|
|
2642
|
+
if (type.includes("/")) {
|
|
2643
|
+
if (type.endsWith("/*")) {
|
|
2644
|
+
const category = type.split("/")[0];
|
|
2645
|
+
return fileType.startsWith(`${category}/`);
|
|
2646
|
+
}
|
|
2647
|
+
return type === fileType;
|
|
2648
|
+
} else {
|
|
2649
|
+
return fileName.endsWith(type.toLowerCase());
|
|
2644
2650
|
}
|
|
2645
|
-
return type === fileType;
|
|
2646
2651
|
});
|
|
2647
2652
|
if (!isValidType) {
|
|
2648
2653
|
newErrors.push(`Файл ${file.name} имеет недопустимый формат`);
|
|
@@ -49901,12 +49906,23 @@ const fNotification = ({
|
|
|
49901
49906
|
</div>
|
|
49902
49907
|
</div>
|
|
49903
49908
|
`;
|
|
49904
|
-
|
|
49905
|
-
|
|
49906
|
-
|
|
49907
|
-
|
|
49908
|
-
|
|
49909
|
-
|
|
49909
|
+
const getOrCreateNotificationBlock = () => {
|
|
49910
|
+
let blockNotification2 = document.querySelector("#block-notification");
|
|
49911
|
+
if (blockNotification2 === null) {
|
|
49912
|
+
blockNotification2 = document.createElement("div");
|
|
49913
|
+
blockNotification2.id = "block-notification";
|
|
49914
|
+
document.body.appendChild(blockNotification2);
|
|
49915
|
+
}
|
|
49916
|
+
return blockNotification2;
|
|
49917
|
+
};
|
|
49918
|
+
const removeEmptyNotificationBlock = () => {
|
|
49919
|
+
var _a;
|
|
49920
|
+
const blockNotification2 = document.querySelector("#block-notification");
|
|
49921
|
+
if (blockNotification2 && blockNotification2.children.length === 0) {
|
|
49922
|
+
(_a = blockNotification2.parentNode) == null ? void 0 : _a.removeChild(blockNotification2);
|
|
49923
|
+
}
|
|
49924
|
+
};
|
|
49925
|
+
const blockNotification = getOrCreateNotificationBlock();
|
|
49910
49926
|
blockNotification.insertAdjacentHTML("afterbegin", not);
|
|
49911
49927
|
blockNotification.scrollTo({ top: 0, behavior: "smooth" });
|
|
49912
49928
|
if (buttonClose) {
|
|
@@ -49921,6 +49937,7 @@ const fNotification = ({
|
|
|
49921
49937
|
if (el.parentNode) {
|
|
49922
49938
|
el.parentNode.removeChild(el);
|
|
49923
49939
|
}
|
|
49940
|
+
removeEmptyNotificationBlock();
|
|
49924
49941
|
}, 1e3);
|
|
49925
49942
|
});
|
|
49926
49943
|
}
|
|
@@ -49939,14 +49956,10 @@ const fNotification = ({
|
|
|
49939
49956
|
el.className = styles["f-function-notification-hidden"];
|
|
49940
49957
|
}, (timeSecClose - 1) * 1e3);
|
|
49941
49958
|
setTimeout(() => {
|
|
49942
|
-
var _a;
|
|
49943
49959
|
if (el.parentNode) {
|
|
49944
49960
|
el.parentNode.removeChild(el);
|
|
49945
49961
|
}
|
|
49946
|
-
|
|
49947
|
-
if (blockNotification2 && blockNotification2.children.length === 0) {
|
|
49948
|
-
(_a = blockNotification2.parentNode) == null ? void 0 : _a.removeChild(blockNotification2);
|
|
49949
|
-
}
|
|
49962
|
+
removeEmptyNotificationBlock();
|
|
49950
49963
|
}, timeSecClose * 1e3);
|
|
49951
49964
|
}
|
|
49952
49965
|
}
|