@thebuoyant-tsdev/mui-ts-library 3.9.1 → 3.11.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.
- package/README.de.md +93 -0
- package/README.md +93 -0
- package/dist/components/chord-chart/ChordChart.d.ts +1 -1
- package/dist/components/chord-chart/ChordChart.js +155 -137
- package/dist/components/chord-chart/ChordChart.types.d.ts +1 -1
- package/dist/components/circle-packing-chart/CirclePackingChart.d.ts +1 -1
- package/dist/components/circle-packing-chart/CirclePackingChart.js +134 -121
- package/dist/components/gantt-chart/hooks/useGanttDrag.js +44 -38
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.d.ts +1 -1
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +319 -247
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.d.ts +3 -1
- package/dist/components/json-editor/JsonEditorContent.js +134 -119
- package/dist/components/json-editor/JsonEditorToolbar.js +3 -3
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +131 -130
- package/dist/components/radial-tree-chart/RadialTreeChart.d.ts +1 -1
- package/dist/components/radial-tree-chart/RadialTreeChart.js +207 -146
- package/dist/components/radial-tree-chart/RadialTreeChart.types.d.ts +2 -0
- package/dist/components/rich-text-editor/RichTextEditor.js +1 -1
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +40 -39
- package/dist/components/shared/useTimedFlag.d.ts +6 -0
- package/dist/components/shared/useTimedFlag.js +14 -0
- package/dist/components/sql-editor/SqlEditorHistoryMenu.js +1 -1
- package/dist/components/sql-editor/useSqlQueryHistory.js +14 -12
- package/dist/components/sql-editor/util/sqlQueryHistory.util.d.ts +1 -0
- package/dist/components/sql-editor/util/sqlQueryHistory.util.js +21 -13
- package/dist/components/sunburst-chart/SunburstChart.d.ts +1 -1
- package/dist/components/sunburst-chart/SunburstChart.js +193 -150
- package/dist/components/sunburst-chart/SunburstChart.types.d.ts +2 -0
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +7 -5
- package/dist/index.cjs +2 -2
- package/dist/index.js +7 -7
- package/package.json +1 -1
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import f from "
|
|
5
|
-
import p from "@mui/icons-material/
|
|
1
|
+
import { useTimedFlag as e } from "../shared/useTimedFlag.js";
|
|
2
|
+
import { useEffect as t, useState as n } from "react";
|
|
3
|
+
import { Box as r, Button as i, Dialog as a, DialogActions as o, DialogContent as s, DialogTitle as c, TextField as l, Typography as u } from "@mui/material";
|
|
4
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
import p from "@mui/icons-material/ContentCopy";
|
|
6
|
+
import m from "@mui/icons-material/Check";
|
|
6
7
|
//#region src/components/rich-text-editor/RichTextEditorMarkdownDialog.tsx
|
|
7
|
-
function
|
|
8
|
-
let [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, [
|
|
12
|
-
function S() {
|
|
13
|
-
g.commands.setContent(v), h();
|
|
14
|
-
}
|
|
8
|
+
function h({ open: h, onClose: g, editor: _, translation: v }) {
|
|
9
|
+
let [y, b] = n(""), [x, S] = e();
|
|
10
|
+
t(() => {
|
|
11
|
+
h && b(_.storage.markdown.getMarkdown());
|
|
12
|
+
}, [h, _]);
|
|
15
13
|
function C() {
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
_.commands.setContent(y), g();
|
|
15
|
+
}
|
|
16
|
+
function w() {
|
|
17
|
+
navigator.clipboard.writeText(y).then(() => {
|
|
18
|
+
S();
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
open:
|
|
22
|
-
onClose:
|
|
21
|
+
return /* @__PURE__ */ f(a, {
|
|
22
|
+
open: h,
|
|
23
|
+
onClose: g,
|
|
23
24
|
maxWidth: "sm",
|
|
24
25
|
fullWidth: !0,
|
|
25
26
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ d(c, { children: v.markdownDialogTitle }),
|
|
28
|
+
/* @__PURE__ */ f(s, {
|
|
28
29
|
sx: {
|
|
29
30
|
display: "flex",
|
|
30
31
|
flexDirection: "column",
|
|
31
32
|
gap: 1.5,
|
|
32
33
|
pt: "16px !important"
|
|
33
34
|
},
|
|
34
|
-
children: [/* @__PURE__ */ u
|
|
35
|
+
children: [/* @__PURE__ */ d(u, {
|
|
35
36
|
variant: "body2",
|
|
36
37
|
color: "text.secondary",
|
|
37
|
-
children:
|
|
38
|
-
}), /* @__PURE__ */
|
|
38
|
+
children: v.markdownDialogDescription
|
|
39
|
+
}), /* @__PURE__ */ d(l, {
|
|
39
40
|
autoFocus: !0,
|
|
40
41
|
fullWidth: !0,
|
|
41
42
|
multiline: !0,
|
|
42
43
|
minRows: 8,
|
|
43
44
|
maxRows: 16,
|
|
44
|
-
value:
|
|
45
|
-
onChange: (e) =>
|
|
45
|
+
value: y,
|
|
46
|
+
onChange: (e) => b(e.target.value),
|
|
46
47
|
variant: "outlined",
|
|
47
48
|
size: "small",
|
|
48
49
|
sx: { fontFamily: "monospace" },
|
|
@@ -52,32 +53,32 @@ function m({ open: m, onClose: h, editor: g, translation: _ }) {
|
|
|
52
53
|
} } }
|
|
53
54
|
})]
|
|
54
55
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ f(o, {
|
|
56
57
|
sx: {
|
|
57
58
|
px: 3,
|
|
58
59
|
pb: 2,
|
|
59
60
|
gap: 1
|
|
60
61
|
},
|
|
61
62
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ d(r, {
|
|
63
64
|
sx: { flex: 1 },
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
-
onClick:
|
|
66
|
-
startIcon:
|
|
65
|
+
children: /* @__PURE__ */ d(i, {
|
|
66
|
+
onClick: w,
|
|
67
|
+
startIcon: x ? /* @__PURE__ */ d(m, {
|
|
67
68
|
fontSize: "small",
|
|
68
69
|
color: "success"
|
|
69
|
-
}) : /* @__PURE__ */
|
|
70
|
-
children:
|
|
70
|
+
}) : /* @__PURE__ */ d(p, { fontSize: "small" }),
|
|
71
|
+
children: x ? v.markdownDialogCopied : v.markdownDialogCopy
|
|
71
72
|
})
|
|
72
73
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
onClick:
|
|
75
|
-
children:
|
|
74
|
+
/* @__PURE__ */ d(i, {
|
|
75
|
+
onClick: g,
|
|
76
|
+
children: v.markdownDialogCancel
|
|
76
77
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
onClick:
|
|
78
|
+
/* @__PURE__ */ d(i, {
|
|
79
|
+
onClick: C,
|
|
79
80
|
variant: "contained",
|
|
80
|
-
children:
|
|
81
|
+
children: v.markdownDialogApply
|
|
81
82
|
})
|
|
82
83
|
]
|
|
83
84
|
})
|
|
@@ -85,4 +86,4 @@ function m({ open: m, onClose: h, editor: g, translation: _ }) {
|
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
//#endregion
|
|
88
|
-
export {
|
|
89
|
+
export { h as RichTextEditorMarkdownDialog };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A boolean that auto-resets to `false` after `duration` ms — for "Copied!"-style
|
|
3
|
+
* transient feedback. Re-triggering restarts the timer instead of stacking timers,
|
|
4
|
+
* and the pending timeout is cleared on unmount to avoid a state update after unmount.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useTimedFlag(duration?: number): [boolean, () => void];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
+
//#region src/components/shared/useTimedFlag.ts
|
|
3
|
+
function i(i = 2e3) {
|
|
4
|
+
let [a, o] = r(!1), s = n(null), c = e(() => {
|
|
5
|
+
s.current && clearTimeout(s.current), o(!0), s.current = setTimeout(() => {
|
|
6
|
+
o(!1), s.current = null;
|
|
7
|
+
}, i);
|
|
8
|
+
}, [i]);
|
|
9
|
+
return t(() => () => {
|
|
10
|
+
s.current && clearTimeout(s.current);
|
|
11
|
+
}, []), [a, c];
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { i as useTimedFlag };
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { addQueryToHistory as e, loadQueryHistory as t, saveQueryHistory as n } from "./util/sqlQueryHistory.util.js";
|
|
2
|
-
import { useCallback as r,
|
|
2
|
+
import { useCallback as r, useEffect as i, useState as a } from "react";
|
|
3
3
|
//#region src/components/sql-editor/useSqlQueryHistory.ts
|
|
4
|
-
function
|
|
5
|
-
let [
|
|
6
|
-
return {
|
|
7
|
-
|
|
4
|
+
function o(o, s) {
|
|
5
|
+
let [c, l] = a(() => t(o));
|
|
6
|
+
return i(() => {
|
|
7
|
+
l(t(o));
|
|
8
|
+
}, [o]), {
|
|
9
|
+
history: c,
|
|
8
10
|
addEntry: r((t) => {
|
|
9
|
-
|
|
10
|
-
let i = e(r, t,
|
|
11
|
-
return n(
|
|
11
|
+
l((r) => {
|
|
12
|
+
let i = e(r, t, s);
|
|
13
|
+
return n(o, i), i;
|
|
12
14
|
});
|
|
13
|
-
}, [
|
|
15
|
+
}, [o, s]),
|
|
14
16
|
clearHistory: r(() => {
|
|
15
|
-
|
|
16
|
-
}, [
|
|
17
|
+
l([]), n(o, []);
|
|
18
|
+
}, [o])
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
//#endregion
|
|
20
|
-
export {
|
|
22
|
+
export { o as useSqlQueryHistory };
|
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
//#region src/components/sql-editor/util/sqlQueryHistory.util.ts
|
|
2
|
-
|
|
2
|
+
var e = 0;
|
|
3
|
+
function t() {
|
|
4
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (e += 1, `${Date.now()}-${e}`);
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
3
7
|
if (typeof window > "u") return [];
|
|
4
8
|
try {
|
|
5
|
-
let
|
|
6
|
-
if (!
|
|
7
|
-
let
|
|
8
|
-
return Array.isArray(
|
|
9
|
+
let n = window.localStorage.getItem(e);
|
|
10
|
+
if (!n) return [];
|
|
11
|
+
let r = JSON.parse(n);
|
|
12
|
+
return Array.isArray(r) ? r.filter((e) => typeof e?.sql == "string" && typeof e?.timestamp == "number").map((e) => ({
|
|
13
|
+
...e,
|
|
14
|
+
id: typeof e.id == "string" ? e.id : t()
|
|
15
|
+
})) : [];
|
|
9
16
|
} catch {
|
|
10
17
|
return [];
|
|
11
18
|
}
|
|
12
19
|
}
|
|
13
|
-
function
|
|
20
|
+
function r(e, t) {
|
|
14
21
|
if (!(typeof window > "u")) try {
|
|
15
22
|
window.localStorage.setItem(e, JSON.stringify(t));
|
|
16
23
|
} catch {}
|
|
17
24
|
}
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
if (!
|
|
21
|
-
let
|
|
25
|
+
function i(e, n, r) {
|
|
26
|
+
let i = n.trim();
|
|
27
|
+
if (!i) return e;
|
|
28
|
+
let a = e.filter((e) => e.sql !== i);
|
|
22
29
|
return [{
|
|
23
|
-
|
|
30
|
+
id: t(),
|
|
31
|
+
sql: i,
|
|
24
32
|
timestamp: Date.now()
|
|
25
|
-
}, ...
|
|
33
|
+
}, ...a].slice(0, Math.max(0, r));
|
|
26
34
|
}
|
|
27
35
|
//#endregion
|
|
28
|
-
export {
|
|
36
|
+
export { i as addQueryToHistory, n as loadQueryHistory, r as saveQueryHistory };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SunburstChartProps } from "./SunburstChart.types";
|
|
2
|
-
export declare function SunburstChart({ data, size, showSegmentLabels, innerRadius, sortBy, chartColors, showRootLabel, onSegmentClick, onZoomChange, valueDecimalCount, valueDecimalSeparator, valueThousandsSeparator, zoomable, disabled, }: SunburstChartProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function SunburstChart({ data, size, showSegmentLabels, innerRadius, sortBy, chartColors, showRootLabel, onSegmentClick, onZoomChange, valueDecimalCount, valueDecimalSeparator, valueThousandsSeparator, zoomable, duration, disabled, translation, }: SunburstChartProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare namespace SunburstChart {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|