fui-material 2.1.7 → 2.1.9

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.
@@ -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.endsWith("/*")) {
2642
- const category = type.split("/")[0];
2643
- return fileType.startsWith(`${category}/`);
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
- let blockNotification = document.querySelector("#block-notification");
49905
- if (blockNotification === null) {
49906
- blockNotification = document.createElement("div");
49907
- blockNotification.id = "block-notification";
49908
- document.body.appendChild(blockNotification);
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
- const blockNotification2 = document.querySelector("#block-notification");
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
  }
@@ -50044,6 +50057,21 @@ const getMimeTypeFromFileName = (fileName) => {
50044
50057
  };
50045
50058
  return mimeTypes[extension];
50046
50059
  };
50060
+ function fDownloadBlobFile(blob, fileName) {
50061
+ if (!blob) {
50062
+ throw new Error("Blob or string content must not be empty");
50063
+ }
50064
+ const blobObject = typeof blob === "string" ? new Blob([blob], { type: "text/plain;charset=utf-8" }) : blob;
50065
+ const link2 = document.createElement("a");
50066
+ const url = window.URL.createObjectURL(blobObject);
50067
+ link2.href = url;
50068
+ link2.download = fileName;
50069
+ link2.style.display = "none";
50070
+ document.body.appendChild(link2);
50071
+ link2.click();
50072
+ document.body.removeChild(link2);
50073
+ window.URL.revokeObjectURL(url);
50074
+ }
50047
50075
  function bind(fn, thisArg) {
50048
50076
  return function wrap() {
50049
50077
  return fn.apply(thisArg, arguments);
@@ -52544,6 +52572,7 @@ export {
52544
52572
  fAlert,
52545
52573
  fConfirm,
52546
52574
  fConvertFileToBase64,
52575
+ fDownloadBlobFile,
52547
52576
  fDownloadFileFromBase64,
52548
52577
  fExportHtmlOrJsxToWord,
52549
52578
  fExportTableToExcel,