@zero-library/common 3.0.7 → 3.0.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/index.cjs.js CHANGED
@@ -295,6 +295,11 @@ var isJson = (text = "") => {
295
295
  return false;
296
296
  }
297
297
  };
298
+ var isDocument = (fileName) => {
299
+ if (!fileName) return false;
300
+ const ext = getFileSuffixName(fileName);
301
+ return ["pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "csv"].includes(ext);
302
+ };
298
303
  var OperatorToMethodName = {
299
304
  "+": "plus",
300
305
  "-": "minus",
@@ -3223,7 +3228,7 @@ var luyaFilePreview_default = ({ suffix, fileUrl, emptyProps, fileName }) => {
3223
3228
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { subTitle: `\u6682\u4E0D\u652F\u6301 ${suffix || ""} \u6587\u4EF6\u7684\u9884\u89C8` });
3224
3229
  }
3225
3230
  }, [suffix, fileUrl, fileName]);
3226
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", align: "center", className: "height-full", children: Preview });
3231
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "center", align: "center", className: "height-full p-t-16 p-b-16 p-l-16", children: Preview });
3227
3232
  };
3228
3233
  var FilePreviewDrawer_default = ({ open, title = "\u6587\u4EF6\u9884\u89C8", onClose, ...props }) => {
3229
3234
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -10013,6 +10018,7 @@ exports.isBlob = isBlob;
10013
10018
  exports.isBoolean = isBoolean;
10014
10019
  exports.isDate = isDate;
10015
10020
  exports.isDef = isDef;
10021
+ exports.isDocument = isDocument;
10016
10022
  exports.isElement = isElement;
10017
10023
  exports.isEmpty = isEmpty;
10018
10024
  exports.isEmptyObj = isEmptyObj;