nectiasw 0.0.264 → 0.0.266
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.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Chart } from '.';
|
|
3
|
+
declare const meta: Meta<typeof Chart>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Closed: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const WithInnerText: Story;
|
|
10
|
+
export declare const WithFlex: Story;
|
|
11
|
+
export declare const CustomSize: Story;
|
|
12
|
+
export declare const MultipleStages: Story;
|
|
13
|
+
export declare const SingleStage: Story;
|
|
14
|
+
export declare const CustomTextStyle: Story;
|
|
15
|
+
export declare const WithoutAspect: Story;
|
|
16
|
+
export declare const CustomTooltipContent: Story;
|
package/dist/index.es.js
CHANGED
|
@@ -442,9 +442,10 @@ const PY = Y.memo(
|
|
|
442
442
|
fontStyle: u = "bold 18pt sans-serif",
|
|
443
443
|
className: d,
|
|
444
444
|
innerText: p,
|
|
445
|
-
disabled: m
|
|
445
|
+
disabled: m,
|
|
446
|
+
content: h = "Cursos"
|
|
446
447
|
}) => {
|
|
447
|
-
const
|
|
448
|
+
const x = Y.useRef(), b = Y.useMemo(() => a ? {
|
|
448
449
|
labels: [],
|
|
449
450
|
datasets: [
|
|
450
451
|
{
|
|
@@ -471,36 +472,36 @@ const PY = Y.memo(
|
|
|
471
472
|
}
|
|
472
473
|
]
|
|
473
474
|
} : {
|
|
474
|
-
labels: l.map((
|
|
475
|
+
labels: l.map((_) => Lf(_.level)),
|
|
475
476
|
datasets: [
|
|
476
477
|
{
|
|
477
478
|
label: "Etapa",
|
|
478
479
|
hoverOffset: 4,
|
|
479
|
-
backgroundColor: l.map((
|
|
480
|
-
hoverBackgroundColor: l.map((
|
|
481
|
-
data: l.map((
|
|
480
|
+
backgroundColor: l.map((_) => _.color),
|
|
481
|
+
hoverBackgroundColor: l.map((_) => _.color),
|
|
482
|
+
data: l.map((_) => Number.parseFloat(_.percent))
|
|
482
483
|
}
|
|
483
484
|
]
|
|
484
|
-
}, [a, m, l]),
|
|
485
|
+
}, [a, m, l]), g = Y.useMemo(
|
|
485
486
|
() => ({
|
|
486
487
|
id: "textCenterPlugin",
|
|
487
|
-
beforeDatasetDraw(
|
|
488
|
-
var
|
|
489
|
-
p && u && (
|
|
488
|
+
beforeDatasetDraw(_) {
|
|
489
|
+
var w, C, E, O;
|
|
490
|
+
p && u && (_.ctx.save(), _.ctx.fillStyle = Ge.primary, _.ctx.textAlign = "center", _.ctx.textBaseline = "middle", _.ctx.font = u, _.ctx.fillText(
|
|
490
491
|
p,
|
|
491
|
-
(
|
|
492
|
-
(
|
|
492
|
+
(C = (w = _ == null ? void 0 : _.getDatasetMeta(0)) == null ? void 0 : w.data[0]) == null ? void 0 : C.x,
|
|
493
|
+
(O = (E = _ == null ? void 0 : _.getDatasetMeta(0)) == null ? void 0 : E.data[0]) == null ? void 0 : O.y
|
|
493
494
|
));
|
|
494
495
|
}
|
|
495
496
|
}),
|
|
496
497
|
[p, u]
|
|
497
|
-
),
|
|
498
|
-
return /* @__PURE__ */ te("div", { className: xe(d
|
|
498
|
+
), v = p ? [g] : [];
|
|
499
|
+
return /* @__PURE__ */ te("div", { className: xe(d), children: [
|
|
499
500
|
/* @__PURE__ */ A("div", { className: xe(e && "flex justify-center items-center"), children: /* @__PURE__ */ A(
|
|
500
501
|
NA,
|
|
501
502
|
{
|
|
502
|
-
ref:
|
|
503
|
-
plugins:
|
|
503
|
+
ref: x.current,
|
|
504
|
+
plugins: v,
|
|
504
505
|
options: {
|
|
505
506
|
maintainAspectRatio: i,
|
|
506
507
|
plugins: {
|
|
@@ -509,15 +510,15 @@ const PY = Y.memo(
|
|
|
509
510
|
},
|
|
510
511
|
tooltip: {
|
|
511
512
|
callbacks: {
|
|
512
|
-
label: function(
|
|
513
|
-
var
|
|
514
|
-
return
|
|
513
|
+
label: function(_) {
|
|
514
|
+
var w;
|
|
515
|
+
return `${h}: ${((w = l[_.dataIndex]) == null ? void 0 : w.count) ?? 0}`;
|
|
515
516
|
}
|
|
516
517
|
}
|
|
517
518
|
}
|
|
518
519
|
}
|
|
519
520
|
},
|
|
520
|
-
data:
|
|
521
|
+
data: b,
|
|
521
522
|
width: n,
|
|
522
523
|
height: r
|
|
523
524
|
}
|
|
@@ -527,7 +528,7 @@ const PY = Y.memo(
|
|
|
527
528
|
"div",
|
|
528
529
|
{
|
|
529
530
|
className: xe(
|
|
530
|
-
c
|
|
531
|
+
c,
|
|
531
532
|
m && "opacity-50",
|
|
532
533
|
"flex justify-center items-center text-center"
|
|
533
534
|
),
|
|
@@ -20198,7 +20199,8 @@ const RW = Y.memo((e) => {
|
|
|
20198
20199
|
innerText: e.innerText,
|
|
20199
20200
|
className: t,
|
|
20200
20201
|
index: e.first ? 0 : 1,
|
|
20201
|
-
overflowWrap: e.overflowWrap
|
|
20202
|
+
overflowWrap: e.overflowWrap,
|
|
20203
|
+
color: e.color
|
|
20202
20204
|
}, r = (l) => e.tooltip ? /* @__PURE__ */ A(AW, { content: e.tooltip, children: l }) : l, i = Y.useMemo(() => e.first && e.hasCheckbox && /* @__PURE__ */ A(
|
|
20203
20205
|
bv,
|
|
20204
20206
|
{
|