react-pivottable-plus 1.0.18 → 1.1.1

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.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![NPM Version](https://img.shields.io/npm/v/react-pivottable-plus.svg)](https://www.npmjs.com/package/react-pivottable-plus)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![React 19](https://img.shields.io/badge/React-19-blue.svg)](https://react.dev/)
5
+ [![React 18+](https://img.shields.io/badge/React-%3E%3D18-blue.svg)](https://react.dev/)
6
6
 
7
7
  **La solución definitiva de Tablas Dinámicas para el ecosistema moderno de React.**
8
8
 
@@ -18,26 +18,25 @@
18
18
 
19
19
  A diferencia de otros forks estancados, `react-pivottable-plus` ofrece:
20
20
 
21
- - **Soporte React 19**: Construido sobre los estándares más recientes.
21
+ - **Soporte React 18+**: Compatible con React 18 y React 19.
22
22
  - **UI de Próxima Generación**: Renderizadores modernos integrados.
23
23
  - **Paginación Inteligente**: Rendimiento fluido con grandes conjuntos de datos.
24
+ - **SSR Ready**: Compatible con Next.js App Router y Pages Router.
24
25
  - **Configuración Cero**: Implementación en segundos con valores por defecto robustos.
25
26
 
26
27
  ## 📦 Instalación
27
28
 
28
29
  ```bash
29
- npm install --save react-pivottable-plus react react-dom
30
+ npm install react-pivottable-plus
30
31
  ```
31
32
 
32
- ## 🛠️ Uso Básico (Zero Config)
33
+ > **Nota:** `react` y `react-dom` versión `>=18.0.0` son peerDependencies. Deben estar ya instaladas en tu proyecto.
33
34
 
34
- Gracias a las últimas optimizaciones, implementar la tabla dinámica es más sencillo que nunca. La mayoría de las propiedades ya tienen valores por defecto inteligentes.
35
+ ## 🛠️ Uso Básico (React / Vite / CRA)
35
36
 
36
37
  ```jsx
37
- "use client";
38
-
39
38
  import React, { useState } from 'react';
40
- import PivotTableUI from 'react-pivottable-plus'; // Importación directa
39
+ import PivotTableUI from 'react-pivottable-plus';
41
40
  import 'react-pivottable-plus/pivottable.css';
42
41
 
43
42
  const data = [
@@ -46,9 +45,8 @@ const data = [
46
45
  ];
47
46
 
48
47
  function App() {
49
- // Solo necesitas gestionar el estado si quieres persistir la configuración
50
48
  const [state, setState] = useState({});
51
-
49
+
52
50
  return (
53
51
  <PivotTableUI
54
52
  data={data}
@@ -59,22 +57,116 @@ function App() {
59
57
  }
60
58
  ```
61
59
 
62
- ## 🌈 Uso de Renderizadores Modernos
60
+ ## Uso con Next.js
61
+
62
+ Esta librería es compatible con Next.js tanto con **App Router** (React Server Components) como con **Pages Router**. Debido a que utiliza hooks de React y acceso al DOM, el componente **debe ejecutarse en el cliente**.
63
+
64
+ ### App Router (recomendado — Next.js 13+)
65
+
66
+ Crea un componente cliente dedicado para encapsular el pivot table:
67
+
68
+ ```jsx
69
+ // components/PivotWrapper.jsx
70
+ "use client";
71
+
72
+ import React, { useState } from 'react';
73
+ import PivotTableUI from 'react-pivottable-plus';
74
+ import 'react-pivottable-plus/pivottable.css';
75
+
76
+ export default function PivotWrapper({ data }) {
77
+ const [state, setState] = useState({});
63
78
 
64
- La librería incluye renderizadores premium listos para usar. No necesitas configurarlos manualmente, solo indica el nombre si ya los has incluido en el objeto `renderers`, o pásalos directamente:
79
+ return (
80
+ <PivotTableUI
81
+ data={data}
82
+ onChange={s => setState(s)}
83
+ {...state}
84
+ />
85
+ );
86
+ }
87
+ ```
88
+
89
+ Luego úsalo en cualquier Server Component o página:
65
90
 
66
91
  ```jsx
92
+ // app/page.jsx (Server Component — sin "use client")
93
+ import PivotWrapper from '@/components/PivotWrapper';
94
+
95
+ const data = [
96
+ { producto: "Laptop", ventas: 1500 },
97
+ { producto: "Monitor", ventas: 300 },
98
+ ];
99
+
100
+ export default function Page() {
101
+ return <PivotWrapper data={data} />;
102
+ }
103
+ ```
104
+
105
+ ### Pages Router (Next.js 12 y anteriores)
106
+
107
+ ```jsx
108
+ // pages/dashboard.jsx
109
+ import dynamic from 'next/dynamic';
110
+ import 'react-pivottable-plus/pivottable.css';
111
+
112
+ // Importación dinámica para evitar errores de SSR
113
+ const PivotTableUI = dynamic(
114
+ () => import('react-pivottable-plus'),
115
+ { ssr: false }
116
+ );
117
+
118
+ export default function Dashboard() {
119
+ const [state, setState] = React.useState({});
120
+ const data = [
121
+ { producto: "Laptop", ventas: 1500 },
122
+ ];
123
+
124
+ return (
125
+ <PivotTableUI
126
+ data={data}
127
+ onChange={s => setState(s)}
128
+ {...state}
129
+ />
130
+ );
131
+ }
132
+ ```
133
+
134
+ ### Solución a errores comunes en Next.js
135
+
136
+ | Error | Causa | Solución |
137
+ | :--- | :--- | :--- |
138
+ | `ReferenceError: window is not defined` | El componente se renderizó en el servidor | Usar `"use client"` o importación dinámica con `ssr: false` |
139
+ | `Module not found: Can't resolve '...'` | Módulo ESM no transpilado | Agregar a `transpilePackages` en `next.config.js` |
140
+ | `Hydration failed` | Estado diferente entre servidor y cliente | Usar `"use client"` en el componente que contiene el pivot |
141
+
142
+ Si ves errores de módulos no encontrados, agrega esto a tu `next.config.js`:
143
+
144
+ ```js
145
+ // next.config.js
146
+ const nextConfig = {
147
+ transpilePackages: ['react-pivottable-plus'],
148
+ };
149
+
150
+ module.exports = nextConfig;
151
+ ```
152
+
153
+ ## 🌈 Uso de Renderizadores Modernos
154
+
155
+ ```jsx
156
+ "use client"; // Requerido en Next.js App Router
157
+
158
+ import PivotTableUI from 'react-pivottable-plus';
67
159
  import { TailwindUI } from 'react-pivottable-plus/renderers/TailwindUI';
160
+ import 'react-pivottable-plus/pivottable.css';
68
161
 
69
- // En tu componente:
70
162
  <PivotTableUI
71
163
  data={data}
72
- renderers={{ Table: TailwindUI }} // Sobrescribe el renderizador por defecto
164
+ renderers={{ Table: TailwindUI }}
73
165
  {...state}
74
166
  />
75
167
  ```
76
168
 
77
- ## 📑 Propiedades Principales (Todas Opcionales)
169
+ ## 📑 Propiedades Principales (Todas Opcionales excepto `data`)
78
170
 
79
171
  | Propiedad | Tipo | Por Defecto | Descripción |
80
172
  | :--- | :--- | :--- | :--- |
@@ -86,10 +178,12 @@ import { TailwindUI } from 'react-pivottable-plus/renderers/TailwindUI';
86
178
  | `rendererName` | String | `"Table"` | Nombre del renderizador inicial. |
87
179
  | `pagination` | Boolean | `false` | Activa el pie de página con paginación. |
88
180
  | `pageSize` | Number | `20` | Cantidad de registros por página. |
181
+ | `columnResizing` | Boolean | `false` | Permite redimensionar columnas arrastrando. |
182
+ | `size` | String | `"lg"` | Tamaño de la UI: `"sm"`, `"md"` o `"lg"`. |
89
183
 
90
184
  ---
91
185
 
92
186
  Este proyecto es un fork mantenido de `react-pivottable` con el objetivo de proporcionar una experiencia de usuario superior y compatibilidad con las últimas versiones de React.
93
187
 
94
188
  ## ✍️ Créditos y Autoría
95
- Esta versión moderna y extendida (`react-pivottable-plus`) ha sido desarrollada y mantenida por **Jasp402**, quien ha liderado la implementación de las nuevas interfaces (Tailwind, Shadcn, Radix), la actualización a React 19 y la optimización del motor de arrastre y filtrado.
189
+ Esta versión moderna y extendida (`react-pivottable-plus`) ha sido desarrollada y mantenida por **Jasp402**, quien ha liderado la implementación de las nuevas interfaces (Tailwind, Shadcn, Radix), la actualización a React 18/19 y la optimización del motor de arrastre y filtrado.
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -10,34 +9,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
10
9
  var _Utilities = require("./Utilities");
11
10
  var _TableRenderers = _interopRequireDefault(require("./TableRenderers"));
12
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
19
- function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
20
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
21
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
22
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
23
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
24
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
25
12
  /* eslint-disable react/prop-types */
26
- // eslint can't see inherited propTypes!
27
- var PivotTable = /*#__PURE__*/function (_React$PureComponent) {
28
- function PivotTable() {
29
- _classCallCheck(this, PivotTable);
30
- return _callSuper(this, PivotTable, arguments);
31
- }
32
- _inherits(PivotTable, _React$PureComponent);
33
- return _createClass(PivotTable, [{
34
- key: "render",
35
- value: function render() {
36
- var Renderer = this.props.renderers[this.props.rendererName in this.props.renderers ? this.props.rendererName : Object.keys(this.props.renderers)[0]];
37
- return /*#__PURE__*/_react["default"].createElement(Renderer, this.props);
38
- }
39
- }]);
40
- }(_react["default"].PureComponent);
13
+
14
+ var PivotTable = /*#__PURE__*/_react["default"].memo(function PivotTable(props) {
15
+ var Renderer = props.renderers[props.rendererName in props.renderers ? props.rendererName : Object.keys(props.renderers)[0]];
16
+ return /*#__PURE__*/_react["default"].createElement(Renderer, props);
17
+ });
18
+ PivotTable.displayName = 'PivotTable';
41
19
  PivotTable.propTypes = Object.assign({}, _Utilities.PivotData.propTypes, {
42
20
  rendererName: _propTypes["default"].string,
43
21
  renderers: _propTypes["default"].objectOf(_propTypes["default"].func)
@@ -1 +1 @@
1
- {"version":3,"file":"PivotTable.js","names":["_react","_interopRequireDefault","require","_propTypes","_Utilities","_TableRenderers","e","__esModule","_classCallCheck","a","n","TypeError","_defineProperties","r","t","length","o","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_createClass","prototype","i","_toPrimitive","_typeof","Symbol","toPrimitive","call","String","Number","_callSuper","_getPrototypeOf","_possibleConstructorReturn","_isNativeReflectConstruct","Reflect","construct","constructor","apply","_assertThisInitialized","ReferenceError","Boolean","valueOf","setPrototypeOf","getPrototypeOf","bind","__proto__","_inherits","create","value","_setPrototypeOf","PivotTable","_React$PureComponent","arguments","render","Renderer","props","renderers","rendererName","keys","createElement","React","PureComponent","propTypes","assign","PivotData","PropTypes","string","objectOf","func","defaultProps","TableRenderers","_default","exports"],"sources":["../src/PivotTable.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {PivotData} from './Utilities';\nimport TableRenderers from './TableRenderers';\n\n/* eslint-disable react/prop-types */\n// eslint can't see inherited propTypes!\n\nclass PivotTable extends React.PureComponent {\n render() {\n const Renderer = this.props.renderers[\n this.props.rendererName in this.props.renderers\n ? this.props.rendererName\n : Object.keys(this.props.renderers)[0]\n ];\n return <Renderer {...this.props} />;\n }\n}\n\nPivotTable.propTypes = Object.assign({}, PivotData.propTypes, {\n rendererName: PropTypes.string,\n renderers: PropTypes.objectOf(PropTypes.func),\n});\n\nPivotTable.defaultProps = Object.assign({}, PivotData.defaultProps, {\n rendererName: 'Table',\n renderers: TableRenderers,\n});\n\nexport default PivotTable;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,UAAAD,CAAA,YAAAC,CAAA,aAAAC,SAAA;AAAA,SAAAC,kBAAAN,CAAA,EAAAO,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAD,CAAA,CAAAE,MAAA,EAAAD,CAAA,UAAAE,CAAA,GAAAH,CAAA,CAAAC,CAAA,GAAAE,CAAA,CAAAC,UAAA,GAAAD,CAAA,CAAAC,UAAA,QAAAD,CAAA,CAAAE,YAAA,kBAAAF,CAAA,KAAAA,CAAA,CAAAG,QAAA,QAAAC,MAAA,CAAAC,cAAA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AAA,OAAAoB,UAAA,EAAAE,SAAA;EAAA;EAAAN,SAAA,CAAAI,UAAA,EAAAC,oBAAA;EAAA,OAAA/B,YAAA,CAAA8B,UAAA;IAAA/B,GAAA;IAAA6B,KAAA,EACd,SAAAK,MAAMA,CAAA,EAAG;MACP,IAAMC,QAAQ,GAAG,IAAI,CAACC,KAAK,CAACC,SAAS,CACnC,IAAI,CAACD,KAAK,CAACE,YAAY,IAAI,IAAI,CAACF,KAAK,CAACC,SAAS,GAC3C,IAAI,CAACD,KAAK,CAACE,YAAY,GACvBzC,MAAM,CAAC0C,IAAI,CAAC,IAAI,CAACH,KAAK,CAACC,SAAS,CAAC,CAAC,CAAC,CAAC,CACzC;MACD,oBAAO5D,MAAA,YAAA+D,aAAA,CAACL,QAAQ,EAAK,IAAI,CAACC,KAAQ,CAAC;IACrC;EAAC;AAAA,EARsBK,iBAAK,CAACC,aAAa;AAW5CX,UAAU,CAACY,SAAS,GAAG9C,MAAM,CAAC+C,MAAM,CAAC,CAAC,CAAC,EAAEC,oBAAS,CAACF,SAAS,EAAE;EAC5DL,YAAY,EAAEQ,qBAAS,CAACC,MAAM;EAC9BV,SAAS,EAAES,qBAAS,CAACE,QAAQ,CAACF,qBAAS,CAACG,IAAI;AAC9C,CAAC,CAAC;AAEFlB,UAAU,CAACmB,YAAY,GAAGrD,MAAM,CAAC+C,MAAM,CAAC,CAAC,CAAC,EAAEC,oBAAS,CAACK,YAAY,EAAE;EAClEZ,YAAY,EAAE,OAAO;EACrBD,SAAS,EAAEc;AACb,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEYtB,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"PivotTable.js","names":["_react","_interopRequireDefault","require","_propTypes","_Utilities","_TableRenderers","e","__esModule","PivotTable","React","memo","props","Renderer","renderers","rendererName","Object","keys","createElement","displayName","propTypes","assign","PivotData","PropTypes","string","objectOf","func","defaultProps","TableRenderers","_default","exports"],"sources":["../src/PivotTable.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { PivotData } from './Utilities';\nimport TableRenderers from './TableRenderers';\n\n/* eslint-disable react/prop-types */\n\nconst PivotTable = React.memo(function PivotTable(props) {\n const Renderer = props.renderers[\n props.rendererName in props.renderers\n ? props.rendererName\n : Object.keys(props.renderers)[0]\n ];\n return <Renderer {...props} />;\n});\n\nPivotTable.displayName = 'PivotTable';\n\nPivotTable.propTypes = Object.assign({}, PivotData.propTypes, {\n rendererName: PropTypes.string,\n renderers: PropTypes.objectOf(PropTypes.func),\n});\n\nPivotTable.defaultProps = Object.assign({}, PivotData.defaultProps, {\n rendererName: 'Table',\n renderers: TableRenderers,\n});\n\nexport default PivotTable;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAE9C;;AAEA,IAAME,UAAU,gBAAGC,iBAAK,CAACC,IAAI,CAAC,SAASF,UAAUA,CAACG,KAAK,EAAE;EACvD,IAAMC,QAAQ,GAAGD,KAAK,CAACE,SAAS,CAC9BF,KAAK,CAACG,YAAY,IAAIH,KAAK,CAACE,SAAS,GACjCF,KAAK,CAACG,YAAY,GAClBC,MAAM,CAACC,IAAI,CAACL,KAAK,CAACE,SAAS,CAAC,CAAC,CAAC,CAAC,CACpC;EACD,oBAAOb,MAAA,YAAAiB,aAAA,CAACL,QAAQ,EAAKD,KAAQ,CAAC;AAChC,CAAC,CAAC;AAEFH,UAAU,CAACU,WAAW,GAAG,YAAY;AAErCV,UAAU,CAACW,SAAS,GAAGJ,MAAM,CAACK,MAAM,CAAC,CAAC,CAAC,EAAEC,oBAAS,CAACF,SAAS,EAAE;EAC5DL,YAAY,EAAEQ,qBAAS,CAACC,MAAM;EAC9BV,SAAS,EAAES,qBAAS,CAACE,QAAQ,CAACF,qBAAS,CAACG,IAAI;AAC9C,CAAC,CAAC;AAEFjB,UAAU,CAACkB,YAAY,GAAGX,MAAM,CAACK,MAAM,CAAC,CAAC,CAAC,EAAEC,oBAAS,CAACK,YAAY,EAAE;EAClEZ,YAAY,EAAE,OAAO;EACrBD,SAAS,EAAEc;AACb,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEYrB,UAAU","ignoreList":[]}