@nocobase/plugin-data-visualization 0.11.1-alpha.5 → 0.12.0-alpha.2

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 (132) hide show
  1. package/client.d.ts +2 -2
  2. package/client.js +1 -1
  3. package/dist/client/chart/antd/antd.d.ts +7 -0
  4. package/dist/client/chart/antd/index.d.ts +4 -0
  5. package/dist/client/chart/antd/statistic.d.ts +19 -0
  6. package/dist/client/chart/antd/table.d.ts +6 -0
  7. package/dist/client/chart/chart.d.ts +65 -0
  8. package/dist/client/chart/g2plot/bar.d.ts +16 -0
  9. package/dist/client/chart/g2plot/dualAxes.d.ts +20 -0
  10. package/dist/client/chart/g2plot/g2plot.d.ts +19 -0
  11. package/dist/client/chart/g2plot/index.d.ts +6 -0
  12. package/dist/client/chart/g2plot/pie.d.ts +17 -0
  13. package/dist/client/chart/library.d.ts +28 -0
  14. package/{lib → dist}/client/hooks.d.ts +22 -154
  15. package/{lib → dist}/client/index.d.ts +3 -1
  16. package/dist/client/index.js +67448 -0
  17. package/{lib → dist}/client/renderer/ChartRendererProvider.d.ts +1 -8
  18. package/{lib → dist}/client/renderer/index.d.ts +0 -2
  19. package/{lib → dist}/client/utils.d.ts +1 -1
  20. package/{lib → dist}/index.d.ts +1 -0
  21. package/dist/index.js +18 -0
  22. package/dist/locale/en-US.js +26 -0
  23. package/dist/locale/fr-FR.js +5 -0
  24. package/dist/locale/ja-JP.js +5 -0
  25. package/dist/locale/pt-BR.js +26 -0
  26. package/dist/locale/ru-RU.js +5 -0
  27. package/dist/locale/tr-TR.js +5 -0
  28. package/dist/locale/zh-CN.js +74 -0
  29. package/dist/server/actions/formatter.js +41 -0
  30. package/{src/server/actions/query.ts → dist/server/actions/query.js} +75 -133
  31. package/dist/server/index.js +11 -0
  32. package/dist/server/plugin.js +42 -0
  33. package/package.json +23 -22
  34. package/server.d.ts +2 -2
  35. package/server.js +1 -1
  36. package/lib/client/Settings.js +0 -81
  37. package/lib/client/block/ChartBlock.js +0 -74
  38. package/lib/client/block/ChartBlockDesigner.js +0 -35
  39. package/lib/client/block/ChartBlockInitializer.js +0 -114
  40. package/lib/client/block/ChartConfigure.js +0 -499
  41. package/lib/client/block/formatters.js +0 -58
  42. package/lib/client/block/index.js +0 -49
  43. package/lib/client/block/schemas/configure.js +0 -517
  44. package/lib/client/block/transformers.js +0 -68
  45. package/lib/client/hooks.js +0 -275
  46. package/lib/client/index.js +0 -80
  47. package/lib/client/locale/index.js +0 -37
  48. package/lib/client/renderer/ChartLibrary.d.ts +0 -72
  49. package/lib/client/renderer/ChartLibrary.js +0 -146
  50. package/lib/client/renderer/ChartRenderer.js +0 -181
  51. package/lib/client/renderer/ChartRendererProvider.js +0 -105
  52. package/lib/client/renderer/index.js +0 -49
  53. package/lib/client/renderer/library/AntdLibrary.d.ts +0 -2
  54. package/lib/client/renderer/library/AntdLibrary.js +0 -123
  55. package/lib/client/renderer/library/G2PlotLibrary.d.ts +0 -2
  56. package/lib/client/renderer/library/G2PlotLibrary.js +0 -288
  57. package/lib/client/renderer/library/index.d.ts +0 -3
  58. package/lib/client/renderer/library/index.js +0 -15
  59. package/lib/client/utils.js +0 -137
  60. package/lib/index.js +0 -13
  61. package/lib/locale/en-US.js +0 -29
  62. package/lib/locale/fr-FR.js +0 -8
  63. package/lib/locale/ja-JP.js +0 -8
  64. package/lib/locale/pt-BR.js +0 -29
  65. package/lib/locale/ru-RU.js +0 -8
  66. package/lib/locale/tr-TR.js +0 -8
  67. package/lib/locale/zh-CN.js +0 -77
  68. package/lib/server/actions/formatter.js +0 -44
  69. package/lib/server/actions/query.js +0 -331
  70. package/lib/server/index.js +0 -13
  71. package/lib/server/plugin.js +0 -64
  72. package/src/client/Settings.tsx +0 -43
  73. package/src/client/__tests__/chart-configure.test.tsx +0 -14
  74. package/src/client/__tests__/chart-library.test.ts +0 -78
  75. package/src/client/__tests__/chart-renderer.test.tsx +0 -30
  76. package/src/client/__tests__/hooks.test.ts +0 -261
  77. package/src/client/block/ChartBlock.tsx +0 -24
  78. package/src/client/block/ChartBlockDesigner.tsx +0 -19
  79. package/src/client/block/ChartBlockInitializer.tsx +0 -82
  80. package/src/client/block/ChartConfigure.tsx +0 -446
  81. package/src/client/block/formatters.ts +0 -70
  82. package/src/client/block/index.ts +0 -4
  83. package/src/client/block/schemas/configure.ts +0 -504
  84. package/src/client/block/transformers.ts +0 -52
  85. package/src/client/hooks.ts +0 -239
  86. package/src/client/index.tsx +0 -47
  87. package/src/client/locale/index.ts +0 -18
  88. package/src/client/renderer/ChartLibrary.tsx +0 -183
  89. package/src/client/renderer/ChartRenderer.tsx +0 -129
  90. package/src/client/renderer/ChartRendererProvider.tsx +0 -123
  91. package/src/client/renderer/index.ts +0 -4
  92. package/src/client/renderer/library/AntdLibrary.tsx +0 -94
  93. package/src/client/renderer/library/G2PlotLibrary.tsx +0 -236
  94. package/src/client/renderer/library/index.tsx +0 -4
  95. package/src/client/utils.ts +0 -102
  96. package/src/index.ts +0 -1
  97. package/src/locale/en-US.ts +0 -23
  98. package/src/locale/fr-FR.ts +0 -1
  99. package/src/locale/ja-JP.ts +0 -1
  100. package/src/locale/pt-BR.ts +0 -23
  101. package/src/locale/ru-RU.ts +0 -1
  102. package/src/locale/tr-TR.ts +0 -1
  103. package/src/locale/zh-CN.ts +0 -72
  104. package/src/server/__tests__/api.test.ts +0 -102
  105. package/src/server/__tests__/formatter.test.ts +0 -49
  106. package/src/server/__tests__/query.test.ts +0 -220
  107. package/src/server/actions/formatter.ts +0 -49
  108. package/src/server/collections/.gitkeep +0 -0
  109. package/src/server/index.ts +0 -1
  110. package/src/server/plugin.ts +0 -37
  111. /package/{lib → dist}/client/Settings.d.ts +0 -0
  112. /package/{lib → dist}/client/block/ChartBlock.d.ts +0 -0
  113. /package/{lib → dist}/client/block/ChartBlockDesigner.d.ts +0 -0
  114. /package/{lib → dist}/client/block/ChartBlockInitializer.d.ts +0 -0
  115. /package/{lib → dist}/client/block/ChartConfigure.d.ts +0 -0
  116. /package/{lib → dist}/client/block/formatters.d.ts +0 -0
  117. /package/{lib → dist}/client/block/index.d.ts +0 -0
  118. /package/{lib → dist}/client/block/schemas/configure.d.ts +0 -0
  119. /package/{lib → dist}/client/block/transformers.d.ts +0 -0
  120. /package/{lib → dist}/client/locale/index.d.ts +0 -0
  121. /package/{lib → dist}/client/renderer/ChartRenderer.d.ts +0 -0
  122. /package/{lib → dist}/locale/en-US.d.ts +0 -0
  123. /package/{lib → dist}/locale/fr-FR.d.ts +0 -0
  124. /package/{lib → dist}/locale/ja-JP.d.ts +0 -0
  125. /package/{lib → dist}/locale/pt-BR.d.ts +0 -0
  126. /package/{lib → dist}/locale/ru-RU.d.ts +0 -0
  127. /package/{lib → dist}/locale/tr-TR.d.ts +0 -0
  128. /package/{lib → dist}/locale/zh-CN.d.ts +0 -0
  129. /package/{lib → dist}/server/actions/formatter.d.ts +0 -0
  130. /package/{lib → dist}/server/actions/query.d.ts +0 -0
  131. /package/{lib → dist}/server/index.d.ts +0 -0
  132. /package/{lib → dist}/server/plugin.d.ts +0 -0
