@megha-ui/react 1.2.136 → 1.2.138

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.
@@ -58,6 +58,7 @@ const dropdown_1 = __importDefault(require("../dropdown"));
58
58
  const loader_1 = __importDefault(require("../loader"));
59
59
  const button_1 = __importDefault(require("../button"));
60
60
  const tb_1 = require("react-icons/tb");
61
+ const commonService_1 = require("../../services/commonService");
61
62
  const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable = true, paginate, rowsPerPageOptions = [10, 20, 50, 100], defaultRowsPerPage = 100, widthMode = "custom", bulkSelect = false, cellBorder = false, rowHeight = 38, onRowClick, rowCount = false, rowBorder = true, showMenu = false, search = false, defaultSearchOperation = "contains", gridBorder = false, isLoading = false, rowTopBorder, rowBottomBorder, rowLeftBorder, rowRightBorder, headerBackground = "var(--row-header-bg)", headerTopBorder = "none", headerBottomBorder = "none", SettingIcon, ExportIcon, ignoredExportItems = ["action", "actions"], borderColor = "#dbdfe9", updateColumns, showHideAvailable = false, columnSearchOutside = false, multiSorting = false, exportAvailable = false, exportableFileName = "", groupBy, updateGroupBy, rowKey = "id", hlBorderColor = "black", selectedRow, selectedRowStyle = {
62
63
  borderLeft: "0.5rem solid #d9d9d9",
63
64
  }, defaultSort, noKeyEvents = true, customOperation, hasCustomOperation, globalSearch, headerDropdownIndex, draggable = false, resizable = false, updateGridData, widthUnits, checkboxWrapper, ignoreHugContent = false, setRendered, isSummarise = true, fullScreenAvailable = true, defaultGroupOpen, alternateRowColor = true, activeCalculateColor = "#2377BA", calculatetextColor = "#fff", actionsKey = "actions", saveAsNewView = false, handleSaveAsView, saveAsViewIcon, filterData, chipColor = "#ccc", withAscii = false, propSummariseKeys, SummariseIcon, summarizeColor = "black", isExpandable = false, expandedRow, extraRow, selectedCheckBox, setSelectedCheckbox, ignoreRowSelect, setOpenedRows, openedRows, getLoadingState, globalSearchOpen = false, updateFixedFilterValues = (fixedFilterValues) => {
@@ -847,7 +848,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
847
848
  const exportableJson = sortedData.map((item) => {
848
849
  const newItem = filterColumns.reduce((acc, column) => {
849
850
  if (!ignoredExportItems.includes(column.key) && item[column.key]) {
850
- acc[column.key] = item[column.key].value;
851
+ acc[column.key] = (0, commonService_1.formatValue)(item[column.key].value, locale, formatOptions);
851
852
  }
852
853
  return acc;
853
854
  }, {});
@@ -153,7 +153,7 @@ export interface OjasGridProps {
153
153
  updateFixedFilterValues?: (fixedFilterValues: {
154
154
  [key: string]: string[];
155
155
  }) => void;
156
- locale?: string;
156
+ locale: string;
157
157
  formatOptions?: any;
158
158
  }
159
159
  export interface GroupedRowProps {
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatValue = void 0;
4
4
  const regexUtils_1 = require("../components/grid/utils/regexUtils");
5
5
  // Function to format numbers
6
- const formatNumber = (value, locale = "sv-SE") => {
7
- const formatter = new Intl.NumberFormat(locale);
6
+ const formatNumber = (value, locale = "sv-SE", options) => {
7
+ const formatter = new Intl.NumberFormat(locale, options);
8
8
  return formatter.format(value);
9
9
  };
10
10
  // ISO-like string including local time (no timezone)
@@ -162,7 +162,7 @@ const formatCurrency = (value, locale = "sv-SE", currency = "SEK", options) => {
162
162
  const formatValue = (value, type = "number", locale = "sv-SE", options) => {
163
163
  if (type === "number") {
164
164
  const num = parseFloat(value.toString());
165
- return formatNumber(num, locale);
165
+ return formatNumber(num, locale, { useGrouping: false });
166
166
  }
167
167
  else if (type === "date") {
168
168
  let date = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.136",
3
+ "version": "1.2.138",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",