ywana-core8 0.0.764 → 0.0.766
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/index.cjs +17 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +17 -8
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +17 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain2/CollectionContext.js +4 -2
- package/src/html/table.js +16 -4
package/package.json
CHANGED
@@ -24,8 +24,10 @@ export const CollectionContextProvider = (props) => {
|
|
24
24
|
}, [filters])
|
25
25
|
|
26
26
|
useEffect(() => {
|
27
|
-
|
28
|
-
|
27
|
+
if (Object.keys(customFilters).length > 0) {
|
28
|
+
console.log("CONTEXT LOAD for CustomFilters", customFilters)
|
29
|
+
load()
|
30
|
+
}
|
29
31
|
}, [customFilters])
|
30
32
|
|
31
33
|
async function load() {
|
package/src/html/table.js
CHANGED
@@ -251,8 +251,10 @@ const BooleanCellViewer = ({ id, value = false }) => {
|
|
251
251
|
const NumberCellViewer = ({ id, value, format, maxDecimals }) => {
|
252
252
|
|
253
253
|
function formatNumber(number) {
|
254
|
+
// convert number to numeric
|
254
255
|
if (number === null) return "null"
|
255
|
-
|
256
|
+
const number2 = Number(number)
|
257
|
+
let result = number2.toLocaleString('es-ES', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
256
258
|
// thousands separator is a dot
|
257
259
|
var parts = result.toString().split(",");
|
258
260
|
const numberPart = parts[0];
|
@@ -268,9 +270,19 @@ const NumberCellViewer = ({ id, value, format, maxDecimals }) => {
|
|
268
270
|
case FORMATS.PERCENT:
|
269
271
|
return <span>{value.toLocaleString('es-ES', { style: 'percent', minimumFractionDigits: 2 })}</span>
|
270
272
|
case "ES_es":
|
271
|
-
|
272
|
-
|
273
|
-
|
273
|
+
|
274
|
+
// convert value to number
|
275
|
+
let number = Number(value)
|
276
|
+
|
277
|
+
// if value is not a number, return value
|
278
|
+
if (isNaN(number)) return value
|
279
|
+
|
280
|
+
// if maxDecimals is defined, round number
|
281
|
+
if (maxDecimals) number = number.toFixed(maxDecimals)
|
282
|
+
|
283
|
+
// format number
|
284
|
+
return <span>{formatNumber(number)}</span>
|
285
|
+
|
274
286
|
default:
|
275
287
|
return <span>{value}</span>
|
276
288
|
}
|