@orangelogic/design-system 2.130.0 → 2.132.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 (38) hide show
  1. package/library/assets/validation.worker-Dc_pkZlD.js +1 -0
  2. package/library/chunks/{color-swatch-group.DPaKBfvX.js → color-swatch-group.Cy-M_lbx.js} +1 -1
  3. package/library/chunks/{document-viewer.Dn_vUYCW.js → document-viewer.CzGnnA_9.js} +2 -2
  4. package/library/chunks/{folder-select.DMpO7oQF.js → folder-select.CHzRsSGM.js} +45 -45
  5. package/library/chunks/image.BzmclWBR.js +150 -0
  6. package/library/chunks/{image.BC_hwk-b.js → image.DAtx64Jj.js} +1 -1
  7. package/library/chunks/{list-editor.DfOsqO4y.js → list-editor.CwCdVzMl.js} +2 -2
  8. package/library/chunks/{resizable-component.styles.BVhOesNE.js → resizable-component.styles.B5N-oYx6.js} +1 -1
  9. package/library/chunks/{table.Cf3C72Lv.js → table.C6YsaNOh.js} +2460 -2081
  10. package/library/components/asset-link-format.js +1 -1
  11. package/library/components/atoms.js +3 -3
  12. package/library/components/audio.js +1 -1
  13. package/library/components/color-swatch-group.js +2 -2
  14. package/library/components/cropper.js +1 -1
  15. package/library/components/document-viewer.js +3 -3
  16. package/library/components/folder-select.js +1 -1
  17. package/library/components/image.js +2 -2
  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 +1 -1
  22. package/library/components/table.js +52 -50
  23. package/library/components/types.js +10 -10
  24. package/library/components/video.js +2 -2
  25. package/library/package.json +1 -1
  26. package/library/packages/atoms/src/components/table/table.d.ts +43 -0
  27. package/library/packages/events/src/cx-table-validation-change.d.ts +8 -0
  28. package/library/packages/events/src/events.d.ts +7 -6
  29. package/library/packages/hybrid/table-core/src/tabulator-tables/index.d.ts +1 -0
  30. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/Validate.d.ts +81 -13
  31. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/defaults/rule-functions.d.ts +20 -0
  32. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/defaults/validators.d.ts +9 -18
  33. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/validation-worker-client.d.ts +13 -0
  34. package/library/packages/types/src/table.d.ts +55 -1
  35. package/library/react-web-component.d.ts +11 -3
  36. package/library/utils.js +1 -1
  37. package/package.json +1 -1
  38. package/library/chunks/image.9qwbjGNb.js +0 -150