@@ -1,504 +0,0 @@
1
- import { ISchema } from '@formily/react';
2
- import { uid } from '@formily/shared';
3
- import { lang } from '../../locale';
4
-
5
- const getArraySchema = (fields = {}, extra = {}) => ({
6
- type: 'array',
7
- 'x-decorator': 'FormItem',
8
- 'x-component': 'ArrayItems',
9
- ...extra,
10
- items: {
11
- type: 'object',
12
- properties: {
13
- space: {
14
- type: 'void',
15
- 'x-component': 'Space',
16
- properties: {
17
- sort: {
18
- type: 'void',
19
- 'x-decorator': 'FormItem',
20
- 'x-component': 'ArrayItems.SortHandle',
21
- },
22
- ...fields,
23
- remove: {
24
- type: 'void',
25
- 'x-decorator': 'FormItem',
26
- 'x-component': 'ArrayItems.Remove',
27
- },
28
- },
29
- },
30
- },
31
- },
32
- properties: {
33
- add: {
34
- type: 'void',
35
- title: '{{t("Add field")}}',
36
- 'x-component': 'ArrayItems.Addition',
37
- },
38
- },
39
- });
40
-
41
- export const getConfigSchema = (general: any): ISchema => ({
42
- type: 'void',
43
- properties: {
44
- config: {
45
- type: 'object',
46
- properties: {
47
- chartType: {
48
- type: 'string',
49
- title: '{{t("Chart type")}}',
50
- 'x-decorator': 'FormItem',
51
- 'x-component': 'Select',
52
- 'x-component-props': {
53
- placeholder: '{{t("Please select a chart type.")}}',
54
- },
55
- enum: '{{ chartTypes }}',
56
- },
57
- [uid()]: {
58
- type: 'void',
59
- properties: {
60
- general,
61
- },
62
- },
63
- [uid()]: {
64
- type: 'void',
65
- properties: {
66
- advanced: {
67
- type: 'json',
68
- title: '{{t("JSON config")}}',
69
- 'x-decorator': 'FormItem',
70
- 'x-decorator-props': {
71
- extra: lang('Same properties set in the form above will be overwritten by this JSON config.'),
72
- },
73
- 'x-component': 'Input.JSON',
74
- 'x-component-props': {
75
- autoSize: {
76
- minRows: 3,
77
- },
78
- },
79
- },
80
- },
81
- },
82
- reference: {
83
- type: 'string',
84
- 'x-reactions': {
85
- dependencies: ['.chartType'],
86
- fulfill: {
87
- schema: {
88
- 'x-content': '{{ getReference($deps[0]) }}',
89
- },
90
- },
91
- },
92
- },
93
- },
94
- },
95
- },
96
- });
97
-
98
- export const querySchema: ISchema = {
99
- type: 'void',
100
- properties: {
101
- settings: {
102
- type: 'void',
103
- // 'x-component': 'FormItem',
104
- properties: {
105
- // mode: {
106
- // type: 'string',
107
- // 'x-decorator': 'FormItem',
108
- // 'x-decorator-props': {
109
- // style: {
110
- // display: 'inline-block',
111
- // width: '45%',
112
- // },
113
- // },
114
- // 'x-component': 'Radio.Group',
115
- // 'x-component-props': {
116
- // defaultValue: 'builder',
117
- // optionType: 'button',
118
- // buttonStyle: 'solid',
119
- // },
120
- // enum: [
121
- // {
122
- // label: lang('Builder mode'),
123
- // value: 'builder',
124
- // },
125
- // {
126
- // label: lang('SQL mode'),
127
- // value: 'sql',
128
- // },
129
- // ],
130
- // 'x-reactions': [
131
- // {
132
- // target: 'query.builder',
133
- // fulfill: {
134
- // state: {
135
- // visible: '{{ $self.value !== "sql" }}',
136
- // },
137
- // },
138
- // },
139
- // {
140
- // target: 'query.sql',
141
- // fulfill: {
142
- // state: {
143
- // visible: '{{ $self.value === "sql" }}',
144
- // },
145
- // },
146
- // },
147
- // ],
148
- // },
149
- collection: {
150
- title: '{{t("Collection")}}',
151
- type: 'string',
152
- 'x-decorator': 'FormItem',
153
- 'x-component': 'Select',
154
- 'x-component-props': {
155
- options: '{{ collectionOptions }}',
156
- onChange: '{{ onCollectionChange }}',
157
- placeholder: '{{t("Collection")}}',
158
- },
159
- },
160
- },
161
- },
162
- query: {
163
- type: 'object',
164
- properties: {
165
- builder: {
166
- type: 'void',
167
- properties: {
168
- collapse: {
169
- type: 'void',
170
- 'x-decorator': 'FormItem',
171
- 'x-component': 'FormCollapse',
172
- 'x-component-props': {
173
- formCollapse: '{{formCollapse}}',
174
- },
175
- properties: {
176
- pane1: {
177
- type: 'void',
178
- 'x-component': 'FormCollapse.CollapsePanel',
179
- 'x-component-props': {
180
- header: lang('Measures'),
181
- key: 'measures',
182
- },
183
- properties: {
184
- measures: getArraySchema(
185
- {
186
- field: {
187
- type: 'string',
188
- 'x-decorator': 'FormItem',
189
- 'x-component': 'Cascader',
190
- 'x-component-props': {
191
- placeholder: '{{t("Field")}}',
192
- fieldNames: {
193
- label: 'title',
194
- value: 'name',
195
- children: 'children',
196
- },
197
- },
198
- enum: '{{ fieldOptions }}',
199
- required: true,
200
- },
201
- aggregation: {
202
- type: 'string',
203
- 'x-decorator': 'FormItem',
204
- 'x-component': 'Select',
205
- 'x-component-props': {
206
- placeholder: '{{t("Aggregation")}}',
207
- },
208
- enum: [
209
- { label: '{{t("Sum")}}', value: 'sum' },
210
- { label: '{{t("Count")}}', value: 'count' },
211
- { label: '{{t("Avg")}}', value: 'avg' },
212
- { label: '{{t("Max")}}', value: 'max' },
213
- { label: '{{t("Min")}}', value: 'min' },
214
- ],
215
- },
216
- alias: {
217
- type: 'string',
218
- 'x-decorator': 'FormItem',
219
- 'x-component': 'Input',
220
- 'x-component-props': {
221
- placeholder: '{{t("Alias")}}',
222
- style: {
223
- minWidth: '100px',
224
- },
225
- },
226
- },
227
- },
228
- {
229
- required: true,
230
- 'x-component-props': {
231
- style: {
232
- overflow: 'auto',
233
- },
234
- },
235
- },
236
- ),
237
- },
238
- },
239
- pane2: {
240
- type: 'void',
241
- 'x-component': 'FormCollapse.CollapsePanel',
242
- 'x-component-props': {
243
- header: lang('Dimensions'),
244
- key: 'dimensions',
245
- },
246
- properties: {
247
- dimensions: getArraySchema(
248
- {
249
- field: {
250
- type: 'string',
251
- 'x-decorator': 'FormItem',
252
- 'x-component': 'Cascader',
253
- 'x-component-props': {
254
- placeholder: '{{t("Field")}}',
255
- fieldNames: {
256
- label: 'title',
257
- value: 'name',
258
- children: 'children',
259
- },
260
- },
261
- enum: '{{ fieldOptions }}',
262
- required: true,
263
- },
264
- format: {
265
- type: 'string',
266
- 'x-decorator': 'FormItem',
267
- 'x-component': 'Select',
268
- 'x-component-props': {
269
- placeholder: '{{t("Format")}}',
270
- style: {
271
- maxWidth: '120px',
272
- },
273
- },
274
- 'x-reactions': '{{ useFormatterOptions }}',
275
- 'x-visible': '{{ $self.dataSource && $self.dataSource.length }}',
276
- },
277
- alias: {
278
- type: 'string',
279
- 'x-decorator': 'FormItem',
280
- 'x-component': 'Input',
281
- 'x-component-props': {
282
- placeholder: '{{t("Alias")}}',
283
- style: {
284
- minWidth: '100px',
285
- },
286
- },
287
- },
288
- },
289
- {
290
- 'x-component-props': {
291
- style: {
292
- overflow: 'auto',
293
- },
294
- },
295
- },
296
- ),
297
- },
298
- },
299
- pane3: {
300
- type: 'void',
301
- 'x-component': 'FormCollapse.CollapsePanel',
302
- 'x-component-props': {
303
- header: lang('Filter'),
304
- key: 'filter',
305
- },
306
- properties: {
307
- filter: {
308
- type: 'object',
309
- 'x-decorator': 'FormItem',
310
- 'x-decorator-props': {
311
- style: {
312
- overflow: 'auto',
313
- },
314
- },
315
- 'x-component': 'Filter',
316
- 'x-component-props': {
317
- options: '{{ filterOptions }}',
318
- // dynamicComponent: 'Input',
319
- },
320
- },
321
- },
322
- },
323
- pane4: {
324
- type: 'void',
325
- 'x-component': 'FormCollapse.CollapsePanel',
326
- 'x-component-props': {
327
- header: lang('Sort'),
328
- key: 'sort',
329
- },
330
- properties: {
331
- orders: getArraySchema(
332
- {
333
- field: {
334
- type: 'string',
335
- 'x-decorator': 'FormItem',
336
- 'x-component': 'Cascader',
337
- 'x-component-props': {
338
- placeholder: '{{t("Field")}}',
339
- },
340
- 'x-reactions': '{{ useOrderOptions }}',
341
- required: true,
342
- },
343
- order: {
344
- type: 'string',
345
- 'x-decorator': 'FormItem',
346
- 'x-component': 'Radio.Group',
347
- 'x-component-props': {
348
- defaultValue: 'ASC',
349
- optionType: 'button',
350
- style: {
351
- width: '128px',
352
- },
353
- },
354
- enum: ['ASC', 'DESC'],
355
- },
356
- },
357
- {
358
- 'x-reactions': '{{ useOrderReaction }}',
359
- 'x-component-props': {
360
- style: {
361
- overflow: 'auto',
362
- },
363
- },
364
- },
365
- ),
366
- },
367
- },
368
- },
369
- },
370
- limit: {
371
- title: '{{t("Limit")}}',
372
- type: 'number',
373
- 'x-decorator': 'FormItem',
374
- 'x-component': 'InputNumber',
375
- 'x-component-props': {
376
- defaultValue: 2000,
377
- max: 2000,
378
- min: 1,
379
- style: {
380
- width: '100px',
381
- },
382
- },
383
- },
384
- },
385
- },
386
- // sql: {
387
- // type: 'object',
388
- // properties: {
389
- // select: {
390
- // type: 'void',
391
- // 'x-decorator': 'p',
392
- // 'x-component': 'Text',
393
- // 'x-component-props': {
394
- // code: true,
395
- // },
396
- // 'x-content': 'SELECT',
397
- // },
398
- // fields: {
399
- // type: 'string',
400
- // 'x-decorator': 'FormItem',
401
- // 'x-component': 'Input.TextArea',
402
- // 'x-component-props': {
403
- // autoSize: {
404
- // minRows: 2,
405
- // },
406
- // placeholder: 'Fields',
407
- // },
408
- // required: true,
409
- // },
410
- // from: {
411
- // type: 'void',
412
- // 'x-decorator': 'p',
413
- // 'x-component': 'FromSql',
414
- // },
415
- // clauses: {
416
- // type: 'string',
417
- // 'x-decorator': 'FormItem',
418
- // 'x-component': 'Input.TextArea',
419
- // 'x-component-props': {
420
- // autoSize: {
421
- // minRows: 5,
422
- // },
423
- // placeholder: 'Join, Where, Group By, Having, Order By, Limit',
424
- // },
425
- // required: true,
426
- // },
427
- // },
428
- // },
429
- cache: {
430
- type: 'object',
431
- properties: {
432
- enabled: {
433
- type: 'boolean',
434
- title: '{{t("Enable cache")}}',
435
- 'x-decorator': 'FormItem',
436
- 'x-component': 'Switch',
437
- },
438
- ttl: {
439
- type: 'number',
440
- title: '{{t("TTL (second)")}}',
441
- 'x-decorator': 'FormItem',
442
- 'x-component': 'InputNumber',
443
- 'x-component-props': {
444
- defaultValue: 60,
445
- min: 1,
446
- style: {
447
- width: '100px',
448
- },
449
- },
450
- },
451
- },
452
- },
453
- },
454
- },
455
- },
456
- };
457
-
458
- export const transformSchema: ISchema = {
459
- type: 'void',
460
- properties: {
461
- transform: getArraySchema(
462
- {
463
- field: {
464
- type: 'string',
465
- 'x-decorator': 'FormItem',
466
- 'x-component': 'Select',
467
- 'x-component-props': {
468
- placeholder: '{{t("Field")}}',
469
- style: {
470
- maxWidth: '100px',
471
- },
472
- },
473
- 'x-reactions': '{{ useChartFields }}',
474
- },
475
- type: {
476
- type: 'string',
477
- 'x-decorator': 'FormItem',
478
- 'x-component': 'Select',
479
- 'x-component-props': {
480
- placeholder: '{{t("Type")}}',
481
- },
482
- 'x-reactions': '{{ useFieldTypeOptions }}',
483
- },
484
- format: {
485
- type: 'string',
486
- 'x-decorator': 'FormItem',
487
- 'x-component': 'Select',
488
- 'x-component-props': {
489
- placeholder: '{{t("Format")}}',
490
- },
491
- 'x-reactions': '{{ useTransformers }}',
492
- 'x-visible': '{{ $self.dataSource && $self.dataSource.length }}',
493
- },
494
- },
495
- {
496
- 'x-decorator-props': {
497
- style: {
498
- width: '50%',
499
- },
500
- },
501
- },
502
- ),
503
- },
504
- };
@@ -1,52 +0,0 @@
1
- import { dayjs } from '@nocobase/utils/client';
2
-
3
- const transformers: {
4
- [key: string]: {
5
- [key: string]: (val: any, locale?: string) => string | number;
6
- };
7
- } = {
8
- datetime: {
9
- YYYY: (val: string) => dayjs(val).format('YYYY'),
10
- MM: (val: string) => dayjs(val).format('MM'),
11
- DD: (val: string) => dayjs(val).format('DD'),
12
- 'YYYY-MM': (val: string) => dayjs(val).format('YYYY-MM'),
13
- 'YYYY-MM-DD': (val: string) => dayjs(val).format('YYYY-MM-DD'),
14
- 'YYYY-MM-DD hh:mm': (val: string) => dayjs(val).format('YYYY-MM-DD hh:mm'),
15
- 'YYYY-MM-DD hh:mm:ss': (val: string) => dayjs(val).format('YYYY-MM-DD hh:mm:ss'),
16
- },
17
- date: {
18
- YYYY: (val: string) => dayjs(val).format('YYYY'),
19
- MM: (val: string) => dayjs(val).format('MM'),
20
- DD: (val: string) => dayjs(val).format('DD'),
21
- 'YYYY-MM': (val: string) => dayjs(val).format('YYYY-MM'),
22
- 'YYYY-MM-DD': (val: string) => dayjs(val).format('YYYY-MM-DD'),
23
- },
24
- time: {
25
- 'hh:mm:ss': (val: string) => dayjs(val).format('hh:mm:ss'),
26
- 'hh:mm': (val: string) => dayjs(val).format('hh:mm'),
27
- hh: (val: string) => dayjs(val).format('hh'),
28
- },
29
- number: {
30
- Percent: (val: number) =>
31
- new Intl.NumberFormat('en-US', { style: 'percent', minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(
32
- val,
33
- ),
34
- Currency: (val: number, locale = 'en-US') => {
35
- const currency = {
36
- 'zh-CN': 'CNY',
37
- 'en-US': 'USD',
38
- 'ja-JP': 'JPY',
39
- 'ko-KR': 'KRW',
40
- 'pt-BR': 'BRL',
41
- 'ru-RU': 'RUB',
42
- 'tr-TR': 'TRY',
43
- 'es-ES': 'EUR',
44
- }[locale];
45
- return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(val);
46
- },
47
- Exponential: (val: number | string) => (+val)?.toExponential(),
48
- Abbreviation: (val: number, locale = 'en-US') => new Intl.NumberFormat(locale, { notation: 'compact' }).format(val),
49
- },
50
- };
51
-
52
- export default transformers;