@amirjalili1374/ui-kit 1.5.99 → 1.6.1

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/ui-kit.es.js CHANGED
@@ -38898,10 +38898,17 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
38898
38898
  } else if (header.type === "date" || header.isDate) {
38899
38899
  if (value2 !== null && value2 !== void 0 && value2 !== "") {
38900
38900
  try {
38901
- value2 = DateConverter.toShamsi(value2);
38901
+ const date = DateConverter.toShamsi(value2);
38902
+ value2 = "‏" + date;
38902
38903
  } catch {
38904
+ value2 = "‏" + value2;
38903
38905
  }
38904
38906
  }
38907
+ } else if (header.type === "money") {
38908
+ if (value2 !== null && value2 !== void 0 && value2 !== "") {
38909
+ const num = Number(value2);
38910
+ value2 = !isNaN(num) ? num : value2;
38911
+ }
38905
38912
  } else if (typeof value2 === "boolean") {
38906
38913
  value2 = value2 ? "بله" : "خیر";
38907
38914
  }
@@ -38913,6 +38920,16 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
38913
38920
  worksheet["!cols"] = validHeaders.map((h2) => ({
38914
38921
  wch: h2.width ? Math.max(10, Math.round(h2.width / 7)) : 20
38915
38922
  }));
38923
+ const moneyColumns = validHeaders.map((h2, i) => h2.type === "money" ? i : -1).filter((i) => i !== -1);
38924
+ moneyColumns.forEach((colIdx) => {
38925
+ for (let rowIdx = 1; rowIdx <= excelData.length; rowIdx++) {
38926
+ const cellAddress = utils.encode_cell({ r: rowIdx, c: colIdx });
38927
+ const cell = worksheet[cellAddress];
38928
+ if (cell && typeof cell.v === "number") {
38929
+ cell.z = "#,##0";
38930
+ }
38931
+ }
38932
+ });
38916
38933
  const workbook = utils.book_new();
38917
38934
  utils.book_append_sheet(workbook, worksheet, "Data Export");
38918
38935
  const safeName = (props.exportFileName || "export-data").trim();