@megha-ui/react 1.2.126 → 1.2.128

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,19 +58,20 @@ const getColumnData = (columnKey, gridData, type) => {
58
58
  : data[columnKey].value
59
59
  : data[columnKey].value)),
60
60
  ];
61
+ console.log({ returnedValue });
61
62
  return returnedValue.sort((a, b) => {
62
63
  const aValue = a
63
- ? type === "number"
64
+ ? type === "number" || type === "currency"
64
65
  ? parseFloat(a === null || a === void 0 ? void 0 : a.toString())
65
66
  : a === null || a === void 0 ? void 0 : a.toString().toUpperCase()
66
- : type === "number"
67
+ : type === "number" || type === "currency"
67
68
  ? 0
68
69
  : "";
69
70
  const bValue = b
70
- ? type === "number"
71
+ ? type === "number" || type === "currency"
71
72
  ? parseFloat(b === null || b === void 0 ? void 0 : b.toString())
72
73
  : b === null || b === void 0 ? void 0 : b.toString().toUpperCase()
73
- : type === "number"
74
+ : type === "number" || type === "currency"
74
75
  ? 0
75
76
  : "";
76
77
  if (aValue < bValue)
@@ -134,7 +134,7 @@ const formatValue = (value, type = "number", locale = "sv-SE", options) => {
134
134
  date = d ? toISODateTime(d) : "";
135
135
  }
136
136
  if (date) {
137
- const { dateStyle, timeStyle, weekday, era, year, month, day, hour, minute, second, hour12, hourCycle, timeZone, timeZoneName, fractionalSecondDigits, } = options;
137
+ const { dateStyle, timeStyle, weekday, era, year, month, day, hour, minute, second, hour12, hourCycle, timeZone, timeZoneName, fractionalSecondDigits, } = options !== null && options !== void 0 ? options : {};
138
138
  return formatDate(new Date(date).getTime(), locale, {
139
139
  dateStyle,
140
140
  timeStyle,
@@ -157,7 +157,7 @@ const formatValue = (value, type = "number", locale = "sv-SE", options) => {
157
157
  }
158
158
  else if (type === "currency") {
159
159
  const num = parseFloat(value.toString());
160
- const { currency, currencyDisplay, currencySign, notation, compactDisplay, minimumFractionDigits, maximumFractionDigits, minimumSignificantDigits, maximumSignificantDigits, useGrouping, roundingMode, roundingIncrement, } = options;
160
+ const { currency, currencyDisplay, currencySign, notation, compactDisplay, minimumFractionDigits, maximumFractionDigits, minimumSignificantDigits, maximumSignificantDigits, useGrouping, roundingMode, roundingIncrement, } = options !== null && options !== void 0 ? options : {};
161
161
  return formatCurrency(num, locale, currency, {
162
162
  currencyDisplay,
163
163
  currencySign,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.126",
3
+ "version": "1.2.128",
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",