@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,77 +1,112 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { CHART_COLORS as
|
|
3
|
-
const
|
|
4
|
-
items:
|
|
5
|
-
min:
|
|
6
|
-
max:
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
9
|
-
startAngle:
|
|
10
|
-
endAngle:
|
|
11
|
-
formatValue:
|
|
12
|
-
title:
|
|
13
|
-
className:
|
|
1
|
+
import { jsx as e, jsxs as R, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import { CHART_COLORS as r } from "./colors.mjs";
|
|
3
|
+
const J = [], H = 20, K = 10, Q = 32, V = ({
|
|
4
|
+
items: s = J,
|
|
5
|
+
min: f = 0,
|
|
6
|
+
max: j = 100,
|
|
7
|
+
width: x = 300,
|
|
8
|
+
height: p = 300,
|
|
9
|
+
startAngle: l = 225,
|
|
10
|
+
endAngle: g = -45,
|
|
11
|
+
formatValue: k,
|
|
12
|
+
title: _,
|
|
13
|
+
className: z,
|
|
14
14
|
style: C,
|
|
15
|
-
testId:
|
|
16
|
-
"data-testid":
|
|
15
|
+
testId: O,
|
|
16
|
+
"data-testid": P
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const h = (t) => t * Math.PI / 180, B = (l - g + 360) % 360 || 360, M = [h(l), h(g)], u = (t) => (l - t + 720) % 360 <= B, b = u(90) ? 1 : Math.max(0, ...M.map((t) => Math.sin(t))), A = u(270) ? 1 : Math.max(0, ...M.map((t) => -Math.sin(t))), v = u(180) ? 1 : Math.max(0, ...M.map((t) => -Math.cos(t))), I = u(0) ? 1 : Math.max(0, ...M.map((t) => Math.cos(t))), T = _ ? Q : 0, m = K + H / 2, W = x - 2 * m, L = p - T - 2 * m, c = Math.max(0, Math.min(W / (v + I || 1), L / (b + A || 1))), i = m + v * c + (W - (v + I) * c) / 2, $ = T + m + b * c + (L - (b + A) * c) / 2, d = Math.min(H, c / (s.length + 1)), S = 4, F = Math.max(
|
|
19
|
+
0,
|
|
20
|
+
c - (s.length - 1) * (d + S) - d / 2 - 2
|
|
21
|
+
), E = Math.min(20, Math.max(9, F * 1.5 / Math.max(1, s.length))), X = E / 1.3, G = (t, n, a) => {
|
|
22
|
+
const o = i + t * Math.cos(h(n)), y = $ - t * Math.sin(h(n)), N = i + t * Math.cos(h(a)), Y = $ - t * Math.sin(h(a)), q = (n - a + 360) % 360;
|
|
23
|
+
return `M${o},${y} A${t},${t} 0 ${q > 180 ? 1 : 0},1 ${N},${Y}`;
|
|
21
24
|
};
|
|
22
25
|
return /* @__PURE__ */ e(
|
|
23
26
|
"div",
|
|
24
27
|
{
|
|
25
|
-
className: `nice-bargauge ${
|
|
28
|
+
className: `nice-bargauge ${z || ""}`,
|
|
26
29
|
style: C,
|
|
27
|
-
"data-testid":
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
30
|
+
"data-testid": P ?? O,
|
|
31
|
+
children: /* @__PURE__ */ R(
|
|
32
|
+
"svg",
|
|
33
|
+
{
|
|
34
|
+
width: x,
|
|
35
|
+
height: p,
|
|
36
|
+
viewBox: `0 0 ${x} ${p}`,
|
|
37
|
+
style: { maxWidth: "100%", height: "auto" },
|
|
38
|
+
children: [
|
|
39
|
+
_ && /* @__PURE__ */ e("text", { x: x / 2, y: 20, textAnchor: "middle", className: "nice-chart__title", children: _ }),
|
|
40
|
+
s.map((t, n) => {
|
|
41
|
+
const a = c - n * (d + S), o = Math.max(0, Math.min(1, (t.value - f) / (j - f || 1))), y = l - o * B, N = t.color || r[n % r.length];
|
|
42
|
+
return /* @__PURE__ */ R("g", { children: [
|
|
43
|
+
/* @__PURE__ */ e(
|
|
44
|
+
"path",
|
|
45
|
+
{
|
|
46
|
+
d: G(a, l, g),
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: "var(--nice-border-color, #e2e8f0)",
|
|
49
|
+
strokeWidth: d,
|
|
50
|
+
strokeLinecap: "round"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
o > 0 && /* @__PURE__ */ e(
|
|
54
|
+
"path",
|
|
55
|
+
{
|
|
56
|
+
d: G(a, l, y),
|
|
57
|
+
fill: "none",
|
|
58
|
+
stroke: N,
|
|
59
|
+
strokeWidth: d,
|
|
60
|
+
strokeLinecap: "round"
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }, n);
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ e("g", { children: s.map((t, n) => {
|
|
66
|
+
const a = $ - ((s.length - 1) / 2 - n) * E, o = k ? k(t.value) : t.value;
|
|
67
|
+
return /* @__PURE__ */ e("g", { style: { fontSize: X }, children: t.label ? /* @__PURE__ */ R(w, { children: [
|
|
68
|
+
/* @__PURE__ */ e(
|
|
69
|
+
"text",
|
|
70
|
+
{
|
|
71
|
+
x: i - 3,
|
|
72
|
+
y: a,
|
|
73
|
+
textAnchor: "end",
|
|
74
|
+
dominantBaseline: "middle",
|
|
75
|
+
className: "nice-bargauge__label",
|
|
76
|
+
children: t.label
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ e(
|
|
80
|
+
"text",
|
|
81
|
+
{
|
|
82
|
+
x: i + 3,
|
|
83
|
+
y: a,
|
|
84
|
+
textAnchor: "start",
|
|
85
|
+
dominantBaseline: "middle",
|
|
86
|
+
className: "nice-gauge__value nice-bargauge__value",
|
|
87
|
+
style: { fill: t.color || r[n % r.length] },
|
|
88
|
+
children: o
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] }) : /* @__PURE__ */ e(
|
|
92
|
+
"text",
|
|
93
|
+
{
|
|
94
|
+
x: i,
|
|
95
|
+
y: a,
|
|
96
|
+
textAnchor: "middle",
|
|
97
|
+
dominantBaseline: "middle",
|
|
98
|
+
className: "nice-gauge__value nice-bargauge__value",
|
|
99
|
+
style: { fill: t.color || r[n % r.length] },
|
|
100
|
+
children: o
|
|
101
|
+
}
|
|
102
|
+
) }, n);
|
|
103
|
+
}) })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
)
|
|
72
107
|
}
|
|
73
108
|
);
|
|
74
109
|
};
|
|
75
110
|
export {
|
|
76
|
-
|
|
111
|
+
V as NiceBarGauge
|
|
77
112
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as y, jsx as
|
|
1
|
+
import { jsxs as y, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useNiceTranslation as D } from "@nice2dev/ui-core";
|
|
3
3
|
const F = {
|
|
4
4
|
sm: { width: 160, height: 22, fontSize: 11 },
|
|
@@ -6,19 +6,19 @@ const F = {
|
|
|
6
6
|
lg: { width: 320, height: 44, fontSize: 14 }
|
|
7
7
|
}, T = ({
|
|
8
8
|
value: b,
|
|
9
|
-
target:
|
|
10
|
-
min:
|
|
9
|
+
target: c,
|
|
10
|
+
min: f = 0,
|
|
11
11
|
max: v = 100,
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
14
|
-
color:
|
|
12
|
+
width: $,
|
|
13
|
+
height: L,
|
|
14
|
+
color: j = "var(--nice-color-primary, #3b82f6)",
|
|
15
15
|
targetColor: S = "var(--nice-color-error, #ef4444)",
|
|
16
|
-
size:
|
|
17
|
-
label:
|
|
16
|
+
size: A = "md",
|
|
17
|
+
label: g,
|
|
18
18
|
labelPlacement: i = "top",
|
|
19
19
|
showValue: C = !1,
|
|
20
20
|
showTarget: x = !1,
|
|
21
|
-
formatValue: w = (
|
|
21
|
+
formatValue: w = (u) => String(u),
|
|
22
22
|
state: E = "normal",
|
|
23
23
|
errorMessage: I,
|
|
24
24
|
className: k,
|
|
@@ -26,111 +26,116 @@ const F = {
|
|
|
26
26
|
testId: _,
|
|
27
27
|
"data-testid": M
|
|
28
28
|
}) => {
|
|
29
|
-
const { t:
|
|
29
|
+
const { t: u } = D(), m = F[A], s = $ ?? m.width, N = L ?? m.height, o = m.fontSize, t = 4, r = s - t * 2, n = x && c != null ? o + 4 : t, l = x && c != null ? N + (n - t) : N, d = l - n - t, h = Math.max(0, Math.min(1, (b - f) / (v - f || 1))), a = c != null ? Math.max(0, Math.min(1, (c - f) / (v - f || 1))) : null, B = () => E === "error" ? /* @__PURE__ */ e(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
32
|
role: "alert",
|
|
33
33
|
style: {
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
34
|
+
width: s,
|
|
35
|
+
height: l,
|
|
36
36
|
display: "flex",
|
|
37
37
|
alignItems: "center",
|
|
38
38
|
justifyContent: "center",
|
|
39
39
|
border: "1px dashed var(--nice-color-error, #ef4444)",
|
|
40
40
|
borderRadius: 4,
|
|
41
41
|
color: "var(--nice-color-error, #ef4444)",
|
|
42
|
-
fontSize:
|
|
42
|
+
fontSize: o,
|
|
43
43
|
padding: "0 8px",
|
|
44
44
|
boxSizing: "border-box"
|
|
45
45
|
},
|
|
46
|
-
children: I ??
|
|
46
|
+
children: I ?? u("bullet.error", "Error")
|
|
47
47
|
}
|
|
48
|
-
) : E === "loading" ? /* @__PURE__ */
|
|
48
|
+
) : E === "loading" ? /* @__PURE__ */ e(
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
51
|
role: "status",
|
|
52
|
-
"aria-label":
|
|
52
|
+
"aria-label": u("bullet.loading", "Loading"),
|
|
53
53
|
className: "nice-bullet__skeleton",
|
|
54
54
|
style: {
|
|
55
|
-
width:
|
|
56
|
-
height:
|
|
55
|
+
width: s,
|
|
56
|
+
height: l,
|
|
57
57
|
borderRadius: 4,
|
|
58
58
|
background: "linear-gradient(90deg, var(--nice-bg-tertiary, #e5e7eb) 25%, var(--nice-bg-secondary, #f3f4f6) 50%, var(--nice-bg-tertiary, #e5e7eb) 75%)",
|
|
59
59
|
backgroundSize: "200% 100%",
|
|
60
60
|
animation: "nice-bullet-shimmer 1.4s linear infinite"
|
|
61
61
|
}
|
|
62
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
63
|
+
) : (
|
|
64
|
+
// 1.4.23 ("nieco bardziej responsywnym"): the drawing scales down with a narrow container
|
|
65
|
+
/* @__PURE__ */ y(
|
|
66
|
+
"svg",
|
|
67
|
+
{
|
|
68
|
+
width: s,
|
|
69
|
+
height: l,
|
|
70
|
+
viewBox: `0 0 ${s} ${l}`,
|
|
71
|
+
style: { maxWidth: "100%", height: "auto" },
|
|
72
|
+
role: "img",
|
|
73
|
+
"aria-label": typeof g == "string" ? g : void 0,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ e(
|
|
76
|
+
"rect",
|
|
77
|
+
{
|
|
78
|
+
x: t,
|
|
79
|
+
y: n,
|
|
80
|
+
width: r,
|
|
81
|
+
height: d,
|
|
82
|
+
rx: 3,
|
|
83
|
+
fill: "var(--nice-border-color, #e2e8f0)"
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ e(
|
|
87
|
+
"rect",
|
|
88
|
+
{
|
|
89
|
+
x: t,
|
|
90
|
+
y: n + d * 0.2,
|
|
91
|
+
width: r * h,
|
|
92
|
+
height: d * 0.6,
|
|
93
|
+
rx: 2,
|
|
94
|
+
fill: j
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
a != null && /* @__PURE__ */ e(
|
|
98
|
+
"line",
|
|
99
|
+
{
|
|
100
|
+
x1: t + r * a,
|
|
101
|
+
y1: n + 2,
|
|
102
|
+
x2: t + r * a,
|
|
103
|
+
y2: n + d - 2,
|
|
104
|
+
stroke: S,
|
|
105
|
+
strokeWidth: 2
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
C && /* @__PURE__ */ e(
|
|
109
|
+
"text",
|
|
110
|
+
{
|
|
111
|
+
x: t + Math.max(r * h, 4),
|
|
112
|
+
y: n + d / 2 + o * 0.08,
|
|
113
|
+
dx: r * h > 24 ? -4 : 4,
|
|
114
|
+
textAnchor: r * h > 24 ? "end" : "start",
|
|
115
|
+
dominantBaseline: "middle",
|
|
116
|
+
fontSize: o,
|
|
117
|
+
fill: r * h > 24 ? "var(--nice-color-white, #ffffff)" : "var(--nice-text-primary)",
|
|
118
|
+
fontWeight: 600,
|
|
119
|
+
children: w(b)
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
x && a != null && /* @__PURE__ */ e(
|
|
123
|
+
"text",
|
|
124
|
+
{
|
|
125
|
+
x: t + r * a,
|
|
126
|
+
y: n - 2,
|
|
127
|
+
textAnchor: "middle",
|
|
128
|
+
fontSize: o - 1,
|
|
129
|
+
fill: S,
|
|
130
|
+
fontWeight: 600,
|
|
131
|
+
children: w(c)
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
)
|
|
132
137
|
);
|
|
133
|
-
if (i === "none" || !
|
|
138
|
+
if (i === "none" || !g)
|
|
134
139
|
return /* @__PURE__ */ y(
|
|
135
140
|
"div",
|
|
136
141
|
{
|
|
@@ -138,17 +143,17 @@ const F = {
|
|
|
138
143
|
style: z,
|
|
139
144
|
"data-testid": M ?? _,
|
|
140
145
|
children: [
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
146
|
+
B(),
|
|
147
|
+
/* @__PURE__ */ e("style", { children: W })
|
|
143
148
|
]
|
|
144
149
|
}
|
|
145
150
|
);
|
|
146
|
-
const p = i === "top" || i === "bottom",
|
|
151
|
+
const p = i === "top" || i === "bottom", R = /* @__PURE__ */ e(
|
|
147
152
|
"span",
|
|
148
153
|
{
|
|
149
154
|
className: "nice-bullet__label",
|
|
150
155
|
style: {
|
|
151
|
-
fontSize:
|
|
156
|
+
fontSize: o,
|
|
152
157
|
fontWeight: 600,
|
|
153
158
|
color: "var(--nice-text-primary)",
|
|
154
159
|
...p ? {
|
|
@@ -158,7 +163,7 @@ const F = {
|
|
|
158
163
|
...i === "left" ? { marginRight: 8 } : {},
|
|
159
164
|
...i === "right" ? { marginLeft: 8 } : {}
|
|
160
165
|
},
|
|
161
|
-
children:
|
|
166
|
+
children: g
|
|
162
167
|
}
|
|
163
168
|
);
|
|
164
169
|
return /* @__PURE__ */ y(
|
|
@@ -173,14 +178,14 @@ const F = {
|
|
|
173
178
|
},
|
|
174
179
|
"data-testid": M ?? _,
|
|
175
180
|
children: [
|
|
176
|
-
(i === "top" || i === "left") &&
|
|
177
|
-
|
|
178
|
-
(i === "bottom" || i === "right") &&
|
|
179
|
-
/* @__PURE__ */
|
|
181
|
+
(i === "top" || i === "left") && R,
|
|
182
|
+
B(),
|
|
183
|
+
(i === "bottom" || i === "right") && R,
|
|
184
|
+
/* @__PURE__ */ e("style", { children: W })
|
|
180
185
|
]
|
|
181
186
|
}
|
|
182
187
|
);
|
|
183
|
-
},
|
|
188
|
+
}, W = `
|
|
184
189
|
@keyframes nice-bullet-shimmer {
|
|
185
190
|
0% { background-position: 200% 0; }
|
|
186
191
|
100% { background-position: -200% 0; }
|