@amirjalili1374/ui-kit 1.5.99 → 1.6.0

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