ywana-core8 0.0.866 → 0.0.867

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.866",
3
+ "version": "0.0.867",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
package/src/html/table.js CHANGED
@@ -123,7 +123,7 @@ export const DataTable = (props) => {
123
123
  </thead>
124
124
  <tbody>
125
125
 
126
- { filterable ? <DataTableFiltersRow columns={columns} /> : null }
126
+ {filterable ? <DataTableFiltersRow columns={columns} /> : null}
127
127
 
128
128
  {rows.length > 0 ?
129
129
  multiSort(rows, sortDir).map((row, index) => (
@@ -149,9 +149,11 @@ const DataTableFiltersRow = ({ columns }) => {
149
149
  return (
150
150
  <tr className="filters-row">
151
151
  {columns.map(({ id, filterable, onFilter }) => {
152
- <td className='filter-cell'>
153
- { filterable ? <TextField id={id} onChange={onFilter} /> : null }
154
- </td>
152
+ return (
153
+ <td className='filter-cell'>
154
+ {filterable ? <TextField id={id} onChange={onFilter} /> : null}
155
+ </td>
156
+ )
155
157
  })}
156
158
  </tr>
157
159
  )
@@ -279,20 +281,20 @@ const BooleanCellViewer = ({ id, value = false }) => {
279
281
  * NumberCellViewer
280
282
  */
281
283
  const NumberCellViewer = ({ id, value, format, maxDecimals }) => {
282
- /*
283
- function formatNumber(number) {
284
- // convert number to numeric
285
- if (number === null) return "null"
286
- const number2 = Number(number)
287
- let result = number2.toLocaleString('es-ES', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
288
- // thousands separator is a dot
289
- var parts = result.toString().split(",");
290
- const numberPart = parts[0];
291
- const decimalPart = parts[1];
292
- const thousands = /\B(?=(\d{3})+(?!\d))/g;
293
- return numberPart.replace(thousands, ".") + (decimalPart ? "," + decimalPart : "");
294
- }
295
- */
284
+ /*
285
+ function formatNumber(number) {
286
+ // convert number to numeric
287
+ if (number === null) return "null"
288
+ const number2 = Number(number)
289
+ let result = number2.toLocaleString('es-ES', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
290
+ // thousands separator is a dot
291
+ var parts = result.toString().split(",");
292
+ const numberPart = parts[0];
293
+ const decimalPart = parts[1];
294
+ const thousands = /\B(?=(\d{3})+(?!\d))/g;
295
+ return numberPart.replace(thousands, ".") + (decimalPart ? "," + decimalPart : "");
296
+ }
297
+ */
296
298
  function formatNumber(number, maxDecimals = 0) {
297
299
  if (number === null) return "null"
298
300
  let result = number.toLocaleString('es-ES', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
@@ -301,7 +303,7 @@ const NumberCellViewer = ({ id, value, format, maxDecimals }) => {
301
303
  const numberPart = parts[0];
302
304
  const decimalPart = parts[1];
303
305
  const thousands = /\B(?=(\d{3})+(?!\d))/g;
304
-
306
+
305
307
  // limit decimal part to maxdecimals
306
308
  const decimal = decimalPart ? decimalPart.substring(0, maxDecimals) : null;
307
309
  return numberPart.replace(thousands, ".") + (decimal ? "," + decimal : "");