@bbl-digital/snorre 4.1.95 → 4.1.97

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 (48) hide show
  1. package/dist/bundle.js +17 -82
  2. package/esm/core/BarAndLineComposedChart/BarAndLineComposedChart.stories.js +33 -33
  3. package/esm/core/BarAndLineComposedChart/index.js +2 -2
  4. package/esm/globals/styles/quill.module.js +1 -0
  5. package/esm/utils/formatGraphPrice.js +15 -80
  6. package/lib/core/BarAndLineComposedChart/BarAndLineComposedChart.stories.js +33 -33
  7. package/lib/core/BarAndLineComposedChart/index.d.ts.map +1 -1
  8. package/lib/core/BarAndLineComposedChart/index.js +2 -2
  9. package/lib/core/QuillEditor/config.d.ts +3 -3
  10. package/lib/globals/styles/quill.module.d.ts +2 -0
  11. package/lib/globals/styles/quill.module.d.ts.map +1 -0
  12. package/lib/globals/styles/quill.module.js +1 -0
  13. package/lib/utils/formatGraphPrice.d.ts +1 -1
  14. package/lib/utils/formatGraphPrice.d.ts.map +1 -1
  15. package/lib/utils/formatGraphPrice.js +15 -80
  16. package/package.json +1 -1
  17. package/esm/core/Editor/Editor.stories.js +0 -55
  18. package/esm/core/Editor/config.js +0 -7
  19. package/esm/core/Editor/index.js +0 -111
  20. package/esm/core/Editor/styles.js +0 -43
  21. package/esm/core/EditorQuillReact/EditorQuillReact.stories.js +0 -59
  22. package/esm/core/EditorQuillReact/config.js +0 -28
  23. package/esm/core/EditorQuillReact/index.js +0 -88
  24. package/esm/core/EditorQuillReact/styles.js +0 -34
  25. package/lib/core/Editor/Editor.stories.d.ts +0 -11
  26. package/lib/core/Editor/Editor.stories.d.ts.map +0 -1
  27. package/lib/core/Editor/Editor.stories.js +0 -55
  28. package/lib/core/Editor/config.d.ts +0 -6
  29. package/lib/core/Editor/config.d.ts.map +0 -1
  30. package/lib/core/Editor/config.js +0 -7
  31. package/lib/core/Editor/index.d.ts +0 -41
  32. package/lib/core/Editor/index.d.ts.map +0 -1
  33. package/lib/core/Editor/index.js +0 -111
  34. package/lib/core/Editor/styles.d.ts +0 -15
  35. package/lib/core/Editor/styles.d.ts.map +0 -1
  36. package/lib/core/Editor/styles.js +0 -43
  37. package/lib/core/EditorQuillReact/EditorQuillReact.stories.d.ts +0 -8
  38. package/lib/core/EditorQuillReact/EditorQuillReact.stories.d.ts.map +0 -1
  39. package/lib/core/EditorQuillReact/EditorQuillReact.stories.js +0 -59
  40. package/lib/core/EditorQuillReact/config.d.ts +0 -19
  41. package/lib/core/EditorQuillReact/config.d.ts.map +0 -1
  42. package/lib/core/EditorQuillReact/config.js +0 -28
  43. package/lib/core/EditorQuillReact/index.d.ts +0 -23
  44. package/lib/core/EditorQuillReact/index.d.ts.map +0 -1
  45. package/lib/core/EditorQuillReact/index.js +0 -88
  46. package/lib/core/EditorQuillReact/styles.d.ts +0 -14
  47. package/lib/core/EditorQuillReact/styles.d.ts.map +0 -1
  48. package/lib/core/EditorQuillReact/styles.js +0 -34
package/dist/bundle.js CHANGED
@@ -26364,87 +26364,22 @@
26364
26364
  label: "BarChartContainer"