@@ -1,150 +0,0 @@
1
- import { r as g } from "./number.B4PQLJIg.js";
2
- function m(n, t, e, i) {
3
- const o = n / t, r = e / i;
4
- let c = n, a = t;
5
- return o > r ? c = Math.round(a * r) : a = Math.round(c / r), {
6
- height: a,
7
- width: c
8
- };
9
- }
10
- function p(n, t, e, i, o) {
11
- const r = new Image();
12
- return r.src = n, r.crossOrigin = "anonymous", new Promise((c) => {
13
- r.onload = () => {
14
- const a = document.createElement("canvas");
15
- if (t > i || e > o) {
16
- const h = i / t, l = o / e, u = Math.max(h, l);
17
- a.width = t * u, a.height = e * u;
18
- } else
19
- a.width = t, a.height = e;
20
- const s = a.getContext("2d");
21
- s ? (s.drawImage(r, 0, 0, a.width, a.height), c({
22
- height: a.height,
23
- url: a.toDataURL("image/jpeg"),
24
- width: a.width
25
- })) : c({
26
- height: e,
27
- url: n,
28
- width: t
29
- });
30
- }, r.onerror = () => {
31
- c({
32
- height: e,
33
- url: n,
34
- width: t
35
- });
36
- };
37
- });
38
- }
39
- function R(n, t) {
40
- const e = new Image();
41
- return e.src = n.url, e.crossOrigin = "anonymous", new Promise((i) => {
42
- e.onload = () => {
43
- const o = document.createElement("canvas");
44
- o.width = t.width, o.height = t.height;
45
- const r = o.getContext("2d");
46
- r ? (r.drawImage(e, -t.x, -t.y, n.width, n.height), i(o.toDataURL("image/jpeg"))) : i(n.url);
47
- }, e.onerror = () => {
48
- i(n.url);
49
- };
50
- });
51
- }
52
- function S(n, t) {
53
- const e = new Image();
54
- return e.src = n.url, e.crossOrigin = "anonymous", new Promise((i) => {
55
- e.onload = () => {
56
- const { height: o, width: r } = g(n.width, n.height, t), c = document.createElement("canvas");
57
- c.width = r, c.height = o;
58
- const a = c.getContext("2d");
59
- a ? (a.fillStyle = "white", a.fillRect(0, 0, r, o), a.translate(r / 2, o / 2), a.rotate(t * Math.PI / 180), a.drawImage(
60
- e,
61
- -n.width / 2,
62
- -n.height / 2,
63
- n.width,
64
- n.height
65
- ), a.rotate(-(t * Math.PI) / 180), a.translate(-r / 2, -o / 2), i(c.toDataURL("image/jpeg"))) : i(n.url);
66
- }, e.onerror = () => {
67
- i(n.url);
68
- };
69
- });
70
- }
71
- function b(n) {
72
- const t = n.getBoundingClientRect(), e = t.width / t.height, i = n.naturalWidth / n.naturalHeight;
73
- let o, r;
74
- return i > e ? (o = t.width, r = t.width / i) : (r = t.height, o = t.height * i), { height: r, width: o };
75
- }
76
- async function d(n) {
77
- const t = new Image();
78
- return t.src = n, await t.decode(), [t.naturalWidth, t.naturalHeight];
79
- }
80
- function I(n) {
81
- const t = n.trim();
82
- if (!t)
83
- return !1;
84
- if (t.startsWith("data:image/") || t.startsWith("blob:"))
85
- return !0;
86
- try {
87
- const e = new URL(t, globalThis.location.href);
88
- return ["blob:", "data:", "http:", "https:"].includes(e.protocol);
89
- } catch {
90
- return !1;
91
- }
92
- }
93
- async function M(n) {
94
- try {
95
- const t = await fetch(n), e = t.headers.get("Content-Type");
96
- if (!e)
97
- return null;
98
- const i = e.split("/")[1], o = await t.blob();
99
- if (!o)
100
- return null;
101
- const r = URL.createObjectURL(o), [c, a] = await d(r);
102
- return {
103
- fileExtension: i,
104
- height: a,
105
- src: r,
106
- width: c
107
- };
108
- } catch {
109
- return null;
110
- }
111
- }
112
- function w(n = /* @__PURE__ */ new Date()) {
113
- const e = [
114
- "Jan",
115
- "Feb",
116
- "Mar",
117
- "Apr",
118
- "May",
119
- "Jun",
120
- "Jul",
121
- "Aug",
122
- "Sep",
123
- "Oct",
124
- "Nov",
125
- "Dec"
126
- ][n.getMonth()], i = n.getDate(), o = n.getFullYear();
127
- let r = n.getHours();
128
- const a = r < 12 ? "AM" : "PM";
129
- r = r % 12, r = r === 0 ? 12 : r;
130
- const s = n.getMinutes().toString().padStart(2, "0"), h = n.getSeconds().toString().padStart(2, "0"), l = n.getMilliseconds().toString().padStart(3, "0");
131
- return `Screenshot - ${e} ${i} ${o} ${r}-${s}-${h}-${l} ${a}`;
132
- }
133
- function y(n) {
134
- const t = n.split(".");
135
- if (t.length <= 1 || n.startsWith(".") && t.length === 2)
136
- return n.slice(0, 256);
137
- const e = t.slice(0, -1).join(".").trim();
138
- return e.length === 0 || e === "image" ? w() : e.slice(0, 256 - t[1].length);
139
- }
140
- export {
141
- S as a,
142
- R as b,
143
- m as c,
144
- d,
145
- M as e,
146
- y as f,
147
- b as g,
148
- I as i,
149
- p as r
150
- };