@aplus-frontend/ui
Version:
39 lines (38 loc) • 851 B
JavaScript
import { isEmpty as a } from "lodash-unified";
import { formatterMap as o } from "./formatter/index.mjs";
function m(r, e) {
const t = o[e.valueType];
return t ? t(r, e.extraProps || {}) : r.value;
}
function l(r, e) {
if (e.isShowEmptyPlaceholder === !1)
return !1;
switch (e.valueType) {
case "text":
case "number":
case "dateRange":
case "date":
return r == null || r === "";
case "array":
case "attachment":
return a(r);
default:
return !r;
}
}
function u(r = {}, e) {
return e.fromGlobal ? {
...r,
downloadFile(t, n) {
return e.fromGlobal?.([{ fileName: n, objectName: t }]);
}
} : !r?.downloadFile && e.fromConfig ? {
...r,
downloadFile: e.fromConfig
} : r;
}
export {
l as isEmptyWithType,
u as mixinsAttachmentExtraProps,
m as transformValue
};