26365
26365
  })("height:", props => props.height && props.height, ";width:", props => props.width && props.width, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL1NpbXBsZUJhckNoYXJ0L3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFOEUiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL3BhY2thZ2VzL2NvcmUvU2ltcGxlQmFyQ2hhcnQvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5cbmV4cG9ydCBjb25zdCBCYXJDaGFydENvbnRhaW5lciA9IHN0eWxlZC5kaXY8eyB3aWR0aDogc3RyaW5nOyBoZWlnaHQ6IHN0cmluZyB9PmBcbiAgaGVpZ2h0OiAkeyhwcm9wcykgPT4gcHJvcHMuaGVpZ2h0ICYmIHByb3BzLmhlaWdodH07XG4gIHdpZHRoOiAkeyhwcm9wcykgPT4gcHJvcHMud2lkdGggJiYgcHJvcHMud2lkdGh9O1xuYFxuIl19 */"));
26366
26366
 
26367
- const firstIndexIsNegative = value => value.charAt(0) === '-';
26368
- const precisionValueIsZero = (value, maxEnd) => {
26369
- return firstIndexIsNegative(value) ? value.charAt(2 + maxEnd) === '0' : value.charAt(1 + maxEnd) === '0';
26370
- };
26371
- const setLeftSide = (value, sliceLeft) => {
26372
- return firstIndexIsNegative(value) ? `-${value.slice(sliceLeft.start + 1, sliceLeft.end + 1)}` : value.slice(sliceLeft.start, sliceLeft.end);
26373
- };
26374
- const setRightSide = (value, sliceRight, sliceLeftEnd) => {
26375
- return precisionValueIsZero(value, sliceLeftEnd) ? '' : `.${value.slice(sliceRight.start, sliceRight.end)}`;
26376
- };
26377
- const getFormat = (value, sliceLeft, sliceRight, sizeTerm) => {
26378
- return `${setLeftSide(value, sliceLeft)}${setRightSide(value, sliceRight, sliceLeft.end)}${sizeTerm}`;
26379
- };
26380
- const formatAxisPrice = val => {
26381
- const value = String(val);
26382
- if (value.match(/^(-\d)|(\d)+$/)) {
26383
- const santizitedValue = firstIndexIsNegative(value) ? value.replace('-', '') : value;
26384
- const count = santizitedValue.length;
26385
- if (count > 3) {
26386
- switch (count) {
26387
- case 4:
26388
- return getFormat(value, {
26389
- start: 0,
26390
- end: 1
26391
- }, {
26392
- start: 1,
26393
- end: 2
26394
- }, 'k');
26395
- case 5:
26396
- return getFormat(value, {
26397
- start: 0,
26398
- end: 2
26399
- }, {
26400
- start: 2,
26401
- end: 3
26402
- }, 'k');
26403
- case 6:
26404
- return getFormat(value, {
26405
- start: 0,
26406
- end: 3
26407
- }, {
26408
- start: 3,
26409
- end: 4
26410
- }, 'k');
26411
- case 7:
26412
- return getFormat(value, {
26413
- start: 0,
26414
- end: 1
26415
- }, {
26416
- start: 1,
26417
- end: 2
26418
- }, 'm');
26419
- case 8:
26420
- return getFormat(value, {
26421
- start: 0,
26422
- end: 2
26423
- }, {
26424
- start: 2,
26425
- end: 3
26426
- }, 'm');
26427
- case 9:
26428
- return getFormat(value, {
26429
- start: 0,
26430
- end: 3
26431
- }, {
26432
- start: 3,
26433
- end: 4
26434
- }, 'm');
26435
- default:
26436
- return getFormat(value, {
26437
- start: 0,
26438
- end: 3
26439
- }, {
26440
- start: 3,
26441
- end: 4
26442
- }, 'm');
26443
- }
26444
- }
26367
+ function formatAxisPrice(val) {
26368
+ const num = Number(val);
26369
+ if (isNaN(num)) {
26370
+ return String(val);
26445
26371
  }
26446
- return value;
26447
- };
26372
+ const absNum = Math.abs(num);
26373
+ let formatted;
26374
+ if (absNum >= 1e6) {
26375
+ formatted = (num / 1e6).toFixed(1).replace(/\.0$/, '') + 'm';
26376
+ } else if (absNum >= 1e3) {
26377
+ formatted = (num / 1e3).toFixed(1).replace(/\.0$/, '') + 'k';
26378
+ } else {
26379
+ formatted = num.toString();
26380
+ }
26381
+ return formatted;
26382
+ }
26448
26383
 
26449
26384
  function _EMOTION_STRINGIFIED_CSS_ERROR__$S() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
26450
26385
  const TooltipWrapper = /*#__PURE__*/_styled__default["default"]("div", process.env.NODE_ENV === "production" ? {
@@ -26737,7 +26672,7 @@
26737
26672
  children: /*#__PURE__*/jsxRuntime$1.jsxs(recharts.ComposedChart, {
26738
26673
  data: data && data,
26739
26674
  margin: {
26740
- top: 10,
26675
+ top: 0.5,
26741
26676
  right: 50,
26742
26677
  bottom: 0,
26743
26678
  left: 0,
@@ -26751,7 +26686,7 @@
26751
26686
  y: 0,
26752
26687
  stroke: "white"
26753
26688
  }), cartesianGrid && /*#__PURE__*/jsxRuntime$1.jsx(recharts.CartesianGrid, {
26754
- strokeDasharray: "0",
26689
+ horizontal: true,
26755
26690
  vertical: false
26756
26691
  }), /*#__PURE__*/jsxRuntime$1.jsx(recharts.XAxis, {
26757
26692
  dataKey: xAxisDataKey && xAxisDataKey,
@@ -6,19 +6,19 @@ export default {
6
6
  };
7
7
  const DefaultData = [{
8
8
  name: 'Jan',
9
- inntekt: 40000,
10
- kostnad: -23000,
11
- akkumulert: 17000
9
+ inntekt: 450000,
10
+ kostnad: -233000,
11
+ akkumulert: 170000
12
12
  }, {
13
13
  name: 'Feb',
14
- inntekt: 60000,
15
- kostnad: -25000,
16
- akkumulert: 35000
14
+ inntekt: 600000,
15
+ kostnad: -250000,
16
+ akkumulert: 350000
17
17
  }, {
18
18
  name: 'Mars',
19
- inntekt: 50000,
20
- kostnad: -34000,
21
- akkumulert: 16000
19
+ inntekt: 500000,
20
+ kostnad: -340000,
21
+ akkumulert: 160000
22
22
  }, {
23
23
  name: 'April',
24
24
  inntekt: 55000,
@@ -26,44 +26,44 @@ const DefaultData = [{
26
26
  akkumulert: 35000
27
27
  }, {
28
28
  name: 'Mai',
29
- inntekt: 54400,
30
- kostnad: -30000,
31
- akkumulert: 24400
29
+ inntekt: 540400,
30
+ kostnad: -300000,
31
+ akkumulert: 240400
32
32
  }, {
33
33
  name: 'Jun',
34
- inntekt: 65000,
35
- kostnad: -25000,
36
- akkumulert: 40000
34
+ inntekt: 650000,
35
+ kostnad: -250000,
36
+ akkumulert: 400000
37
37
  }, {
38
38
  name: 'Jul',
39
- inntekt: 43000,
40
- kostnad: -30000,
41
- akkumulert: 13000
39
+ inntekt: 430000,
40
+ kostnad: -300000,
41
+ akkumulert: 130000
42
42
  }, {
43
43
  name: 'Aug',
44
- inntekt: 60000,
45
- kostnad: -40000,
46
- akkumulert: 20000
44
+ inntekt: 600000,
45
+ kostnad: -400000,
46
+ akkumulert: 200000
47
47
  }, {
48
48
  name: 'Sept',
49
- inntekt: 70000,
50
- kostnad: -50000,
51
- akkumulert: 20000
49
+ inntekt: 700000,
50
+ kostnad: -500000,
51
+ akkumulert: 200000
52
52
  }, {
53
53
  name: 'Okt',
54
- inntekt: 60000,
55
- kostnad: -34000,
56
- akkumulert: 26000
54
+ inntekt: 600000,
55
+ kostnad: -340000,
56
+ akkumulert: 260000
57
57
  }, {
58
58
  name: 'Nov',
59
- inntekt: 40040,
60
- kostnad: -24000,
61
- akkumulert: 16040
59
+ inntekt: 763000,
60
+ kostnad: 0,
61
+ akkumulert: 1730000
62
62
  }, {
63
63
  name: 'Des',
64
- inntekt: 56000,
65
- kostnad: -5500,
66
- akkumulert: 50500
64
+ inntekt: 560000,
65
+ kostnad: -55000,
66
+ akkumulert: 505000
67
67
  }];
68
68
  const ValuePairData = [{
69
69
  name: 'Jan',
@@ -40,7 +40,7 @@ const BarAndLineComposedChart = ({
40
40
  children: /*#__PURE__*/_jsxs(ComposedChart, {
41
41
  data: data && data,
42
42
  margin: {
43
- top: 10,
43
+ top: 0.5,
44
44
  right: 50,
45
45
  bottom: 0,
46
46
  left: 0,
@@ -54,7 +54,7 @@ const BarAndLineComposedChart = ({
54
54
  y: 0,
55
55
  stroke: "white"
56
56
  }), cartesianGrid && /*#__PURE__*/_jsx(CartesianGrid, {
57
- strokeDasharray: "0",
57
+ horizontal: true,
58
58
  vertical: false
59
59
  }), /*#__PURE__*/_jsx(XAxis, {
60
60
  dataKey: xAxisDataKey && xAxisDataKey,
@@ -0,0 +1 @@
1
+ import 'quill/dist/quill.snow.css';
@@ -1,82 +1,17 @@
1
- const firstIndexIsNegative = value => value.charAt(0) === '-';
2
- const precisionValueIsZero = (value, maxEnd) => {
3
- return firstIndexIsNegative(value) ? value.charAt(2 + maxEnd) === '0' : value.charAt(1 + maxEnd) === '0';
4
- };
5
- const setLeftSide = (value, sliceLeft) => {
6
- return firstIndexIsNegative(value) ? `-${value.slice(sliceLeft.start + 1, sliceLeft.end + 1)}` : value.slice(sliceLeft.start, sliceLeft.end);
7
- };
8
- const setRightSide = (value, sliceRight, sliceLeftEnd) => {
9
- return precisionValueIsZero(value, sliceLeftEnd) ? '' : `.${value.slice(sliceRight.start, sliceRight.end)}`;
10
- };
11
- const getFormat = (value, sliceLeft, sliceRight, sizeTerm) => {
12
- return `${setLeftSide(value, sliceLeft)}${setRightSide(value, sliceRight, sliceLeft.end)}${sizeTerm}`;
13
- };
14
- const formatAxisPrice = val => {
15
- const value = String(val);
16
- if (value.match(/^(-\d)|(\d)+$/)) {
17
- const santizitedValue = firstIndexIsNegative(value) ? value.replace('-', '') : value;
18
- const count = santizitedValue.length;
19
- if (count > 3) {
20
- switch (count) {
21
- case 4:
22
- return getFormat(value, {
23
- start: 0,
24
- end: 1
25
- }, {
26
- start: 1,
27
- end: 2
28
- }, 'k');
29
- case 5:
30
- return getFormat(value, {
31
- start: 0,
32
- end: 2
33
- }, {
34
- start: 2,
35
- end: 3
36
- }, 'k');
37
- case 6:
38
- return getFormat(value, {
39
- start: 0,
40
- end: 3
41
- }, {
42
- start: 3,
43
- end: 4
44
- }, 'k');
45
- case 7:
46
- return getFormat(value, {
47
- start: 0,
48
- end: 1
49
- }, {
50
- start: 1,
51
- end: 2
52
- }, 'm');
53
- case 8:
54
- return getFormat(value, {
55
- start: 0,
56
- end: 2
57
- }, {
58
- start: 2,
59
- end: 3
60
- }, 'm');
61
- case 9:
62
- return getFormat(value, {
63
- start: 0,
64
- end: 3
65
- }, {
66
- start: 3,
67
- end: 4
68
- }, 'm');
69
- default:
70
- return getFormat(value, {
71
- start: 0,
72
- end: 3
73
- }, {
74
- start: 3,
75
- end: 4
76
- }, 'm');
77
- }
78
- }
1
+ function formatAxisPrice(val) {
2
+ const num = Number(val);
3
+ if (isNaN(num)) {
4
+ return String(val);
79
5
  }
80
- return value;
81
- };
6
+ const absNum = Math.abs(num);
7
+ let formatted;
8
+ if (absNum >= 1e6) {
9
+ formatted = (num / 1e6).toFixed(1).replace(/\.0$/, '') + 'm';
10
+ } else if (absNum >= 1e3) {
11
+ formatted = (num / 1e3).toFixed(1).replace(/\.0$/, '') + 'k';
12
+ } else {
13
+ formatted = num.toString();
14
+ }
15
+ return formatted;
16
+ }
82
17
  export { formatAxisPrice };
@@ -6,19 +6,19 @@ export default {
6
6
  };
7
7
  const DefaultData = [{
8
8
  name: 'Jan',
9
- inntekt: 40000,
10
- kostnad: -23000,
11
- akkumulert: 17000
9
+ inntekt: 450000,
10
+ kostnad: -233000,
11
+ akkumulert: 170000
12
12
  }, {
13
13
  name: 'Feb',
14
- inntekt: 60000,
15
- kostnad: -25000,
16
- akkumulert: 35000
14
+ inntekt: 600000,
15
+ kostnad: -250000,
16
+ akkumulert: 350000
17
17
  }, {
18
18
  name: 'Mars',
19
- inntekt: 50000,
20
- kostnad: -34000,
21
- akkumulert: 16000
19
+ inntekt: 500000,
20
+ kostnad: -340000,
21
+ akkumulert: 160000
22
22
  }, {
23
23
  name: 'April',
24
24
  inntekt: 55000,
@@ -26,44 +26,44 @@ const DefaultData = [{
26
26
  akkumulert: 35000
27
27
  }, {
28
28
  name: 'Mai',
29
- inntekt: 54400,
30
- kostnad: -30000,
31
- akkumulert: 24400
29
+ inntekt: 540400,
30
+ kostnad: -300000,
31
+ akkumulert: 240400
32
32
  }, {
33
33
  name: 'Jun',
34
- inntekt: 65000,
35
- kostnad: -25000,
36
- akkumulert: 40000
34
+ inntekt: 650000,
35
+ kostnad: -250000,
36
+ akkumulert: 400000
37
37
  }, {
38
38
  name: 'Jul',
39
- inntekt: 43000,
40
- kostnad: -30000,
41
- akkumulert: 13000
39
+ inntekt: 430000,
40
+ kostnad: -300000,
41
+ akkumulert: 130000
42
42
  }, {
43
43
  name: 'Aug',
44
- inntekt: 60000,
45
- kostnad: -40000,
46
- akkumulert: 20000
44
+ inntekt: 600000,
45
+ kostnad: -400000,
46
+ akkumulert: 200000
47
47
  }, {
48
48
  name: 'Sept',
49
- inntekt: 70000,
50
- kostnad: -50000,
51
- akkumulert: 20000
49
+ inntekt: 700000,
50
+ kostnad: -500000,
51
+ akkumulert: 200000
52
52
  }, {
53
53
  name: 'Okt',
54
- inntekt: 60000,
55
- kostnad: -34000,
56
- akkumulert: 26000
54
+ inntekt: 600000,
55
+ kostnad: -340000,
56
+ akkumulert: 260000
57
57
  }, {
58
58
  name: 'Nov',
59
- inntekt: 40040,
60
- kostnad: -24000,
61
- akkumulert: 16040
59
+ inntekt: 763000,
60
+ kostnad: 0,
61
+ akkumulert: 1730000
62
62
  }, {
63
63
  name: 'Des',
64
- inntekt: 56000,
65
- kostnad: -5500,
66
- akkumulert: 50500
64
+ inntekt: 560000,
65
+ kostnad: -55000,
66
+ akkumulert: 505000
67
67
  }];
68
68
  const ValuePairData = [{
69
69
  name: 'Jan',
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/BarAndLineComposedChart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAGL,aAAa,EAQd,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAKlD,UAAU,MAAO,SAAQ,OAAO,CAAC,OAAO,aAAa,CAAC;IACpD,wFAAwF;IACxF,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,6MAA6M;IAC7M,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,CAAC,EAAE,MAAM,CAAA;QAEhB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,EAAE,CAAA;IACH,6OAA6O;IAC7O,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,MAAM,CAAA;QACd,IAAI,EAAE,SAAS,CAAA;QAEf,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,EAAE,CAAA;IACH,iHAAiH;IACjH,YAAY,EAAE,MAAM,CAAA;IACpB,gHAAgH;IAChH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sEAAsE;IACtE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IAC1C,uFAAuF;IACvF,YAAY,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAC1C,wGAAwG;IACxG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uGAAuG;IACvG,aAAa,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5E,sEAAsE;IACtE,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IAClC,uEAAuE;IACvE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AACD,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAqH7C,CAAA;AAED,eAAe,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/BarAndLineComposedChart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAGL,aAAa,EAQd,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAKlD,UAAU,MAAO,SAAQ,OAAO,CAAC,OAAO,aAAa,CAAC;IACpD,wFAAwF;IACxF,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,6MAA6M;IAC7M,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,CAAC,EAAE,MAAM,CAAA;QAEhB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,EAAE,CAAA;IACH,6OAA6O;IAC7O,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,MAAM,CAAA;QACd,IAAI,EAAE,SAAS,CAAA;QAEf,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,EAAE,CAAA;IACH,iHAAiH;IACjH,YAAY,EAAE,MAAM,CAAA;IACpB,gHAAgH;IAChH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sEAAsE;IACtE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IAC1C,uFAAuF;IACvF,YAAY,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAC1C,wGAAwG;IACxG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uGAAuG;IACvG,aAAa,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5E,sEAAsE;IACtE,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IAClC,uEAAuE;IACvE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AACD,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAmH7C,CAAA;AAED,eAAe,uBAAuB,CAAA"}
@@ -40,7 +40,7 @@ const BarAndLineComposedChart = ({
40
40
  children: /*#__PURE__*/_jsxs(ComposedChart, {
41
41
  data: data && data,
42
42
  margin: {
43
- top: 10,
43
+ top: 0.5,
44
44
  right: 50,
45
45
  bottom: 0,
46
46
  left: 0,
@@ -54,7 +54,7 @@ const BarAndLineComposedChart = ({
54
54
  y: 0,
55
55
  stroke: "white"
56
56
  }), cartesianGrid && /*#__PURE__*/_jsx(CartesianGrid, {
57
- strokeDasharray: "0",
57
+ horizontal: true,
58
58
  vertical: false
59
59
  }), /*#__PURE__*/_jsx(XAxis, {
60
60
  dataKey: xAxisDataKey && xAxisDataKey,
@@ -5,15 +5,15 @@ export declare const basicToolbar: (string[] | ({
5
5
  indent: string;
6
6
  list?: undefined;
7
7
  })[])[];
8
- export declare const richToolbar: (string[] | {
9
- header: (number | boolean)[];
10
- }[] | ({
8
+ export declare const richToolbar: (string[] | ({
11
9
  list: string;
12
10
  indent?: undefined;
13
11
  } | {
14
12
  indent: string;
15
13
  list?: undefined;
16
14
  })[] | {
15
+ header: (number | boolean)[];
16
+ }[] | {
17
17
  align: string;
18
18
  }[])[];
19
19
  //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,2 @@
1
+ import 'quill/dist/quill.snow.css';
2
+ //# sourceMappingURL=quill.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quill.module.d.ts","sourceRoot":"","sources":["../../../src/packages/globals/styles/quill.module.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAA"}
@@ -0,0 +1 @@
1
+ import 'quill/dist/quill.snow.css';
@@ -1,3 +1,3 @@
1
- declare const formatAxisPrice: (val: any) => string;
1
+ declare function formatAxisPrice(val: any): string;
2
2
  export { formatAxisPrice };
3
3
  //# sourceMappingURL=formatGraphPrice.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatGraphPrice.d.ts","sourceRoot":"","sources":["../../src/packages/utils/formatGraphPrice.ts"],"names":[],"mappings":"AAmCA,QAAA,MAAM,eAAe,QAAS,GAAG,WA+DhC,CAAA;AAED,OAAO,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"formatGraphPrice.d.ts","sourceRoot":"","sources":["../../src/packages/utils/formatGraphPrice.ts"],"names":[],"mappings":"AAAA,iBAAS,eAAe,CAAC,GAAG,EAAE,GAAG,UAkBhC;AAED,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -1,82 +1,17 @@
1
- const firstIndexIsNegative = value => value.charAt(0) === '-';
2
- const precisionValueIsZero = (value, maxEnd) => {
3
- return firstIndexIsNegative(value) ? value.charAt(2 + maxEnd) === '0' : value.charAt(1 + maxEnd) === '0';
4
- };
5
- const setLeftSide = (value, sliceLeft) => {
6
- return firstIndexIsNegative(value) ? `-${value.slice(sliceLeft.start + 1, sliceLeft.end + 1)}` : value.slice(sliceLeft.start, sliceLeft.end);
7
- };
8
- const setRightSide = (value, sliceRight, sliceLeftEnd) => {
9
- return precisionValueIsZero(value, sliceLeftEnd) ? '' : `.${value.slice(sliceRight.start, sliceRight.end)}`;
10
- };
11
- const getFormat = (value, sliceLeft, sliceRight, sizeTerm) => {
12
- return `${setLeftSide(value, sliceLeft)}${setRightSide(value, sliceRight, sliceLeft.end)}${sizeTerm}`;
13
- };
14
- const formatAxisPrice = val => {
15
- const value = String(val);
16
- if (value.match(/^(-\d)|(\d)+$/)) {
17
- const santizitedValue = firstIndexIsNegative(value) ? value.replace('-', '') : value;
18
- const count = santizitedValue.length;
19
- if (count > 3) {
20
- switch (count) {
21
- case 4:
22
- return getFormat(value, {
23
- start: 0,
24
- end: 1
25
- }, {
26
- start: 1,
27
- end: 2
28
- }, 'k');
29
- case 5:
30
- return getFormat(value, {
31
- start: 0,
32
- end: 2
33
- }, {
34
- start: 2,
35
- end: 3
36
- }, 'k');
37
- case 6:
38
- return getFormat(value, {
39
- start: 0,
40
- end: 3
41
- }, {
42
- start: 3,
43
- end: 4
44
- }, 'k');
45
- case 7:
46
- return getFormat(value, {
47
- start: 0,
48
- end: 1
49
- }, {
50
- start: 1,
51
- end: 2
52
- }, 'm');
53
- case 8:
54
- return getFormat(value, {
55
- start: 0,
56
- end: 2
57
- }, {
58
- start: 2,
59
- end: 3
60
- }, 'm');
61
- case 9:
62
- return getFormat(value, {
63
- start: 0,
64
- end: 3
65
- }, {
66
- start: 3,
67
- end: 4
68
- }, 'm');
69
- default:
70
- return getFormat(value, {
71
- start: 0,
72
- end: 3
73
- }, {
74
- start: 3,
75
- end: 4
76
- }, 'm');
77
- }
78
- }
1
+ function formatAxisPrice(val) {
2
+ const num = Number(val);
3
+ if (isNaN(num)) {
4
+ return String(val);
79
5
  }
80
- return value;
81
- };
6
+ const absNum = Math.abs(num);
7
+ let formatted;
8
+ if (absNum >= 1e6) {
9
+ formatted = (num / 1e6).toFixed(1).replace(/\.0$/, '') + 'm';
10
+ } else if (absNum >= 1e3) {
11
+ formatted = (num / 1e3).toFixed(1).replace(/\.0$/, '') + 'k';
12
+ } else {
13
+ formatted = num.toString();
14
+ }
15
+ return formatted;
16
+ }
82
17
  export { formatAxisPrice };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbl-digital/snorre",
3
- "version": "4.1.95",
3
+ "version": "4.1.97",
4
4
  "description": "Design library for BBL Digital",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",
@@ -1,55 +0,0 @@
1
- import Editor from '.';
2
- const meta = {
3
- title: 'Core/Editor',
4
- component: Editor
5
- };
6
- export default meta;
7
- export const Default = {
8
- args: {
9
- label: 'Editor-label',
10
- onChange: e => console.log(e)
11
- },
12
- name: 'Default'
13
- };
14
- export const Rich = {
15
- args: {
16
- label: 'Editor-label',
17
- onChange: e => console.log(e),
18
- type: 'rich',
19
- allowImages: true
20
- },
21
- name: 'Rich'
22
- };
23
- export const ValidElements = {
24
- args: {
25
- label: 'Editor-label',
26
- onChange: e => console.log(e),
27
- type: 'custom',
28
- customToolbar: 'bold italic underline',
29
- validElements: 'strong,p,span,em'
30
- },
31
- name: 'Valid elements'
32
- };
33
- export const InvalidElements = {
34
- args: {
35
- label: 'Editor-label',
36
- onChange: e => console.log(e),
37
- type: 'custom',
38
- customToolbar: 'bold italic underline',
39
- invalidElements: 'button,a,h1,h2,h3,h4,h5,h6'
40
- },
41
- name: 'Invalid elements'
42
- };
43
- export const AllProps = {
44
- args: {
45
- label: 'Editor-label',
46
- onChange: e => console.log(e),
47
- type: 'rich',
48
- allowImages: true,
49
- invalidElements: 'button,a,h1,h2,h3,h4,h5,h6',
50
- invalidMessage: 'Memes are not allowed',
51
- height: 400,
52
- maxHeight: 600
53
- },
54
- name: 'All props'
55
- };
@@ -1,7 +0,0 @@
1
- export const editorContentCss = `
2
- body { font-family:'Source Sans Pro',sans-serif; font-size:16px; } p {margin: 0;} h1,h2,h3,h4,h5,h6 {margin-top: 0;margin-bottom: 0;}
3
- `;
4
- export const editorBlockFormats = 'Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;';
5
- export const plugins = 'autolink lists link image code print preview media paste';
6
- export const richToolbar = 'formatselect | ' + ' | bold italic underline' + ' | bullist numlist indent outdent' + ' | alignleft aligncenter alignright alignjustify' + ' | link unlink';
7
- export const basicToolbar = 'bold italic underline | bullist numlist indent outdent';