@asteby/metacore-runtime-react 53.23.1 → 53.24.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/addon-page-host.d.ts +6 -1
  3. package/dist/addon-page-host.d.ts.map +1 -1
  4. package/dist/addon-page-host.js +16 -2
  5. package/dist/dynamic-columns.d.ts +8 -0
  6. package/dist/dynamic-columns.d.ts.map +1 -1
  7. package/dist/dynamic-columns.js +30 -1
  8. package/dist/host-api-client.d.ts +55 -0
  9. package/dist/host-api-client.d.ts.map +1 -0
  10. package/dist/host-api-client.js +85 -0
  11. package/dist/host-api-context.d.ts +10 -0
  12. package/dist/host-api-context.d.ts.map +1 -0
  13. package/dist/host-api-context.js +10 -0
  14. package/dist/host-api.d.ts.map +1 -1
  15. package/dist/host-api.js +4 -0
  16. package/dist/index.d.ts +3 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +3 -0
  19. package/dist/types.d.ts +20 -3
  20. package/dist/types.d.ts.map +1 -1
  21. package/dist/use-host-api-client.d.ts +8 -0
  22. package/dist/use-host-api-client.d.ts.map +1 -0
  23. package/dist/use-host-api-client.js +12 -0
  24. package/dist/view-system/card-spec.d.ts +3 -2
  25. package/dist/view-system/card-spec.d.ts.map +1 -1
  26. package/dist/view-system/card-spec.js +7 -6
  27. package/dist/views/panels.d.ts.map +1 -1
  28. package/dist/views/panels.js +2 -1
  29. package/package.json +5 -5
  30. package/src/__tests__/host-api-client.test.tsx +119 -0
  31. package/src/__tests__/resolve-row-actions.test.ts +44 -0
  32. package/src/addon-page-host.tsx +18 -2
  33. package/src/dynamic-columns.tsx +28 -1
  34. package/src/host-api-client.ts +137 -0
  35. package/src/host-api-context.tsx +18 -0
  36. package/src/host-api.ts +3 -0
  37. package/src/index.ts +8 -0
  38. package/src/types.ts +25 -3
  39. package/src/use-host-api-client.ts +13 -0
  40. package/src/view-system/card-spec.tsx +7 -6
  41. package/src/views/panels.tsx +2 -1
@@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next'
6
6
  import { buildRelationFilterParams } from '../dynamic-relation-helpers'
7
7
  import type { PanelRendererProps } from './types'
8
8
  import { displayValue, toDate } from './data-source'
9
+ import { formatAmount } from '@asteby/metacore-lib'
9
10
  import { ViewSkeleton } from './skeleton'
10
11
 
11
12
  export type StatFormat =
@@ -30,7 +31,7 @@ export function formatStat(
30
31
  switch (format as StatFormat | undefined) {
31
32
  case 'currency':
32
33
  if (Number.isNaN(num)) break
33
- return new Intl.NumberFormat(locale, { style: 'currency', currency: currency || 'MXN' }).format(num)
34
+ return formatAmount(num, { currency, locale })
34
35
  case 'percent':
35
36
  if (Number.isNaN(num)) break
36
37
  return new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 }).format(num)