beca-ui 2.0.19-beta.44 → 2.0.19-beta.45
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/beca-ui.js
CHANGED
|
@@ -139584,7 +139584,7 @@ const win$2 = window, msWordExtensions = ["doc", "docx"], msExcelExtensions = ["
|
|
|
139584
139584
|
}
|
|
139585
139585
|
];
|
|
139586
139586
|
let currentForm, currentMDForm, masterDetailSaveBtn, isMD = !1, currentColumns = {}, currentMDColumns = {};
|
|
139587
|
-
const
|
|
139587
|
+
const _DataServices2 = class _DataServices2 {
|
|
139588
139588
|
static uploadFileRequest({ file: a, onSuccess: s }) {
|
|
139589
139589
|
setTimeout(() => {
|
|
139590
139590
|
s("ok");
|
|
@@ -139732,7 +139732,7 @@ const _DataServices = class _DataServices {
|
|
|
139732
139732
|
`<!doctype html><body>${C}`,
|
|
139733
139733
|
"text/html"
|
|
139734
139734
|
).body) == null ? void 0 : p.textContent : "";
|
|
139735
|
-
x && (d.isNumber || d.isCalculated) && (x = (h = x == null ? void 0 : x.replaceAll("%", "")) == null ? void 0 : h.trim(), x =
|
|
139735
|
+
x && (d.isNumber || d.isCalculated) && (x = (h = x == null ? void 0 : x.replaceAll("%", "")) == null ? void 0 : h.trim(), x = _DataServices2.formatNumberString(x)), u[d.name] = x;
|
|
139736
139736
|
}
|
|
139737
139737
|
}
|
|
139738
139738
|
}
|
|
@@ -139740,7 +139740,7 @@ const _DataServices = class _DataServices {
|
|
|
139740
139740
|
const y = document.getElementById(`field_${d.name}`);
|
|
139741
139741
|
if (y) {
|
|
139742
139742
|
let C = y.getAttribute("value"), x = u[d.name];
|
|
139743
|
-
C && (d.isNumber && (C = (m = C == null ? void 0 : C.replaceAll("%", "")) == null ? void 0 : m.trim(), C =
|
|
139743
|
+
C && (d.isNumber && (C = (m = C == null ? void 0 : C.replaceAll("%", "")) == null ? void 0 : m.trim(), C = _DataServices2.formatNumberString(C)), x = (g = c.parseFromString(
|
|
139744
139744
|
`<!doctype html><body>${C}`,
|
|
139745
139745
|
"text/html"
|
|
139746
139746
|
).body) == null ? void 0 : g.textContent), u[d.name] = x;
|
|
@@ -139941,7 +139941,7 @@ const _DataServices = class _DataServices {
|
|
|
139941
139941
|
const f = s.colTypes.find(
|
|
139942
139942
|
(p) => p.name === u
|
|
139943
139943
|
);
|
|
139944
|
-
f && (f == null ? void 0 : f.realType) === "number" && f.viewOnly === !0 && (c[u] =
|
|
139944
|
+
f && (f == null ? void 0 : f.realType) === "number" && f.viewOnly === !0 && (c[u] = _DataServices2.formatNumberString(c[u]));
|
|
139945
139945
|
} else if (d && typeof d == "object" && Array.isArray(d))
|
|
139946
139946
|
try {
|
|
139947
139947
|
c[u] = d.join(";");
|
|
@@ -140077,8 +140077,8 @@ const _DataServices = class _DataServices {
|
|
|
140077
140077
|
}), s;
|
|
140078
140078
|
}
|
|
140079
140079
|
static filterOptionLabelValue(a, s) {
|
|
140080
|
-
const c =
|
|
140081
|
-
return
|
|
140080
|
+
const c = _DataServices2.removeVietnameseTones(a.toLowerCase());
|
|
140081
|
+
return _DataServices2.removeVietnameseTones(
|
|
140082
140082
|
((s == null ? void 0 : s.label) ?? "").toLowerCase()
|
|
140083
140083
|
).includes(c);
|
|
140084
140084
|
}
|
|
@@ -140155,7 +140155,7 @@ const _DataServices = class _DataServices {
|
|
|
140155
140155
|
var u;
|
|
140156
140156
|
c.executeJS && ((u = c.executeJS) == null ? void 0 : u.length) > 3 && s.push(c.executeJS);
|
|
140157
140157
|
}), (s == null ? void 0 : s.length) > 0)
|
|
140158
|
-
return
|
|
140158
|
+
return _DataServices2.minify(s.join(";")).replaceAll(";;", ";");
|
|
140159
140159
|
}
|
|
140160
140160
|
static convertHTML(a) {
|
|
140161
140161
|
const s = {
|
|
@@ -140191,8 +140191,8 @@ const _DataServices = class _DataServices {
|
|
|
140191
140191
|
}
|
|
140192
140192
|
}
|
|
140193
140193
|
};
|
|
140194
|
-
yu(
|
|
140195
|
-
let
|
|
140194
|
+
yu(_DataServices2, "minify", (a) => a.replace(/\s+/g, ""));
|
|
140195
|
+
let DataServices2 = _DataServices2;
|
|
140196
140196
|
const useDebounce = (a, s = 500) => {
|
|
140197
140197
|
const [c, u] = useState(a);
|
|
140198
140198
|
return useEffect(
|
|
@@ -140258,10 +140258,10 @@ win$2.validateDatesRange = (a, s, c, u) => {
|
|
|
140258
140258
|
h = translate("StartDate>EndDateError");
|
|
140259
140259
|
const x = isMD ? currentMDColumns : currentColumns, _ = x[a], w = x[s];
|
|
140260
140260
|
if (_ && w) {
|
|
140261
|
-
const R =
|
|
140261
|
+
const R = DataServices2.getLocalText(
|
|
140262
140262
|
_.label,
|
|
140263
140263
|
_.labelEN
|
|
140264
|
-
), O =
|
|
140264
|
+
), O = DataServices2.getLocalText(
|
|
140265
140265
|
w.label,
|
|
140266
140266
|
w.labelEN
|
|
140267
140267
|
);
|
|
@@ -140279,10 +140279,10 @@ win$2.validateDatesRange = (a, s, c, u) => {
|
|
|
140279
140279
|
});
|
|
140280
140280
|
const x = isMD ? currentMDColumns : currentColumns, _ = x[a], w = x[s];
|
|
140281
140281
|
if (_ && w) {
|
|
140282
|
-
const R =
|
|
140282
|
+
const R = DataServices2.getLocalText(
|
|
140283
140283
|
_.label,
|
|
140284
140284
|
_.labelEN
|
|
140285
|
-
), O =
|
|
140285
|
+
), O = DataServices2.getLocalText(
|
|
140286
140286
|
w.label,
|
|
140287
140287
|
w.labelEN
|
|
140288
140288
|
);
|
|
@@ -140417,7 +140417,7 @@ win$2.setFieldValue = (a, s, c) => {
|
|
|
140417
140417
|
const m = dayjs(s).format("YYYY-MM-DDTHH:mm:ss");
|
|
140418
140418
|
h.setAttribute("value", m), h.innerHTML = u ?? "";
|
|
140419
140419
|
} else
|
|
140420
|
-
p.setAttribute("value", s), f.realType === "number" && (u =
|
|
140420
|
+
p.setAttribute("value", s), f.realType === "number" && (u = DataServices2.displayNumber(u, {
|
|
140421
140421
|
isPercentages: f.isPercentages,
|
|
140422
140422
|
numberOfDecimalPlaces: f.numberOfDecimalPlaces
|
|
140423
140423
|
}), d && (u = `= ${u}`)), p.innerHTML = u ?? "";
|
|
@@ -140890,7 +140890,7 @@ class DynamicWorkflowService {
|
|
|
140890
140890
|
);
|
|
140891
140891
|
m.formFormat = y, m.workflowSteps = C;
|
|
140892
140892
|
}
|
|
140893
|
-
const g =
|
|
140893
|
+
const g = DataServices2.encrypt(JSON.stringify(this.formatData(m))) ?? "";
|
|
140894
140894
|
if (c)
|
|
140895
140895
|
navigator.clipboard.writeText(g), staticMethods$1.success(translate("Copied data").toString());
|
|
140896
140896
|
else {
|
|
@@ -140899,7 +140899,10 @@ class DynamicWorkflowService {
|
|
|
140899
140899
|
}), C = window.URL.createObjectURL(y), x = document.createElement("a");
|
|
140900
140900
|
x.href = C, x.setAttribute(
|
|
140901
140901
|
"download",
|
|
140902
|
-
`${
|
|
140902
|
+
`${DataServices2.getLocalText(
|
|
140903
|
+
s.title,
|
|
140904
|
+
s.titleEN
|
|
140905
|
+
)}.txt`
|
|
140903
140906
|
), x.click();
|
|
140904
140907
|
}
|
|
140905
140908
|
}
|
|
@@ -171892,7 +171895,7 @@ const EditableCell = (a) => {
|
|
|
171892
171895
|
onChange: g,
|
|
171893
171896
|
changeOptionOfCol: y,
|
|
171894
171897
|
...C
|
|
171895
|
-
} = a, { isMobileApp: x } = useDevice(), _ = useContext$1(WorkflowFormContext), [w, R] = useState(""), O =
|
|
171898
|
+
} = a, { isMobileApp: x } = useDevice(), _ = useContext$1(WorkflowFormContext), [w, R] = useState(""), O = DataServices2.useDebounce(w, 500), [k, A] = useState([]);
|
|
171896
171899
|
useEffect(() => {
|
|
171897
171900
|
p && P(O);
|
|
171898
171901
|
}, [O]);
|
|
@@ -172120,7 +172123,7 @@ const EditableCell = (a) => {
|
|
|
172120
172123
|
max: p.maximum,
|
|
172121
172124
|
precision: p.numberOfDecimalPlaces,
|
|
172122
172125
|
step: p.numberOfDecimalPlaces ? 1 / Math.pow(10, p.numberOfDecimalPlaces) : 0,
|
|
172123
|
-
formatter: (ye) => ye ? `${
|
|
172126
|
+
formatter: (ye) => ye ? `${DataServices2.thousandsSeparator(ye.toString())}${p.isPercentages ? "%" : ""}` : "",
|
|
172124
172127
|
parser: (ye) => ye ? parseFloat(
|
|
172125
172128
|
ye.replace("%", "").replace(/,/, "#").replace(/\./g, "").replace(/#/, ".")
|
|
172126
172129
|
) : "",
|
|
@@ -172211,7 +172214,7 @@ const EditableCell = (a) => {
|
|
|
172211
172214
|
if (p) {
|
|
172212
172215
|
if (p.realType === "number" && p.viewOnly && f && f[1]) {
|
|
172213
172216
|
const se = f[1].toString();
|
|
172214
|
-
return se.includes("= ") ? se.replaceAll("= ", "") :
|
|
172217
|
+
return se.includes("= ") ? se.replaceAll("= ", "") : DataServices2.displayNumber(se);
|
|
172215
172218
|
}
|
|
172216
172219
|
switch (p.type) {
|
|
172217
172220
|
case "checkbox":
|
|
@@ -172247,9 +172250,9 @@ const EditableCell = (a) => {
|
|
|
172247
172250
|
return ge && (se = ge.label), se ?? f;
|
|
172248
172251
|
}
|
|
172249
172252
|
case "number":
|
|
172250
|
-
return f && f[1] ?
|
|
172253
|
+
return f && f[1] ? DataServices2.displayNumber((te = f[1]) == null ? void 0 : te.toString()) : 0;
|
|
172251
172254
|
case "currency":
|
|
172252
|
-
return f && f[1] ?
|
|
172255
|
+
return f && f[1] ? DataServices2.displayNumber((ae = f[1]) == null ? void 0 : ae.toString()) : "";
|
|
172253
172256
|
case "dateTime":
|
|
172254
172257
|
return f && f[1] ? p.isDateOnly ? dayjs(f[1].toString()).format("DD/MM/YYYY") : dayjs(f[1].toString()).format("DD/MM/YYYY HH:mm") : "";
|
|
172255
172258
|
default:
|
|
@@ -172270,7 +172273,7 @@ const EditableCell = (a) => {
|
|
|
172270
172273
|
return ge && (se = ge.label), se;
|
|
172271
172274
|
}
|
|
172272
172275
|
case "number":
|
|
172273
|
-
return f ?
|
|
172276
|
+
return f ? DataServices2.displayNumber((oe = f[1]) == null ? void 0 : oe.toString()) : 0;
|
|
172274
172277
|
default:
|
|
172275
172278
|
return f;
|
|
172276
172279
|
}
|
|
@@ -172498,7 +172501,7 @@ function MasterDetailTableComponent({
|
|
|
172498
172501
|
const c = { ...col, executeJs };
|
|
172499
172502
|
if (id === -1 && !executeJs.includes("MMD"))
|
|
172500
172503
|
return;
|
|
172501
|
-
masterDetailIndex !== void 0 &&
|
|
172504
|
+
masterDetailIndex !== void 0 && DataServices2.executeWorkflowJSMasterDetail(
|
|
172502
172505
|
c,
|
|
172503
172506
|
userWorkflowForm,
|
|
172504
172507
|
userWorkflowCols,
|
|
@@ -172725,11 +172728,11 @@ function MasterDetailTableComponent({
|
|
|
172725
172728
|
s.forEach((h) => {
|
|
172726
172729
|
var g;
|
|
172727
172730
|
let m = p[h] ?? 0;
|
|
172728
|
-
(g = m == null ? void 0 : m.toString()) != null && g.includes("= ") && (m =
|
|
172731
|
+
(g = m == null ? void 0 : m.toString()) != null && g.includes("= ") && (m = DataServices2.formatNumberString(m.replace("= ", ""))), c[h] += Number(m);
|
|
172729
172732
|
}), u.forEach((h) => {
|
|
172730
172733
|
var g;
|
|
172731
172734
|
let m = p[h] ?? 0;
|
|
172732
|
-
(g = m == null ? void 0 : m.toString()) != null && g.includes("= ") && (m =
|
|
172735
|
+
(g = m == null ? void 0 : m.toString()) != null && g.includes("= ") && (m = DataServices2.formatNumberString(m.replace("= ", ""))), d[h] += Number(m);
|
|
172733
172736
|
});
|
|
172734
172737
|
}), c.id = "sum", s.length > 0 && setSumRow(c), u.length > 0 && d) {
|
|
172735
172738
|
const p = {};
|
|
@@ -172757,7 +172760,7 @@ function MasterDetailTableComponent({
|
|
|
172757
172760
|
(x = (C = w[h]) == null ? void 0 : C.toString()) != null && x.includes("= ") ? g.innerHTML = w[h].replace(
|
|
172758
172761
|
"= ",
|
|
172759
172762
|
""
|
|
172760
|
-
) : g.innerHTML =
|
|
172763
|
+
) : g.innerHTML = DataServices2.displayNumber(
|
|
172761
172764
|
w[h]
|
|
172762
172765
|
);
|
|
172763
172766
|
}
|
|
@@ -173048,7 +173051,7 @@ function MasterDetailTableComponent({
|
|
|
173048
173051
|
"text-bold",
|
|
173049
173052
|
`sum-${a.name}`
|
|
173050
173053
|
),
|
|
173051
|
-
children:
|
|
173054
|
+
children: DataServices2.displayNumber(
|
|
173052
173055
|
sumRow[a.name]
|
|
173053
173056
|
)
|
|
173054
173057
|
}
|
|
@@ -173066,7 +173069,7 @@ function MasterDetailTableComponent({
|
|
|
173066
173069
|
className: "mobile-table-cell",
|
|
173067
173070
|
children: [
|
|
173068
173071
|
/* @__PURE__ */ jsx("span", { className: "label-cell", children: a.title }),
|
|
173069
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
173072
|
+
/* @__PURE__ */ jsx("span", { children: DataServices2.displayNumber(
|
|
173070
173073
|
sumRow[a.name]
|
|
173071
173074
|
) })
|
|
173072
173075
|
]
|
|
@@ -173098,7 +173101,7 @@ function MasterDetailTableComponent({
|
|
|
173098
173101
|
"text-bold",
|
|
173099
173102
|
`sum-${a.name}`
|
|
173100
173103
|
),
|
|
173101
|
-
children:
|
|
173104
|
+
children: DataServices2.displayNumber(
|
|
173102
173105
|
averageRow[a.name]
|
|
173103
173106
|
)
|
|
173104
173107
|
}
|
|
@@ -173116,7 +173119,7 @@ function MasterDetailTableComponent({
|
|
|
173116
173119
|
className: "mobile-table-cell",
|
|
173117
173120
|
children: [
|
|
173118
173121
|
/* @__PURE__ */ jsx("span", { className: "label-cell", children: a.title }),
|
|
173119
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
173122
|
+
/* @__PURE__ */ jsx("span", { children: DataServices2.displayNumber(
|
|
173120
173123
|
averageRow[a.name]
|
|
173121
173124
|
) })
|
|
173122
173125
|
]
|
|
@@ -173131,7 +173134,7 @@ function MasterDetailTableComponent({
|
|
|
173131
173134
|
breakpoint: 576,
|
|
173132
173135
|
dataLabel: (a) => {
|
|
173133
173136
|
var s;
|
|
173134
|
-
return ((s = a.pureTitle) == null ? void 0 : s.type) === "div" ?
|
|
173137
|
+
return ((s = a.pureTitle) == null ? void 0 : s.type) === "div" ? DataServices2.getLocalText(a.label, a.labelEN) : a.pureTitle;
|
|
173135
173138
|
}
|
|
173136
173139
|
}
|
|
173137
173140
|
}
|
|
@@ -173176,7 +173179,7 @@ const WORKFLOW_DESIGN_URL = "/admin/workflowdesign/dynamicworkflow", ErrorTexts
|
|
|
173176
173179
|
labelExitEN: "Exit"
|
|
173177
173180
|
};
|
|
173178
173181
|
function stripHtml(a) {
|
|
173179
|
-
return
|
|
173182
|
+
return DataServices2.htmlToText(a);
|
|
173180
173183
|
}
|
|
173181
173184
|
function ErrorMessage() {
|
|
173182
173185
|
return "Đã xảy ra lỗi, vui lòng thử lại";
|
|
@@ -173231,7 +173234,7 @@ const AttachItemActions = (a) => {
|
|
|
173231
173234
|
},
|
|
173232
173235
|
fileList: [],
|
|
173233
173236
|
multiple: !0,
|
|
173234
|
-
customRequest:
|
|
173237
|
+
customRequest: DataServices2.uploadFileRequest,
|
|
173235
173238
|
className: "upload-break-space dynamic-attach",
|
|
173236
173239
|
children: /* @__PURE__ */ jsx(Button, { status: "info", secondary: !0, children: s("ChooseFiles") })
|
|
173237
173240
|
}
|
|
@@ -173243,7 +173246,7 @@ const AttachItemActions = (a) => {
|
|
|
173243
173246
|
attachItem,
|
|
173244
173247
|
attachInfo,
|
|
173245
173248
|
attachName
|
|
173246
|
-
}, renderAttachIcon = (a) => a === "default" ? /* @__PURE__ */ jsx(SvgEyeOutlinedStyle, {}) :
|
|
173249
|
+
}, renderAttachIcon = (a) => a === "default" ? /* @__PURE__ */ jsx(SvgEyeOutlinedStyle, {}) : DataServices2.isImage(a) ? /* @__PURE__ */ jsx(SvgGalleryOutlinedStyle, { style: { color: "#f15791" } }) : DataServices2.isMSWord(a) ? /* @__PURE__ */ jsx(SvgDocumentWordOutlinedStyle, { style: { color: "#285191" } }) : DataServices2.isMSExcel(a) ? /* @__PURE__ */ jsx(SvgDocumentExcelOutlinedStyle, { style: { color: "#1d6c41" } }) : DataServices2.isMSPowerPoint(a) ? /* @__PURE__ */ jsx(SvgDocumentPptOutlinedStyle, { style: { color: "#c74223" } }) : DataServices2.isMSPdf(a) ? /* @__PURE__ */ jsx(SvgDocumentPdfOutlinedStyle, { style: { color: "#c74223" } }) : /* @__PURE__ */ jsx(SvgDocumentOutlinedStyle, {});
|
|
173247
173250
|
function AttachIcon(a) {
|
|
173248
173251
|
const s = a.extension ?? mime.getExtension(a.type ?? "");
|
|
173249
173252
|
return /* @__PURE__ */ jsx("div", { ...a, children: s ? renderAttachIcon(s) : void 0 });
|
|
@@ -173481,7 +173484,7 @@ const PageSection = (a) => {
|
|
|
173481
173484
|
) });
|
|
173482
173485
|
}, generatePreviewURL = async (a, s, c, u) => {
|
|
173483
173486
|
const d = mime.getExtension(s);
|
|
173484
|
-
if (
|
|
173487
|
+
if (DataServices2.isImage(d))
|
|
173485
173488
|
UserCheckListService.viewFile(a, c);
|
|
173486
173489
|
else {
|
|
173487
173490
|
const p = await UserCheckListService.generateFileURL(
|
|
@@ -173498,7 +173501,7 @@ function AttachPreviewButton({
|
|
|
173498
173501
|
fileName: u,
|
|
173499
173502
|
extension: d
|
|
173500
173503
|
}) {
|
|
173501
|
-
const { t: f } = useTrans(), [p, h] = useState(!1), m = mime.getExtension(s), g = m ?
|
|
173504
|
+
const { t: f } = useTrans(), [p, h] = useState(!1), m = mime.getExtension(s), g = m ? DataServices2.isImage(m) : !1;
|
|
173502
173505
|
function y() {
|
|
173503
173506
|
h(!0);
|
|
173504
173507
|
}
|
|
@@ -174105,7 +174108,7 @@ const card = "_card_165my_1", title = "_title_165my_9", titleIcon = "_titleIcon_
|
|
|
174105
174108
|
onOk: () => ze(Yt.key, Yt.workflowId)
|
|
174106
174109
|
});
|
|
174107
174110
|
}
|
|
174108
|
-
}), (Yt.type ?
|
|
174111
|
+
}), (Yt.type ? DataServices2.isImageFromType(Yt.type) : !1) && gn.unshift({
|
|
174109
174112
|
icon: /* @__PURE__ */ jsx(SvgEyeOutlinedStyle, { size: 20, color: "#f4c54d" }),
|
|
174110
174113
|
label: c("View"),
|
|
174111
174114
|
key: "1"
|
|
@@ -174171,7 +174174,7 @@ const card = "_card_165my_1", title = "_title_165my_9", titleIcon = "_titleIcon_
|
|
|
174171
174174
|
for (let dn = 0; dn < Vt.length; dn++) {
|
|
174172
174175
|
const hn = Vt[dn], zr = {
|
|
174173
174176
|
key: hn.id,
|
|
174174
|
-
documentTypeTitle:
|
|
174177
|
+
documentTypeTitle: DataServices2.getLocalText(
|
|
174175
174178
|
hn.documentTypeTitle,
|
|
174176
174179
|
hn.documentTypeTitleEN
|
|
174177
174180
|
),
|
|
@@ -177346,7 +177349,7 @@ Barcode.defaultProps = {
|
|
|
177346
177349
|
var reactBarcode = Barcode;
|
|
177347
177350
|
const Barcode$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(reactBarcode), renderNumber = (a) => {
|
|
177348
177351
|
var s;
|
|
177349
|
-
return (s = a.styleClass) != null && s.includes("number-en") && a.defaultValue ? Number(a.defaultValue).toLocaleString("it-IT") :
|
|
177352
|
+
return (s = a.styleClass) != null && s.includes("number-en") && a.defaultValue ? Number(a.defaultValue).toLocaleString("it-IT") : DataServices2.displayNumber(a.defaultValue, {
|
|
177350
177353
|
isPercentages: a.isPercentages,
|
|
177351
177354
|
numberOfDecimalPlaces: a.numberOfDecimalPlaces
|
|
177352
177355
|
});
|
|
@@ -177435,7 +177438,7 @@ const Barcode$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(reactBarcode), rende
|
|
|
177435
177438
|
);
|
|
177436
177439
|
if (C) {
|
|
177437
177440
|
const x = (p = C.label) == null ? void 0 : p.toString();
|
|
177438
|
-
x.length > 0 && (
|
|
177441
|
+
x.length > 0 && (DataServices2.checkUserItems(a.lookupItems) ? y = x.split(" - ")[0] : y = x);
|
|
177439
177442
|
}
|
|
177440
177443
|
}
|
|
177441
177444
|
return y;
|
|
@@ -177465,7 +177468,7 @@ const Barcode$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(reactBarcode), rende
|
|
|
177465
177468
|
default: {
|
|
177466
177469
|
let y = a.defaultValue;
|
|
177467
177470
|
if ((h = a.styleClass) != null && h.includes("clear-html"))
|
|
177468
|
-
y =
|
|
177471
|
+
y = DataServices2.htmlToText(y);
|
|
177469
177472
|
else if ((m = a.styleClass) != null && m.includes("is-user") && a.lookupItems && a.lookupItems.length > 0) {
|
|
177470
177473
|
const C = a.lookupItems.find(
|
|
177471
177474
|
(x) => x.value === y
|
|
@@ -177628,7 +177631,7 @@ const getLookupItems = (a) => [...a].filter((c) => c.userStatus === 1).map((c) =
|
|
|
177628
177631
|
value: c.value
|
|
177629
177632
|
})), renderField = (a, s, c) => {
|
|
177630
177633
|
var O, k, A, I, P, j, F;
|
|
177631
|
-
const { key: u, col: d, value: f, onChange: p, changeOptionOfCol: h } = a, [m, g] = useState(""), y =
|
|
177634
|
+
const { key: u, col: d, value: f, onChange: p, changeOptionOfCol: h } = a, [m, g] = useState(""), y = DataServices2.useDebounce(m, 500), [C, x] = useState([]);
|
|
177632
177635
|
useEffect(() => {
|
|
177633
177636
|
d && _(y);
|
|
177634
177637
|
}, [y]);
|
|
@@ -177798,7 +177801,7 @@ const getLookupItems = (a) => [...a].filter((c) => c.userStatus === 1).map((c) =
|
|
|
177798
177801
|
max: d.maximum,
|
|
177799
177802
|
precision: d.numberOfDecimalPlaces,
|
|
177800
177803
|
step: d.numberOfDecimalPlaces ? 1 / Math.pow(10, d.numberOfDecimalPlaces) : 0,
|
|
177801
|
-
formatter: (Z) => Z ? `${
|
|
177804
|
+
formatter: (Z) => Z ? `${DataServices2.thousandsSeparator(Z.toString())}${d.isPercentages ? "%" : ""}` : "",
|
|
177802
177805
|
parser: (Z) => Z ? parseFloat(
|
|
177803
177806
|
Z.replace("%", "").replace(/,/, "#").replace(/\./g, "").replace(/#/, ".")
|
|
177804
177807
|
) : "",
|
|
@@ -178962,7 +178965,7 @@ function SendUserWorkflowActionsModal({
|
|
|
178962
178965
|
!0
|
|
178963
178966
|
);
|
|
178964
178967
|
if (ft.success) {
|
|
178965
|
-
const ht =
|
|
178968
|
+
const ht = DataServices2.getUsers(
|
|
178966
178969
|
ft.value.items,
|
|
178967
178970
|
h.userType
|
|
178968
178971
|
);
|
|
@@ -179134,7 +179137,7 @@ function SendUserWorkflowActionsModal({
|
|
|
179134
179137
|
Upload,
|
|
179135
179138
|
{
|
|
179136
179139
|
multiple: !0,
|
|
179137
|
-
customRequest:
|
|
179140
|
+
customRequest: DataServices2.uploadFileRequest,
|
|
179138
179141
|
beforeUpload: (Ve) => {
|
|
179139
179142
|
const gt = s.maximumSizeSingle;
|
|
179140
179143
|
return Ve.size > gt * 1048576 && gt > 0 ? (staticMethods$1.error(`${p("MaximumSizeAllowed")}: ${gt} MB`), Upload.LIST_IGNORE) : Ve;
|
|
@@ -179704,10 +179707,10 @@ function ProcessStepItem(a) {
|
|
|
179704
179707
|
allowClear: !0,
|
|
179705
179708
|
filterOption: (h, m) => {
|
|
179706
179709
|
var g, y, C;
|
|
179707
|
-
return ((C =
|
|
179710
|
+
return ((C = DataServices2.removeVietnameseTones(
|
|
179708
179711
|
(y = (g = m == null ? void 0 : m.children) == null ? void 0 : g.toString()) == null ? void 0 : y.toLowerCase()
|
|
179709
179712
|
)) == null ? void 0 : C.indexOf(
|
|
179710
|
-
|
|
179713
|
+
DataServices2.removeVietnameseTones(h.toLowerCase())
|
|
179711
179714
|
)) >= 0;
|
|
179712
179715
|
},
|
|
179713
179716
|
onChange: (h) => {
|
|
@@ -180101,7 +180104,7 @@ function AddRelatedWorkModal({
|
|
|
180101
180104
|
dataIndex: "shortContent",
|
|
180102
180105
|
key: "shortContent",
|
|
180103
180106
|
width: "40%",
|
|
180104
|
-
render: (be) =>
|
|
180107
|
+
render: (be) => DataServices2.htmlToText(be)
|
|
180105
180108
|
},
|
|
180106
180109
|
{
|
|
180107
180110
|
title: h("CreatedBy"),
|
|
@@ -180535,7 +180538,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
180535
180538
|
dataIndex: "content",
|
|
180536
180539
|
render: (X, ee) => {
|
|
180537
180540
|
var Z;
|
|
180538
|
-
return
|
|
180541
|
+
return DataServices2.htmlToText(
|
|
180539
180542
|
ee.content ?? ((Z = ee.linkUserWorkflow) == null ? void 0 : Z.content)
|
|
180540
180543
|
);
|
|
180541
180544
|
}
|
|
@@ -180636,7 +180639,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
180636
180639
|
}
|
|
180637
180640
|
)
|
|
180638
180641
|
] }),
|
|
180639
|
-
description:
|
|
180642
|
+
description: DataServices2.htmlToText(
|
|
180640
180643
|
V.content ?? ((ee = V.linkUserWorkflow) == null ? void 0 : ee.content)
|
|
180641
180644
|
),
|
|
180642
180645
|
descriptionStyle: { fontWeight: "600" },
|
|
@@ -181053,7 +181056,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181053
181056
|
}), setMasterDetailFormats(c);
|
|
181054
181057
|
}
|
|
181055
181058
|
function mapDropDownValueIntoProperty(a, s) {
|
|
181056
|
-
|
|
181059
|
+
DataServices2 == null || DataServices2.mapDropDownValueIntoProperty({
|
|
181057
181060
|
form,
|
|
181058
181061
|
data: s,
|
|
181059
181062
|
choiceName: a,
|
|
@@ -181124,7 +181127,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181124
181127
|
c && fetchRelatedWorkflows(c)
|
|
181125
181128
|
]) : setActions({
|
|
181126
181129
|
allowExit: !0,
|
|
181127
|
-
labelExit:
|
|
181130
|
+
labelExit: DataServices2.getLocalText(
|
|
181128
181131
|
defaultButtonLabels.labelExitEN,
|
|
181129
181132
|
defaultButtonLabels.labelExit
|
|
181130
181133
|
)
|
|
@@ -181496,7 +181499,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181496
181499
|
try {
|
|
181497
181500
|
if (setIsAdding(!0), userWorkflowStatus !== UserWorkflowStatus["Đã phê duyệt"] || (workflow == null ? void 0 : workflow.workflowType) === WorkflowType.Resource || (workflow == null ? void 0 : workflow.workflowType) === WorkflowType.Application || activeEditUserWorkflow) {
|
|
181498
181501
|
let h = { ...a };
|
|
181499
|
-
const m =
|
|
181502
|
+
const m = DataServices2.setValuesFromJS(a, workflow);
|
|
181500
181503
|
if (m.isSuccess) {
|
|
181501
181504
|
h = m.data;
|
|
181502
181505
|
const g = [];
|
|
@@ -181512,7 +181515,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181512
181515
|
_ && typeof _ == "object" && !(Array != null && Array.isArray(_)) && ((w = Object.prototype.hasOwnProperty) != null && w.call(_, "label")) && ((R = Object.prototype.hasOwnProperty) != null && R.call(_, "value")) && (_ = _.value);
|
|
181513
181516
|
_ === "" && (_ = void 0), g.push({ name: x, value: _ });
|
|
181514
181517
|
}), masterDetailValues && Object.keys(masterDetailValues).forEach((x, _) => {
|
|
181515
|
-
const w =
|
|
181518
|
+
const w = DataServices2.formatListData(
|
|
181516
181519
|
masterDetailValues[x],
|
|
181517
181520
|
masterDetailFormats[_]
|
|
181518
181521
|
);
|
|
@@ -181521,7 +181524,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181521
181524
|
value: w && JSON.stringify(w)
|
|
181522
181525
|
});
|
|
181523
181526
|
});
|
|
181524
|
-
const y =
|
|
181527
|
+
const y = DataServices2 == null ? void 0 : DataServices2.mapArrays(
|
|
181525
181528
|
userWorkflowValues,
|
|
181526
181529
|
g,
|
|
181527
181530
|
"name",
|
|
@@ -181569,7 +181572,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181569
181572
|
checkValidFiles(!1) && MasterDetailService.validate(masterDetailsRef) && await updateUserWorkflow(a) === !0 && (staticMethods$1.success(t("UpdatedSuccessfully")), goBack && goBack());
|
|
181570
181573
|
}
|
|
181571
181574
|
function onFinishFailed() {
|
|
181572
|
-
|
|
181575
|
+
DataServices2.checkValidFiles(!1, attachDataSource, attachForm, !1);
|
|
181573
181576
|
}
|
|
181574
181577
|
function generateCopyWorkflowsDropdownItems() {
|
|
181575
181578
|
var s;
|
|
@@ -181616,7 +181619,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181616
181619
|
}
|
|
181617
181620
|
return s;
|
|
181618
181621
|
}
|
|
181619
|
-
const checkValidFiles = (a) =>
|
|
181622
|
+
const checkValidFiles = (a) => DataServices2.checkValidFiles(
|
|
181620
181623
|
a,
|
|
181621
181624
|
attachDataSource,
|
|
181622
181625
|
attachForm,
|
|
@@ -181654,7 +181657,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181654
181657
|
});
|
|
181655
181658
|
}
|
|
181656
181659
|
function checkFilterFromLookupItems(a, s) {
|
|
181657
|
-
const c =
|
|
181660
|
+
const c = DataServices2.checkFilterFromLookupItems(
|
|
181658
181661
|
a,
|
|
181659
181662
|
s,
|
|
181660
181663
|
rows,
|
|
@@ -181689,20 +181692,20 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181689
181692
|
};
|
|
181690
181693
|
useEffect(() => {
|
|
181691
181694
|
if (workflow && rows.length > 0 && !isLoading) {
|
|
181692
|
-
const a =
|
|
181695
|
+
const a = DataServices2.getAllWorkflowScripts(workflow);
|
|
181693
181696
|
setAllScripts(a ?? ""), setTimeout(() => {
|
|
181694
|
-
|
|
181697
|
+
DataServices2.executeWorkflowJS(workflow, rows, form);
|
|
181695
181698
|
}, 500);
|
|
181696
181699
|
}
|
|
181697
181700
|
}, [workflow, rows.length, isLoading]), useEffect(() => {
|
|
181698
181701
|
var a;
|
|
181699
181702
|
if (workflow && ((a = changedFields[0]) != null && a.validated)) {
|
|
181700
181703
|
const s = changedFields[0].name;
|
|
181701
|
-
allScripts != null && allScripts.includes(s[0]) &&
|
|
181704
|
+
allScripts != null && allScripts.includes(s[0]) && DataServices2.executeWorkflowJS(workflow, rows, form, !0);
|
|
181702
181705
|
}
|
|
181703
181706
|
}, [changedFields, allScripts]);
|
|
181704
181707
|
const handleChangeFields = (a) => {
|
|
181705
|
-
workflow &&
|
|
181708
|
+
workflow && DataServices2.changeFieldsValue(a, allScripts, workflow, rows, form);
|
|
181706
181709
|
};
|
|
181707
181710
|
return /* @__PURE__ */ jsx(HelmetProvider, { children: /* @__PURE__ */ jsxs(
|
|
181708
181711
|
WorkflowFormContext.Provider,
|
|
@@ -181775,14 +181778,14 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181775
181778
|
"user-workflow-priority",
|
|
181776
181779
|
(isMobileApp || isFullscreenApp) && "user-workflow-priority-mobile"
|
|
181777
181780
|
),
|
|
181778
|
-
children:
|
|
181781
|
+
children: DataServices2.getLocalText(
|
|
181779
181782
|
priority.title,
|
|
181780
181783
|
priority.titleEN
|
|
181781
181784
|
)
|
|
181782
181785
|
}
|
|
181783
181786
|
),
|
|
181784
181787
|
/* @__PURE__ */ jsxs("div", { className: "fc-body", children: [
|
|
181785
|
-
/* @__PURE__ */ jsx("h2", { className: "fc-title", children: (workflow == null ? void 0 : workflow.title) &&
|
|
181788
|
+
/* @__PURE__ */ jsx("h2", { className: "fc-title", children: (workflow == null ? void 0 : workflow.title) && DataServices2.getLocalText(
|
|
181786
181789
|
workflow.title,
|
|
181787
181790
|
workflow.titleEN
|
|
181788
181791
|
) }),
|
|
@@ -181916,7 +181919,7 @@ const RelatedUserWorkflowSection = (a) => {
|
|
|
181916
181919
|
...form.getFieldsValue(),
|
|
181917
181920
|
...d
|
|
181918
181921
|
}), setTimeout(() => {
|
|
181919
|
-
workflow &&
|
|
181922
|
+
workflow && DataServices2.executeWorkflowJS(
|
|
181920
181923
|
workflow,
|
|
181921
181924
|
rows,
|
|
181922
181925
|
form,
|
|
@@ -22,7 +22,7 @@ export declare const STATUS_TYPES: {
|
|
|
22
22
|
export type FileType = UploadChangeParam<UploadFile<any>> & {
|
|
23
23
|
note: string;
|
|
24
24
|
};
|
|
25
|
-
export declare class
|
|
25
|
+
export declare class DataServices2 {
|
|
26
26
|
static uploadFileRequest({ file, onSuccess }: any): void;
|
|
27
27
|
static handleFiles(key: number, selectedFiles: any, info: UploadChangeParam<UploadFile<any>>): any[];
|
|
28
28
|
static IsEmail(text: string): boolean;
|