@dss-kit/ui-kit 0.3.6 → 0.3.8

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 (25) hide show
  1. package/dist/components/builders/Modal/Modal.js +57 -51
  2. package/dist/components/builders/Modal/ModalHeader/ModalHeader.js +27 -27
  3. package/dist/components/builders/Modal/styles.d.ts +0 -1
  4. package/dist/components/builders/Modal/styles.js +6 -12
  5. package/dist/components/builders/Table/TablePagination/TablePagination.js +1 -1
  6. package/dist/components/charts/LineChart/LineChart.js +17 -15
  7. package/dist/components/charts/PieProgressChart/PieProgressChart.js +16 -14
  8. package/dist/components/controls/Button/Button.js +6 -6
  9. package/dist/components/controls/IconButton/IconButton.d.ts +17 -2
  10. package/dist/components/controls/IconButton/IconButton.js +17 -24
  11. package/dist/components/controls/IconButton/index.d.ts +2 -2
  12. package/dist/components/controls/Input/Input.js +147 -133
  13. package/dist/components/controls/Input/styles.d.ts +2 -0
  14. package/dist/components/controls/Input/styles.js +36 -28
  15. package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +6 -6
  16. package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/ActionMenuButton/ActionMenuButton.js +8 -8
  17. package/dist/components/shared/MarkdownText/MarkdownText.js +10 -10
  18. package/dist/node_modules/@highcharts/react/Highcharts.js +161 -0
  19. package/dist/node_modules/@highcharts/react/options/Title.js +14 -0
  20. package/dist/node_modules/@highcharts/react/options/Tooltip.js +14 -0
  21. package/dist/ui-kit.cjs +8 -8
  22. package/dist/utils/theme/spacing.d.ts +15 -0
  23. package/dist/utils/theme/spacing.js +15 -0
  24. package/package.json +1 -1
  25. package/dist/components/controls/IconButton/IconButton.types.d.ts +0 -11
