@nice2dev/ui 1.4.21 → 1.4.23
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/CHANGELOG.md +79 -0
- package/dist/NiceCodeEditor-CBgbzwjx.cjs +297 -0
- package/dist/{NiceMention-DhaTUqvR.cjs → NiceMention-D330ovOt.cjs} +1 -1
- package/dist/{NicePivotGrid-BshofJh1.cjs → NicePivotGrid-B5Fgi5E_.cjs} +1 -1
- package/dist/charts/NiceAdvancedCharts.mjs +657 -613
- package/dist/charts/NiceBarGauge.mjs +100 -65
- package/dist/charts/NiceBullet.mjs +103 -98
- package/dist/charts/NiceChart.mjs +269 -266
- package/dist/charts/NiceCircularGauge.mjs +99 -70
- package/dist/charts/NiceLinearGauge.mjs +168 -119
- package/dist/charts/NicePieChart.mjs +94 -49
- package/dist/charts/NicePolarChart.mjs +2 -2
- package/dist/charts-C9B548D2.cjs +924 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +24 -2
- package/dist/{core-lazy-DirbU7jp.cjs → core-lazy-B54FdghB.cjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/editors/rich/NiceCodeEditor.mjs +525 -504
- package/dist/editors.cjs +1 -1
- package/dist/index.cjs +8 -3
- package/dist/index.d.ts +29 -2
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +8 -0
- package/dist/style.css +1 -1
- package/dist/tools/NiceGitManager.mjs +5 -0
- package/dist/workflow/NiceTaskInbox.mjs +14 -12
- package/package.json +4 -4
- package/dist/NiceCodeEditor-DhdjnDLV.cjs +0 -289
- package/dist/charts-C3Q3r8Yz.cjs +0 -918
|
@@ -1,83 +1,112 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
const
|
|
3
|
-
value:
|
|
4
|
-
min:
|
|
5
|
-
max:
|
|
6
|
-
width:
|
|
7
|
-
height:
|
|
8
|
-
startAngle:
|
|
9
|
-
endAngle:
|
|
10
|
-
color:
|
|
11
|
-
trackColor:
|
|
12
|
-
label:
|
|
13
|
-
formatValue:
|
|
14
|
-
ranges:
|
|
1
|
+
import { jsx as c, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
const J = ({
|
|
3
|
+
value: a,
|
|
4
|
+
min: x = 0,
|
|
5
|
+
max: _ = 100,
|
|
6
|
+
width: s = 200,
|
|
7
|
+
height: i = 200,
|
|
8
|
+
startAngle: r = 225,
|
|
9
|
+
endAngle: h = -45,
|
|
10
|
+
color: A,
|
|
11
|
+
trackColor: C,
|
|
12
|
+
label: m,
|
|
13
|
+
formatValue: y,
|
|
14
|
+
ranges: M,
|
|
15
15
|
className: L,
|
|
16
|
-
style:
|
|
17
|
-
testId:
|
|
18
|
-
"data-testid":
|
|
16
|
+
style: j,
|
|
17
|
+
testId: P,
|
|
18
|
+
"data-testid": R
|
|
19
19
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
x:
|
|
22
|
-
y:
|
|
23
|
-
}),
|
|
24
|
-
const
|
|
25
|
-
return `M${
|
|
26
|
-
},
|
|
27
|
-
let
|
|
28
|
-
if (
|
|
29
|
-
for (const
|
|
30
|
-
if (
|
|
31
|
-
|
|
20
|
+
const w = A || "var(--nice-color-primary, #3b82f6)", o = s / 2, n = i / 2, p = Math.min(o, n), l = Math.max(4, p * 0.12), e = Math.max(8, p - l / 2 - 4), B = Math.max(2.5, e * 0.05), E = Math.max(3, e * 0.08), f = Math.min(40, Math.max(10, e * 0.34)), u = Math.min(18, Math.max(8, e * 0.17)), k = Math.max(0, Math.min(1, (a - x) / (_ - x || 1))), $ = (t) => t * Math.PI / 180, G = (r - h + 360) % 360 || 360, d = (t) => ({
|
|
21
|
+
x: o + e * Math.cos($(t)),
|
|
22
|
+
y: n - e * Math.sin($(t))
|
|
23
|
+
}), b = (t, z) => {
|
|
24
|
+
const N = d(t), S = d(z), I = (t - z + 360) % 360 > 180 ? 1 : 0;
|
|
25
|
+
return `M${N.x},${N.y} A${e},${e} 0 ${I},1 ${S.x},${S.y}`;
|
|
26
|
+
}, v = r - k * G, W = d(v);
|
|
27
|
+
let g = w;
|
|
28
|
+
if (M) {
|
|
29
|
+
for (const t of M)
|
|
30
|
+
if (a >= t.start && a <= t.end) {
|
|
31
|
+
g = t.color;
|
|
32
32
|
break;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ c(
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
38
|
className: `nice-gauge nice-gauge--circular ${L || ""}`,
|
|
39
|
-
style:
|
|
40
|
-
"data-testid":
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
39
|
+
style: j,
|
|
40
|
+
"data-testid": R ?? P,
|
|
41
|
+
children: /* @__PURE__ */ q(
|
|
42
|
+
"svg",
|
|
43
|
+
{
|
|
44
|
+
width: s,
|
|
45
|
+
height: i,
|
|
46
|
+
viewBox: `0 0 ${s} ${i}`,
|
|
47
|
+
style: { maxWidth: "100%", height: "auto" },
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ c(
|
|
50
|
+
"path",
|
|
51
|
+
{
|
|
52
|
+
d: b(r, h),
|
|
53
|
+
fill: "none",
|
|
54
|
+
stroke: C || "var(--nice-border-color, #e2e8f0)",
|
|
55
|
+
strokeWidth: l,
|
|
56
|
+
strokeLinecap: "round"
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
k > 0 && /* @__PURE__ */ c(
|
|
60
|
+
"path",
|
|
61
|
+
{
|
|
62
|
+
d: b(r, v),
|
|
63
|
+
fill: "none",
|
|
64
|
+
stroke: g,
|
|
65
|
+
strokeWidth: l,
|
|
66
|
+
strokeLinecap: "round"
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ c(
|
|
70
|
+
"line",
|
|
71
|
+
{
|
|
72
|
+
x1: o,
|
|
73
|
+
y1: n,
|
|
74
|
+
x2: W.x,
|
|
75
|
+
y2: W.y,
|
|
76
|
+
stroke: "var(--nice-text-primary, #333)",
|
|
77
|
+
strokeWidth: B,
|
|
78
|
+
strokeLinecap: "round"
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ c("circle", { cx: o, cy: n, r: E, fill: "var(--nice-text-primary, #333)" }),
|
|
82
|
+
/* @__PURE__ */ c(
|
|
83
|
+
"text",
|
|
84
|
+
{
|
|
85
|
+
x: o,
|
|
86
|
+
y: n + e * 0.58,
|
|
87
|
+
textAnchor: "middle",
|
|
88
|
+
className: "nice-gauge__value",
|
|
89
|
+
style: { fontSize: f },
|
|
90
|
+
children: y ? y(a) : a
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
m && /* @__PURE__ */ c(
|
|
94
|
+
"text",
|
|
95
|
+
{
|
|
96
|
+
x: o,
|
|
97
|
+
y: n + e * 0.58 + f * 0.5 + u * 1.1,
|
|
98
|
+
textAnchor: "middle",
|
|
99
|
+
className: "nice-gauge__label",
|
|
100
|
+
style: { fontSize: u },
|
|
101
|
+
children: m
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
)
|
|
78
107
|
}
|
|
79
108
|
);
|
|
80
109
|
};
|
|
81
110
|
export {
|
|
82
|
-
|
|
111
|
+
J as NiceCircularGauge
|
|
83
112
|
};
|
|
@@ -1,147 +1,196 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
const
|
|
3
|
-
value:
|
|
4
|
-
min:
|
|
5
|
-
max:
|
|
6
|
-
width:
|
|
7
|
-
height:
|
|
8
|
-
orientation:
|
|
9
|
-
color:
|
|
10
|
-
label:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsx as t, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
const A = 16, I = 7, P = ({
|
|
3
|
+
value: x,
|
|
4
|
+
min: i = 0,
|
|
5
|
+
max: y = 100,
|
|
6
|
+
width: a = 300,
|
|
7
|
+
height: k = 60,
|
|
8
|
+
orientation: F = "horizontal",
|
|
9
|
+
color: J,
|
|
10
|
+
label: e,
|
|
11
|
+
labelPlacement: d = "bottom",
|
|
12
|
+
showValueLabel: f = !1,
|
|
13
|
+
formatValue: b,
|
|
14
|
+
ranges: H,
|
|
15
|
+
showTicks: _ = !0,
|
|
16
|
+
tickCount: K = 5,
|
|
17
|
+
className: L,
|
|
18
|
+
style: S,
|
|
19
|
+
testId: j,
|
|
20
|
+
"data-testid": C
|
|
19
21
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
if (
|
|
23
|
-
for (const
|
|
24
|
-
if (
|
|
25
|
-
|
|
22
|
+
const Q = F === "horizontal", p = Math.max(0, Math.min(1, (x - i) / (y - i || 1))), n = 10, $ = b ? b(x) : String(x);
|
|
23
|
+
let B = J || "var(--nice-color-primary, #3b82f6)";
|
|
24
|
+
if (H) {
|
|
25
|
+
for (const c of H)
|
|
26
|
+
if (x >= c.start && x <= c.end) {
|
|
27
|
+
B = c.color;
|
|
26
28
|
break;
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
(
|
|
32
|
-
|
|
33
|
-
if (u) {
|
|
34
|
-
const l = s ? 14 : 0;
|
|
35
|
-
return /* @__PURE__ */ r(
|
|
31
|
+
const R = Math.max(2, K), Y = Array.from({ length: R }, (c, s) => i + (y - i) * (s / (R - 1)));
|
|
32
|
+
if (Q) {
|
|
33
|
+
const c = e && d === "left", s = e && d === "top", O = e && d === "bottom", W = c ? Math.min(a * 0.35, e.length * I + 12) : 0, Z = (s ? A : 0) + (f ? 16 : 6), l = 20 + W, m = Math.max(20, a - 40 - W), o = Z + 8, X = o + n + 12, z = Math.max(k, X + (_ ? 4 : -8) + (O ? A + 4 : 4)), N = l + m * p;
|
|
34
|
+
return /* @__PURE__ */ t(
|
|
36
35
|
"div",
|
|
37
36
|
{
|
|
38
|
-
className: `nice-gauge nice-gauge--linear ${
|
|
39
|
-
style:
|
|
40
|
-
"data-testid":
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
37
|
+
className: `nice-gauge nice-gauge--linear ${L || ""}`,
|
|
38
|
+
style: S,
|
|
39
|
+
"data-testid": C ?? j,
|
|
40
|
+
children: /* @__PURE__ */ D(
|
|
41
|
+
"svg",
|
|
42
|
+
{
|
|
43
|
+
width: a,
|
|
44
|
+
height: z,
|
|
45
|
+
viewBox: `0 0 ${a} ${z}`,
|
|
46
|
+
style: { maxWidth: "100%" },
|
|
47
|
+
children: [
|
|
48
|
+
s && /* @__PURE__ */ t("text", { x: l, y: 12, className: "nice-gauge__label", children: e }),
|
|
49
|
+
c && /* @__PURE__ */ t(
|
|
50
|
+
"text",
|
|
51
|
+
{
|
|
52
|
+
x: W + 8,
|
|
53
|
+
y: o + n / 2,
|
|
54
|
+
textAnchor: "end",
|
|
55
|
+
dominantBaseline: "middle",
|
|
56
|
+
className: "nice-gauge__label",
|
|
57
|
+
children: e
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
f && /* @__PURE__ */ t(
|
|
61
|
+
"text",
|
|
62
|
+
{
|
|
63
|
+
x: N,
|
|
64
|
+
y: o - 10,
|
|
65
|
+
textAnchor: "middle",
|
|
66
|
+
className: "nice-gauge__value",
|
|
67
|
+
style: { fontSize: 12 },
|
|
68
|
+
children: $
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ t(
|
|
72
|
+
"rect",
|
|
73
|
+
{
|
|
74
|
+
x: l,
|
|
75
|
+
y: o,
|
|
76
|
+
width: m,
|
|
77
|
+
height: n,
|
|
78
|
+
rx: 5,
|
|
79
|
+
fill: "var(--nice-border-color, #e2e8f0)"
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ t(
|
|
83
|
+
"rect",
|
|
84
|
+
{
|
|
85
|
+
x: l,
|
|
86
|
+
y: o,
|
|
87
|
+
width: m * p,
|
|
88
|
+
height: n,
|
|
89
|
+
rx: 5,
|
|
90
|
+
fill: B
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ t(
|
|
94
|
+
"polygon",
|
|
95
|
+
{
|
|
96
|
+
points: `${N},${o - 2} ${N - 5},${o - 8} ${N + 5},${o - 8}`,
|
|
97
|
+
fill: "var(--nice-text-primary, #333)",
|
|
98
|
+
children: /* @__PURE__ */ t("title", { children: $ })
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
_ && Y.map((q, T) => /* @__PURE__ */ t(
|
|
102
|
+
"text",
|
|
103
|
+
{
|
|
104
|
+
x: l + (q - i) / (y - i || 1) * m,
|
|
105
|
+
y: X,
|
|
106
|
+
textAnchor: "middle",
|
|
107
|
+
className: "nice-gauge__tick",
|
|
108
|
+
children: Math.round(q * 100) / 100
|
|
109
|
+
},
|
|
110
|
+
T
|
|
111
|
+
)),
|
|
112
|
+
O && /* @__PURE__ */ t(
|
|
113
|
+
"text",
|
|
114
|
+
{
|
|
115
|
+
x: l + m / 2,
|
|
116
|
+
y: z - 4,
|
|
117
|
+
textAnchor: "middle",
|
|
118
|
+
className: "nice-gauge__label",
|
|
119
|
+
children: e
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
)
|
|
107
125
|
}
|
|
108
126
|
);
|
|
109
127
|
}
|
|
110
|
-
|
|
128
|
+
const u = Math.max(a, k), h = Math.max(72, Math.min(a, k, 140)), E = e && d !== "bottom", G = e && d === "bottom", g = (E ? A + 4 : 0) + (f ? 18 : 8), U = G ? A + 8 : 8, v = Math.max(20, u - g - U), r = h / 2 - n / 2 - (_ ? 10 : 0), M = g + v * (1 - p);
|
|
129
|
+
return /* @__PURE__ */ t(
|
|
111
130
|
"div",
|
|
112
131
|
{
|
|
113
|
-
className: `nice-gauge nice-gauge--linear nice-gauge--vertical ${
|
|
114
|
-
style:
|
|
115
|
-
"data-testid":
|
|
116
|
-
children: /* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
132
|
+
className: `nice-gauge nice-gauge--linear nice-gauge--vertical ${L || ""}`,
|
|
133
|
+
style: S,
|
|
134
|
+
"data-testid": C ?? j,
|
|
135
|
+
children: /* @__PURE__ */ D("svg", { width: h, height: u, viewBox: `0 0 ${h} ${u}`, style: { maxWidth: "100%" }, children: [
|
|
136
|
+
E && /* @__PURE__ */ t("text", { x: h / 2, y: 12, textAnchor: "middle", className: "nice-gauge__label", children: e }),
|
|
137
|
+
f && /* @__PURE__ */ t(
|
|
138
|
+
"text",
|
|
139
|
+
{
|
|
140
|
+
x: r + n / 2,
|
|
141
|
+
y: g - 6,
|
|
142
|
+
textAnchor: "middle",
|
|
143
|
+
className: "nice-gauge__value",
|
|
144
|
+
style: { fontSize: 12 },
|
|
145
|
+
children: $
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ t(
|
|
118
149
|
"rect",
|
|
119
150
|
{
|
|
120
|
-
x:
|
|
121
|
-
y:
|
|
122
|
-
width:
|
|
123
|
-
height:
|
|
151
|
+
x: r,
|
|
152
|
+
y: g,
|
|
153
|
+
width: n,
|
|
154
|
+
height: v,
|
|
124
155
|
rx: 5,
|
|
125
156
|
fill: "var(--nice-border-color, #e2e8f0)"
|
|
126
157
|
}
|
|
127
158
|
),
|
|
128
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ t(
|
|
129
160
|
"rect",
|
|
130
161
|
{
|
|
131
|
-
x:
|
|
132
|
-
y:
|
|
133
|
-
width:
|
|
134
|
-
height:
|
|
162
|
+
x: r,
|
|
163
|
+
y: M,
|
|
164
|
+
width: n,
|
|
165
|
+
height: v * p,
|
|
135
166
|
rx: 5,
|
|
136
|
-
fill:
|
|
167
|
+
fill: B
|
|
137
168
|
}
|
|
138
169
|
),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
|
|
170
|
+
/* @__PURE__ */ t(
|
|
171
|
+
"polygon",
|
|
172
|
+
{
|
|
173
|
+
points: `${r - 2},${M} ${r - 8},${M - 5} ${r - 8},${M + 5}`,
|
|
174
|
+
fill: "var(--nice-text-primary, #333)",
|
|
175
|
+
children: /* @__PURE__ */ t("title", { children: $ })
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
_ && Y.map((c, s) => /* @__PURE__ */ t(
|
|
179
|
+
"text",
|
|
180
|
+
{
|
|
181
|
+
x: r + n + 6,
|
|
182
|
+
y: g + v * (1 - (c - i) / (y - i || 1)),
|
|
183
|
+
dominantBaseline: "middle",
|
|
184
|
+
className: "nice-gauge__tick",
|
|
185
|
+
children: Math.round(c * 100) / 100
|
|
186
|
+
},
|
|
187
|
+
s
|
|
188
|
+
)),
|
|
189
|
+
G && /* @__PURE__ */ t("text", { x: h / 2, y: u - 6, textAnchor: "middle", className: "nice-gauge__label", children: e })
|
|
141
190
|
] })
|
|
142
191
|
}
|
|
143
192
|
);
|
|
144
193
|
};
|
|
145
194
|
export {
|
|
146
|
-
|
|
195
|
+
P as NiceLinearGauge
|
|
147
196
|
};
|