@orangelogic/design-system 2.94.0 → 2.96.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 (35) hide show
  1. package/library/chunks/{color-swatch-group.Q8ybVS0A.js → color-swatch-group.CKHEL4hJ.js} +1 -1
  2. package/library/chunks/{cropper.C3G5CGTF.js → cropper.uKGcvnPk.js} +2 -2
  3. package/library/chunks/{file-on-demand.Vj4PI0tu.js → file-on-demand.KQlA1JFF.js} +192 -189
  4. package/library/chunks/{image.C3LupRuN.js → image.C-Covc0H.js} +320 -299
  5. package/library/chunks/{image.ocYnNdYK.js → image.Dtdklw5q.js} +1 -1
  6. package/library/chunks/{index.B7slZiaV.js → index.BgXEXk4m.js} +3 -3
  7. package/library/chunks/{list-editor.CZzuw4XU.js → list-editor.De7nc_Wd.js} +2 -2
  8. package/library/chunks/number.CCF6IxpN.js +105 -0
  9. package/library/chunks/{table.CYxWpvAC.js → table.Cr0s-nqe.js} +2 -1
  10. package/library/chunks/{time.wo2iH5iw.js → time.BNrE47-8.js} +1 -1
  11. package/library/components/asset-link-format.js +3 -3
  12. package/library/components/atoms.js +2 -2
  13. package/library/components/color-swatch-group.js +2 -2
  14. package/library/components/cropper.js +1 -1
  15. package/library/components/file-on-demand.js +2 -2
  16. package/library/components/format-time.js +1 -1
  17. package/library/components/image.js +1 -1
  18. package/library/components/list-editor.js +2 -2
  19. package/library/components/masonry.js +1 -1
  20. package/library/components/molecules.js +2 -2
  21. package/library/components/organisms.js +2 -2
  22. package/library/components/table.js +1 -1
  23. package/library/components/textarea.js +1 -1
  24. package/library/components/types.js +23 -19
  25. package/library/components/video.js +1 -1
  26. package/library/package.json +1 -1
  27. package/library/packages/base/src/resizable-element.d.ts +9 -1
  28. package/library/packages/molecules/src/mentions/mentions.d.ts +1 -0
  29. package/library/packages/organisms/src/file-on-demand/file-on-demand.constants.d.ts +1 -0
  30. package/library/packages/types/src/resizable-element.d.ts +5 -0
  31. package/library/packages/utils/src/number/number.d.ts +4 -1
  32. package/library/react-web-component.d.ts +8 -0
  33. package/library/utils.js +4 -4
  34. package/package.json +1 -1
  35. package/library/chunks/number.DE78rV_g.js +0 -104
@@ -1,104 +0,0 @@
1
- function f({
2
- decimals: e = 2,
3
- inputUnit: t = "B",
4
- targetUnit: n = "B",
5
- value: r
6
- }) {
7
- const s = {
8
- B: 1,
9
- GB: 1073741824,
10
- KB: 1024,
11
- MB: 1048576,
12
- TB: 1099511627776
13
- }, i = {
14
- Gb: 1024 ** 3 / 8,
15
- Kb: 1024 / 8,
16
- Mb: 1024 ** 2 / 8,
17
- Tb: 1024 ** 4 / 8,
18
- b: 1 / 8
19
- }, o = { ...s, ...i }, a = o[n], d = r * o[t], c = parseFloat((d / a).toFixed(e));
20
- return Number.isNaN(c) ? 0 : c;
21
- }
22
- function h(e) {
23
- return e > 360 ? 360 : e < -360 ? -360 : e;
24
- }
25
- function u(e, t) {
26
- return t === 0 ? e : u(t, e % t);
27
- }
28
- function l(e, t) {
29
- if (!e || !t)
30
- return "-- / --";
31
- const n = u(e, t);
32
- return `${e / n} / ${t / n}`;
33
- }
34
- function m(e, t) {
35
- const n = Math.round(e), r = Math.round(t), s = u(n, r);
36
- return {
37
- height: r / s,
38
- width: n / s
39
- };
40
- }
41
- function g(e, t, n) {
42
- const r = n * Math.PI / 180;
43
- if (n % 90 === 0)
44
- return {
45
- height: n % 180 === 0 ? t : e,
46
- width: n % 180 === 0 ? e : t
47
- };
48
- const s = Math.abs(Math.cos(r)), i = Math.abs(Math.sin(r)), o = e * s + t * i, a = e * i + t * s;
49
- return {
50
- height: Math.round(a),
51
- width: Math.round(o)
52
- };
53
- }
54
- function N(e) {
55
- if (!e || typeof e != "string")
56
- return 0;
57
- const t = e.trim();
58
- if (!t)
59
- return 0;
60
- if (t.endsWith("s") && !t.endsWith("ms")) {
61
- const n = parseFloat(t);
62
- return isNaN(n) || n < 0 ? 0 : n * 1e3;
63
- }
64
- if (t.endsWith("m")) {
65
- const n = parseFloat(t);
66
- return isNaN(n) || n < 0 ? 0 : n * 60 * 1e3;
67
- }
68
- if (t.endsWith("h")) {
69
- const n = parseFloat(t);
70
- return isNaN(n) || n < 0 ? 0 : n * 60 * 60 * 1e3;
71
- }
72
- if (t.endsWith("ms")) {
73
- const n = parseFloat(t);
74
- return isNaN(n) || n < 0 ? 0 : n;
75
- }
76
- return 0;
77
- }
78
- function b(e) {
79
- const t = /^(-?\d*\.?\d+)([a-zA-Z%]*)$/.exec(e.trim());
80
- if (!t)
81
- return null;
82
- const n = Number.parseFloat(t[1]);
83
- return { unit: t[2] || "", value: n };
84
- }
85
- function p(e) {
86
- if (!Number.isFinite(e))
87
- return "0";
88
- const [t, n] = String(e).split("."), r = t.startsWith("-"), i = (r ? t.slice(1) : t).replace(
89
- /\B(?=(\d{3})+(?!\d))/g,
90
- ","
91
- ), o = r ? "-" : "";
92
- return n !== void 0 ? `${o}${i}.${n}` : `${o}${i}`;
93
- }
94
- export {
95
- f as a,
96
- N as b,
97
- m as c,
98
- l as d,
99
- b as e,
100
- p as f,
101
- u as g,
102
- g as r,
103
- h as s
104
- };