nectiasw 0.0.268 → 0.0.269

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.
@@ -19,10 +19,11 @@ export declare const ExecutionWithMultipleLevels: Story;
19
19
  export declare const DeliverOCWithMultipleLevels: Story;
20
20
  /**
21
21
  * Interactive chart with click handler.
22
- * Click on any segment to see the event data in the Actions panel.
22
+ * Click on any segment to see the query params in the Actions panel.
23
23
  */
24
24
  export declare const WithClickHandler: Story;
25
25
  /**
26
26
  * Multiple interactive charts simulating dashboard behavior.
27
+ * Shows how to use stageId to get query params for API calls.
27
28
  */
28
29
  export declare const DashboardSimulation: Story;
@@ -12,22 +12,18 @@ export interface Graph {
12
12
  }
13
13
  /**
14
14
  * @description
15
- * Query data emitted when clicking on a chart segment.
16
- * Contains all necessary information to filter courses.
15
+ * Query params emitted when clicking on a chart segment.
16
+ * Contains the parameters needed to filter courses via API.
17
17
  */
18
- export interface ChartClickData {
19
- /** The stage type (e.g., 'registered', 'execution', 'deliverOC', etc.) */
20
- stageType: string;
21
- /** The level clicked (e.g., 'normal', 'medio', 'critico') */
18
+ export interface ChartClickQuery {
19
+ /** Stage ID for API query (1=Inscrito, 2=Ejecución, 3=Por Emisión OC, 4=Por Liquidar, 5=Cerrado) */
20
+ stageId: number;
21
+ /** Stage label for display */
22
+ stageLabel: string;
23
+ /** Level/deadline name (e.g., 'normal', 'medio', 'critico') */
22
24
  level: string;
23
- /** The count of courses in this segment */
25
+ /** Count of courses in this segment */
24
26
  count: number;
25
- /** The percentage of this segment */
26
- percent: string;
27
- /** The label of the chart (e.g., 'Cursos Inscritos') */
28
- chartLabel: string;
29
- /** The index of the clicked segment */
30
- dataIndex: number;
31
27
  }
32
28
  export type ChartProps = {
33
29
  className?: string;
@@ -45,8 +41,8 @@ export type ChartProps = {
45
41
  fontStyle?: string;
46
42
  innerText?: string;
47
43
  content?: string;
48
- /** Stage type identifier for click events (e.g., 'registered', 'execution') */
49
- stageType?: string;
44
+ /** Stage ID for click events (e.g., 1, 2, 3, 4, 5) */
45
+ stageId?: number;
50
46
  /** Callback fired when a chart segment is clicked */
51
- onBarClick?: (data: ChartClickData) => void;
47
+ onBarClick?: (query: ChartClickQuery) => void;
52
48
  };
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export type { ColProps } from './components/Col/types';
7
7
  export { Row } from './components/Row';
8
8
  export type { RowProps } from './components/Row';
9
9
  export { Chart } from './components/Chart';
10
- export type { ChartProps, ChartClickData } from './components/Chart';
10
+ export type { ChartProps, ChartClickQuery } from './components/Chart';
11
11
  export { FirstModal } from './components/FirstModal';
12
12
  export type { FirstModalProps } from './components/FirstModal/types';
13
13
  export { TCModal } from './components/Modal/variant/TCModal';
package/dist/index.es.js CHANGED
@@ -453,8 +453,8 @@ const YA = (e) => {
453
453
  innerText: p,
454
454
  disabled: m,
455
455
  content: h = "Cursos",
456
- stageType: x,
457
- onBarClick: b
456
+ onBarClick: x,
457
+ stageId: b
458
458
  }) => {
459
459
  const g = V.useRef(), v = V.useMemo(() => a ? {
460
460
  labels: [],
@@ -508,20 +508,18 @@ const YA = (e) => {
508
508
  [p, u]
509
509
  ), C = p ? [_] : [], E = V.useCallback(
510
510
  (w, O) => {
511
- if (!b || m || a || O.length === 0) return;
511
+ if (!x || m || a || O.length === 0) return;
512
512
  const S = O[0].index, F = l[S];
513
513
  if (!F) return;
514
514
  const D = {
515
- stageType: x || "",
516
- level: F.level,
517
- count: F.count,
518
- percent: F.percent,
519
- chartLabel: t,
520
- dataIndex: S
515
+ stageId: b || 0,
516
+ stageLabel: t,
517
+ level: F.level.toLowerCase().trim(),
518
+ count: F.count
521
519
  };
522
- b(D);
520
+ x(D);
523
521
  },
524
- [b, m, a, l, x, t]
522
+ [x, m, a, l, b, t]
525
523
  );
526
524
  return /* @__PURE__ */ te("div", { className: xe(d), children: [
527
525
  /* @__PURE__ */ A("div", { className: xe(e && "flex justify-center items-center"), children: /* @__PURE__ */ A(