@@ -0,0 +1,161 @@
1
+ import $, { forwardRef as w, useRef as m, useImperativeHandle as I, useEffect as k } from "react";
2
+ import { renderToStaticMarkup as j } from "react-dom/server";
3
+ import H from "highcharts";
4
+ var P = function(o, l) {
5
+ var h = {};
6
+ for (var i in o) Object.prototype.hasOwnProperty.call(o, i) && l.indexOf(i) < 0 && (h[i] = o[i]);
7
+ if (o != null && typeof Object.getOwnPropertySymbols == "function")
8
+ for (var p = 0, i = Object.getOwnPropertySymbols(o); p < i.length; p++)
9
+ l.indexOf(i[p]) < 0 && Object.prototype.propertyIsEnumerable.call(o, i[p]) && (h[i[p]] = o[i[p]]);
10
+ return h;
11
+ };
12
+ H.AST.allowedAttributes.indexOf("data-hc-option") === -1 && H.AST.allowedAttributes.push("data-hc-option");
13
+ let O = H;
14
+ const A = {
15
+ logLevel: "silent",
16
+ log(...o) {
17
+ this.logLevel === "debug" && console.log(...o);
18
+ }
19
+ };
20
+ function J(o) {
21
+ if (o === void 0) {
22
+ O = H, delete O.__provided;
23
+ return;
24
+ }
25
+ O = o, O.__provided = !0;
26
+ }
27
+ function N() {
28
+ return O;
29
+ }
30
+ const S = (o) => Array.isArray(o) ? o.flat() : [o];
31
+ function b(o, l = void 0) {
32
+ const h = {};
33
+ function i(t, e, c = null) {
34
+ const a = e.split(".");
35
+ let u = t;
36
+ for (let f = 0; f < a.length - 1; f++) {
37
+ const r = a[f];
38
+ u[r] || (u[r] = {}), u = u[r];
39
+ }
40
+ return u[a[a.length - 1]] = c, t;
41
+ }
42
+ function p(t) {
43
+ return l ? l(t) : t.filter((e) => typeof e == "string").join("");
44
+ }
45
+ function g(t) {
46
+ return typeof t == "object" && t !== null && "$$typeof" in t && "props" in t;
47
+ }
48
+ function _(t, e) {
49
+ return Object.assign(Object.assign({}, t), { childOption: e.childOption ? `${e.childOption}.${t.childOption}` : t.childOption, HCOption: e.HCOption ? `${e.HCOption}.${t.HCOption}` : t.HCOption });
50
+ }
51
+ function C(t, e, c) {
52
+ var a, u, f;
53
+ if (!t)
54
+ return;
55
+ if (Array.isArray(t) && t.some((n) => {
56
+ var d;
57
+ return (d = n?.props) === null || d === void 0 ? void 0 : d["data-hc-option"];
58
+ })) {
59
+ const n = [];
60
+ for (const d of t) {
61
+ const v = (a = d?.props) === null || a === void 0 ? void 0 : a["data-hc-option"];
62
+ v ? i(e, v, p([d])) : n.push(d);
63
+ }
64
+ n.length && c.childOption && i(e, c.childOption, p(n));
65
+ return;
66
+ }
67
+ const r = [];
68
+ if (Array.isArray(t))
69
+ for (const n of t) {
70
+ if (!((u = n?.type) === null || u === void 0) && u._HCReact) {
71
+ const d = n.type._HCReact;
72
+ n.type._HCReact = _(d, c), s(n);
73
+ continue;
74
+ }
75
+ r.push(n);
76
+ }
77
+ else {
78
+ const n = t;
79
+ if (!((f = n?.type) === null || f === void 0) && f._HCReact) {
80
+ const d = n.type._HCReact;
81
+ n.type._HCReact = _(d, c), s(n);
82
+ } else
83
+ r.push(n);
84
+ }
85
+ if (c.childOption) {
86
+ const n = r.length > 0 ? r : [t];
87
+ i(e, c.childOption, p(n));
88
+ }
89
+ }
90
+ function s(t) {
91
+ var e, c, a, u, f;
92
+ if (!t || typeof t != "object")
93
+ return;
94
+ const r = (e = t.type) === null || e === void 0 ? void 0 : e._HCReact;
95
+ if (!r?.HCOption)
96
+ return;
97
+ const n = (c = h[f = r.HCOption]) !== null && c !== void 0 ? c : h[f] = r.isArrayType ? [] : {}, d = Array.isArray(n), v = d ? {} : n, R = (a = t.props) !== null && a !== void 0 ? a : {}, { children: y } = R, E = P(R, ["children"]);
98
+ r.defaultOptions && Object.assign(v, r.defaultOptions), Object.assign(v, E), typeof y == "string" && r.childOption ? i(v, r.childOption, y) : Array.isArray(y) ? C(y, v, r) : g(y) && l && (!((u = y.props) === null || u === void 0) && u.children && Object.keys(y.props).length === 1 ? C(y.props.children, v, r) : r.childOption && i(v, r.childOption, l(y))), d && h[r.HCOption].push(v);
99
+ }
100
+ return Array.isArray(o) ? o.flat().forEach((t) => s(t)) : s(o), h;
101
+ }
102
+ const T = w(function(l, h) {
103
+ l.highcharts && J(l.highcharts);
104
+ const i = O.merge(Object.assign({
105
+ title: { text: l.title || void 0 }
106
+ }, l.options || {}), Object.assign({ series: l.children ? S(l.children).filter((s) => {
107
+ var t;
108
+ return ((t = s?.type) === null || t === void 0 ? void 0 : t.type) === "Series";
109
+ }).map((s) => {
110
+ var t, e, c;
111
+ return O.merge({
112
+ type: (t = s.props.type) !== null && t !== void 0 ? t : (c = (e = s.type) === null || e === void 0 ? void 0 : e._HCReact) === null || c === void 0 ? void 0 : c.HC_Option.replace("series.", ""),
113
+ data: s.props.data || []
114
+ }, Object.assign(Object.assign({}, s.props.options || {}), b(s.props.children, j)));
115
+ }) : [] }, b(l.children, j)), l.options || {}), p = m(), g = m();
116
+ I(h, () => ({
117
+ get chart() {
118
+ return g.current;
119
+ },
120
+ get container() {
121
+ return p.current;
122
+ }
123
+ }), []);
124
+ const _ = (s) => {
125
+ var t, e;
126
+ (t = (e = s.title).text) !== null && t !== void 0 || (e.text = l.title);
127
+ }, C = () => {
128
+ l.children && S(l.children).filter((t) => {
129
+ var e;
130
+ return ((e = t?.type) === null || e === void 0 ? void 0 : e.type) === "Series";
131
+ }).forEach((t, e) => {
132
+ var c;
133
+ if (t.props) {
134
+ const a = t.props, { children: u, type: f, options: r } = a, n = P(a, ["children", "type", "options"]);
135
+ r && (i.series[e] = O.merge(i.series[e], r)), i.series[e] = O.merge(i.series[e], Object.assign(Object.assign({ type: f ?? ((c = t?.type) === null || c === void 0 ? void 0 : c._HCReact.HC_Option.replace("series.", "")) }, b(t.props.children)), n));
136
+ }
137
+ });
138
+ };
139
+ return k(() => {
140
+ if (A.log(JSON.stringify(i, void 0, " ")), g.current)
141
+ A.log("Updating chart", JSON.parse(JSON.stringify(i))), _(i), C(), g.current.update(Object.assign(Object.assign({}, i), b(l.children, j)), !0, !0);
142
+ else {
143
+ const s = l.chartConstructor || "chart";
144
+ A.log("Creating chart using", s, "constructor"), g.current = N()[s](p.current, i);
145
+ }
146
+ }), $.createElement("div", Object.assign({}, l.containerProps, { ref: p }));
147
+ });
148
+ function x(o) {
149
+ return null;
150
+ }
151
+ x.type = "Series";
152
+ T.Series = x;
153
+ export {
154
+ T as Chart,
155
+ O as Highcharts,
156
+ A as Logger,
157
+ x as Series,
158
+ T as default,
159
+ N as getHighcharts,
160
+ J as setHighcharts
161
+ };
@@ -0,0 +1,14 @@
1
+ function t(e) {
2
+ return null;
3
+ }
4
+ t._HCReact = {
5
+ type: "HC_Option",
6
+ HCOption: "title",
7
+ childOption: "text",
8
+ defaultOptions: void 0,
9
+ isArrayType: !1
10
+ };
11
+ export {
12
+ t as Title,
13
+ t as default
14
+ };
@@ -0,0 +1,14 @@
1
+ function t(o) {
2
+ return null;
3
+ }
4
+ t._HCReact = {
5
+ type: "HC_Option",
6
+ HCOption: "tooltip",
7
+ childOption: "format",
8
+ defaultOptions: { useHTML: !0 },
9
+ isArrayType: !1
10
+ };
11
+ export {
12
+ t as Tooltip,
13
+ t as default
14
+ };