@vue-pivottable/nuxt 0.1.0

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 ADDED
@@ -0,0 +1,169 @@
1
+ # @vue-pivottable/nuxt
2
+
3
+ Nuxt module for vue-pivottable. Supports both Nuxt 2 and Nuxt 3 with SSR-safe component registration.
4
+
5
+ ## Version Compatibility
6
+
7
+ Nuxt is built on Vue, so each Nuxt version corresponds to a specific Vue version:
8
+
9
+ | Nuxt Version | Vue Version | vue-pivottable Version | Module Path |
10
+ |--------------|-------------|------------------------|-------------|
11
+ | Nuxt 2.x | Vue 2 | `^0.4.69` | `@vue-pivottable/nuxt/nuxt2` |
12
+ | Nuxt 3.x | Vue 3 | `^1.0.0` | `@vue-pivottable/nuxt` |
13
+
14
+ > **Note:** Nuxt 2 uses Vue 2 internally, and Nuxt 3 uses Vue 3. Make sure to install the correct version of `vue-pivottable` that matches your Nuxt/Vue version.
15
+
16
+ ## Screenshots
17
+
18
+ ### Nuxt 3 (Vue 3)
19
+
20
+ **VuePivottable** - Direct pivot table rendering
21
+ ![Nuxt 3 - VuePivottable](example/nuxt3-pretty-table.png)
22
+
23
+ **VuePivottableUi** - Interactive pivot table with drag-and-drop UI
24
+ ![Nuxt 3 - VuePivottableUi](example/nuxt3-pretty-ui.png)
25
+
26
+ ### Nuxt 2 (Vue 2)
27
+
28
+ **VuePivottable** - Direct pivot table rendering (with Totals)
29
+ ![Nuxt 2 - VuePivottable](example/nuxt2-pretty-table.png)
30
+
31
+ **VuePivottableUi** - Interactive pivot table with drag-and-drop UI
32
+ ![Nuxt 2 - VuePivottableUi](example/nuxt2-pretty-ui.png)
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ npm install @vue-pivottable/nuxt
38
+
39
+ # For Nuxt 3 (Vue 3)
40
+ npm install vue-pivottable@^1.0.0
41
+
42
+ # For Nuxt 2 (Vue 2)
43
+ npm install vue-pivottable@^0.4.69
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ ### Nuxt 3
49
+
50
+ ```ts
51
+ // nuxt.config.ts
52
+ export default defineNuxtConfig({
53
+ modules: ['@vue-pivottable/nuxt']
54
+ })
55
+ ```
56
+
57
+ Then use the components in your pages:
58
+
59
+ ```vue
60
+ <template>
61
+ <ClientOnly>
62
+ <VuePivottable
63
+ :data="data"
64
+ :rows="['region']"
65
+ :cols="['product']"
66
+ aggregator-name="Sum"
67
+ :vals="['sales']"
68
+ />
69
+ </ClientOnly>
70
+ </template>
71
+ ```
72
+
73
+ ### Nuxt 2
74
+
75
+ ```js
76
+ // nuxt.config.js
77
+ export default {
78
+ modules: [
79
+ '@vue-pivottable/nuxt/nuxt2'
80
+ ]
81
+ }
82
+ ```
83
+
84
+ Then use the components in your pages:
85
+
86
+ ```vue
87
+ <template>
88
+ <client-only>
89
+ <VuePivottable
90
+ :data="data"
91
+ :rows="['region']"
92
+ :cols="['product']"
93
+ aggregator-name="Sum"
94
+ :vals="['sales']"
95
+ />
96
+ </client-only>
97
+ </template>
98
+ ```
99
+
100
+ ## Options
101
+
102
+ ### Nuxt 3
103
+
104
+ ```ts
105
+ // nuxt.config.ts
106
+ export default defineNuxtConfig({
107
+ modules: ['@vue-pivottable/nuxt'],
108
+ pivottable: {
109
+ // Include CSS (default: true)
110
+ css: true,
111
+ // Register components globally (default: true)
112
+ global: true
113
+ }
114
+ })
115
+ ```
116
+
117
+ ### Nuxt 2
118
+
119
+ ```js
120
+ // nuxt.config.js
121
+ export default {
122
+ modules: [
123
+ ['@vue-pivottable/nuxt/nuxt2', {
124
+ // Include CSS (default: true)
125
+ css: true
126
+ }]
127
+ ]
128
+ }
129
+ ```
130
+
131
+ ## Components
132
+
133
+ The module auto-registers these components:
134
+
135
+ | Component | Description |
136
+ |-----------|-------------|
137
+ | `<VuePivottable>` | Basic pivot table without UI controls |
138
+ | `<VuePivottableUi>` | Pivot table with drag-and-drop UI |
139
+
140
+ ## SSR Support
141
+
142
+ This module automatically handles SSR by loading components only on the client side. No additional configuration is needed.
143
+
144
+ **Important:** Wrap your pivot table components with `<ClientOnly>` (Nuxt 3) or `<client-only>` (Nuxt 2) to prevent SSR hydration issues.
145
+
146
+ ## Examples
147
+
148
+ See the [example](./example) directory for complete working examples:
149
+
150
+ - `example/nuxt3` - Nuxt 3 example
151
+ - `example/nuxt2` - Nuxt 2 example
152
+
153
+ To run the examples:
154
+
155
+ ```bash
156
+ # Nuxt 3
157
+ cd example/nuxt3
158
+ npm install
159
+ npm run dev
160
+
161
+ # Nuxt 2
162
+ cd example/nuxt2
163
+ npm install
164
+ npm run dev
165
+ ```
166
+
167
+ ## License
168
+
169
+ MIT
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ const nuxt3 = require('./nuxt3.cjs');
4
+ require('@nuxt/kit');
5
+
6
+
7
+
8
+ module.exports = nuxt3;
@@ -0,0 +1 @@
1
+ export { ModuleOptions, default } from './nuxt3.cjs';
@@ -0,0 +1 @@
1
+ export { ModuleOptions, default } from './nuxt3.mjs';
@@ -0,0 +1 @@
1
+ export { ModuleOptions, default } from './nuxt3.js';
@@ -0,0 +1,2 @@
1
+ export { default } from './nuxt3.mjs';
2
+ import '@nuxt/kit';
package/dist/nuxt2.cjs ADDED
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const path = require('path');
6
+
7
+ function VuePivottableModule(moduleOptions) {
8
+ const options = {
9
+ ...this.options.pivottable,
10
+ ...moduleOptions
11
+ };
12
+ this.addPlugin({
13
+ src: path.resolve(__dirname, "plugin.cjs"),
14
+ fileName: "vue-pivottable.client.js",
15
+ mode: "client",
16
+ options
17
+ });
18
+ if (options.css !== false) {
19
+ this.options.css = this.options.css || [];
20
+ this.options.css.push("vue-pivottable/dist/vue-pivottable.css");
21
+ }
22
+ }
23
+ const meta = {
24
+ name: "@vue-pivottable/nuxt",
25
+ version: "0.1.0"
26
+ };
27
+
28
+ exports.default = VuePivottableModule;
29
+ exports.meta = meta;
@@ -0,0 +1,24 @@
1
+ import { resolve } from 'path';
2
+
3
+ function VuePivottableModule(moduleOptions) {
4
+ const options = {
5
+ ...this.options.pivottable,
6
+ ...moduleOptions
7
+ };
8
+ this.addPlugin({
9
+ src: resolve(__dirname, "plugin.cjs"),
10
+ fileName: "vue-pivottable.client.js",
11
+ mode: "client",
12
+ options
13
+ });
14
+ if (options.css !== false) {
15
+ this.options.css = this.options.css || [];
16
+ this.options.css.push("vue-pivottable/dist/vue-pivottable.css");
17
+ }
18
+ }
19
+ const meta = {
20
+ name: "@vue-pivottable/nuxt",
21
+ version: "0.1.0"
22
+ };
23
+
24
+ export { VuePivottableModule as default, meta };
@@ -0,0 +1,24 @@
1
+ import { resolve } from 'path';
2
+
3
+ function VuePivottableModule(moduleOptions) {
4
+ const options = {
5
+ ...this.options.pivottable,
6
+ ...moduleOptions
7
+ };
8
+ this.addPlugin({
9
+ src: resolve(__dirname, "plugin.cjs"),
10
+ fileName: "vue-pivottable.client.js",
11
+ mode: "client",
12
+ options
13
+ });
14
+ if (options.css !== false) {
15
+ this.options.css = this.options.css || [];
16
+ this.options.css.push("vue-pivottable/dist/vue-pivottable.css");
17
+ }
18
+ }
19
+ const meta = {
20
+ name: "@vue-pivottable/nuxt",
21
+ version: "0.1.0"
22
+ };
23
+
24
+ export { VuePivottableModule as default, meta };
@@ -0,0 +1,24 @@
1
+ import { resolve } from 'path';
2
+
3
+ function VuePivottableModule(moduleOptions) {
4
+ const options = {
5
+ ...this.options.pivottable,
6
+ ...moduleOptions
7
+ };
8
+ this.addPlugin({
9
+ src: resolve(__dirname, "plugin.cjs"),
10
+ fileName: "vue-pivottable.client.js",
11
+ mode: "client",
12
+ options
13
+ });
14
+ if (options.css !== false) {
15
+ this.options.css = this.options.css || [];
16
+ this.options.css.push("vue-pivottable/dist/vue-pivottable.css");
17
+ }
18
+ }
19
+ const meta = {
20
+ name: "@vue-pivottable/nuxt",
21
+ version: "0.1.0"
22
+ };
23
+
24
+ export { VuePivottableModule as default, meta };
package/dist/nuxt2.mjs ADDED
@@ -0,0 +1,24 @@
1
+ import { resolve } from 'path';
2
+
3
+ function VuePivottableModule(moduleOptions) {
4
+ const options = {
5
+ ...this.options.pivottable,
6
+ ...moduleOptions
7
+ };
8
+ this.addPlugin({
9
+ src: resolve(__dirname, "plugin.cjs"),
10
+ fileName: "vue-pivottable.client.js",
11
+ mode: "client",
12
+ options
13
+ });
14
+ if (options.css !== false) {
15
+ this.options.css = this.options.css || [];
16
+ this.options.css.push("vue-pivottable/dist/vue-pivottable.css");
17
+ }
18
+ }
19
+ const meta = {
20
+ name: "@vue-pivottable/nuxt",
21
+ version: "0.1.0"
22
+ };
23
+
24
+ export { VuePivottableModule as default, meta };
package/dist/nuxt3.cjs ADDED
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ const kit = require('@nuxt/kit');
4
+
5
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
6
+ const module$1 = kit.defineNuxtModule({
7
+ meta: {
8
+ name: "@vue-pivottable/nuxt",
9
+ configKey: "pivottable",
10
+ compatibility: {
11
+ nuxt: "^3.0.0"
12
+ }
13
+ },
14
+ defaults: {
15
+ css: true,
16
+ global: true
17
+ },
18
+ setup(options, nuxt) {
19
+ const resolver = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('nuxt3.cjs', document.baseURI).href)));
20
+ if (options.css) {
21
+ nuxt.options.css.push("vue-pivottable/dist/vue-pivottable.css");
22
+ }
23
+ kit.addPlugin({
24
+ src: resolver.resolve("./runtime/plugin"),
25
+ mode: "client"
26
+ });
27
+ if (options.global) {
28
+ kit.addComponent({
29
+ name: "VuePivottable",
30
+ export: "VuePivottable",
31
+ filePath: "vue-pivottable",
32
+ mode: "client"
33
+ });
34
+ kit.addComponent({
35
+ name: "VuePivottableUi",
36
+ export: "VuePivottableUi",
37
+ filePath: "vue-pivottable",
38
+ mode: "client"
39
+ });
40
+ }
41
+ }
42
+ });
43
+
44
+ module.exports = module$1;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Nuxt 3 Module for vue-pivottable (vue3-pivottable)
3
+ *
4
+ * @example
5
+ * // nuxt.config.ts
6
+ * export default defineNuxtConfig({
7
+ * modules: [
8
+ * '@vue-pivottable/nuxt'
9
+ * ]
10
+ * })
11
+ */
12
+ interface ModuleOptions {
13
+ /**
14
+ * Include CSS automatically
15
+ * @default true
16
+ */
17
+ css?: boolean;
18
+ /**
19
+ * Register components globally
20
+ * @default true
21
+ */
22
+ global?: boolean;
23
+ }
24
+ declare const _default: any;
25
+
26
+ export { _default as default };
27
+ export type { ModuleOptions };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Nuxt 3 Module for vue-pivottable (vue3-pivottable)
3
+ *
4
+ * @example
5
+ * // nuxt.config.ts
6
+ * export default defineNuxtConfig({
7
+ * modules: [
8
+ * '@vue-pivottable/nuxt'
9
+ * ]
10
+ * })
11
+ */
12
+ interface ModuleOptions {
13
+ /**
14
+ * Include CSS automatically
15
+ * @default true
16
+ */
17
+ css?: boolean;
18
+ /**
19
+ * Register components globally
20
+ * @default true
21
+ */
22
+ global?: boolean;
23
+ }
24
+ declare const _default: any;
25
+
26
+ export { _default as default };
27
+ export type { ModuleOptions };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Nuxt 3 Module for vue-pivottable (vue3-pivottable)
3
+ *
4
+ * @example
5
+ * // nuxt.config.ts
6
+ * export default defineNuxtConfig({
7
+ * modules: [
8
+ * '@vue-pivottable/nuxt'
9
+ * ]
10
+ * })
11
+ */
12
+ interface ModuleOptions {
13
+ /**
14
+ * Include CSS automatically
15
+ * @default true
16
+ */
17
+ css?: boolean;
18
+ /**
19
+ * Register components globally
20
+ * @default true
21
+ */
22
+ global?: boolean;
23
+ }
24
+ declare const _default: any;
25
+
26
+ export { _default as default };
27
+ export type { ModuleOptions };
package/dist/nuxt3.mjs ADDED
@@ -0,0 +1,41 @@
1
+ import { defineNuxtModule, createResolver, addPlugin, addComponent } from '@nuxt/kit';
2
+
3
+ const module = defineNuxtModule({
4
+ meta: {
5
+ name: "@vue-pivottable/nuxt",
6
+ configKey: "pivottable",
7
+ compatibility: {
8
+ nuxt: "^3.0.0"
9
+ }
10
+ },
11
+ defaults: {
12
+ css: true,
13
+ global: true
14
+ },
15
+ setup(options, nuxt) {
16
+ const resolver = createResolver(import.meta.url);
17
+ if (options.css) {
18
+ nuxt.options.css.push("vue-pivottable/dist/vue-pivottable.css");
19
+ }
20
+ addPlugin({
21
+ src: resolver.resolve("./runtime/plugin"),
22
+ mode: "client"
23
+ });
24
+ if (options.global) {
25
+ addComponent({
26
+ name: "VuePivottable",
27
+ export: "VuePivottable",
28
+ filePath: "vue-pivottable",
29
+ mode: "client"
30
+ });
31
+ addComponent({
32
+ name: "VuePivottableUi",
33
+ export: "VuePivottableUi",
34
+ filePath: "vue-pivottable",
35
+ mode: "client"
36
+ });
37
+ }
38
+ }
39
+ });
40
+
41
+ export { module as default };
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ const Vue = require('vue');
4
+ const vuePivottable = require('vue-pivottable');
5
+
6
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
7
+
8
+ const Vue__default = /*#__PURE__*/_interopDefaultCompat(Vue);
9
+
10
+ Vue__default.component("VuePivottable", vuePivottable.VuePivottable);
11
+ Vue__default.component("VuePivottableUi", vuePivottable.VuePivottableUi);
12
+
13
+ exports.VuePivottable = vuePivottable.VuePivottable;
14
+ exports.VuePivottableUi = vuePivottable.VuePivottableUi;
@@ -0,0 +1,6 @@
1
+ import Vue from 'vue';
2
+ import { VuePivottable, VuePivottableUi } from 'vue-pivottable';
3
+ export { VuePivottable, VuePivottableUi } from 'vue-pivottable';
4
+
5
+ Vue.component("VuePivottable", VuePivottable);
6
+ Vue.component("VuePivottableUi", VuePivottableUi);
@@ -0,0 +1,6 @@
1
+ import Vue from 'vue';
2
+ import { VuePivottable, VuePivottableUi } from 'vue-pivottable';
3
+ export { VuePivottable, VuePivottableUi } from 'vue-pivottable';
4
+
5
+ Vue.component("VuePivottable", VuePivottable);
6
+ Vue.component("VuePivottableUi", VuePivottableUi);
@@ -0,0 +1,6 @@
1
+ import Vue from 'vue';
2
+ import { VuePivottable, VuePivottableUi } from 'vue-pivottable';
3
+ export { VuePivottable, VuePivottableUi } from 'vue-pivottable';
4
+
5
+ Vue.component("VuePivottable", VuePivottable);
6
+ Vue.component("VuePivottableUi", VuePivottableUi);
@@ -0,0 +1,6 @@
1
+ import Vue from 'vue';
2
+ import { VuePivottable, VuePivottableUi } from 'vue-pivottable';
3
+ export { VuePivottable, VuePivottableUi } from 'vue-pivottable';
4
+
5
+ Vue.component("VuePivottable", VuePivottable);
6
+ Vue.component("VuePivottableUi", VuePivottableUi);
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ const _app = require('#app');
4
+
5
+ const plugin = _app.defineNuxtPlugin((nuxtApp) => {
6
+ return {
7
+ provide: {
8
+ pivottable: {
9
+ // Expose utilities if needed
10
+ }
11
+ }
12
+ };
13
+ });
14
+
15
+ module.exports = plugin;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Vue Pivottable Plugin for Nuxt 3
3
+ * Client-side only plugin
4
+ */
5
+ declare const _default: any;
6
+
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Vue Pivottable Plugin for Nuxt 3
3
+ * Client-side only plugin
4
+ */
5
+ declare const _default: any;
6
+
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Vue Pivottable Plugin for Nuxt 3
3
+ * Client-side only plugin
4
+ */
5
+ declare const _default: any;
6
+
7
+ export { _default as default };
@@ -0,0 +1,13 @@
1
+ import { defineNuxtPlugin } from '#app';
2
+
3
+ const plugin = defineNuxtPlugin((nuxtApp) => {
4
+ return {
5
+ provide: {
6
+ pivottable: {
7
+ // Expose utilities if needed
8
+ }
9
+ }
10
+ };
11
+ });
12
+
13
+ export { plugin as default };
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@vue-pivottable/nuxt",
3
+ "version": "0.1.0",
4
+ "description": "Nuxt module for vue-pivottable (Nuxt 2/3 compatible)",
5
+ "author": "Seungwoo321",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/types.d.ts",
11
+ "import": "./dist/module.mjs",
12
+ "require": "./dist/module.cjs"
13
+ },
14
+ "./nuxt2": {
15
+ "import": "./dist/nuxt2.mjs",
16
+ "require": "./dist/nuxt2.cjs"
17
+ },
18
+ "./nuxt3": {
19
+ "types": "./dist/types.d.ts",
20
+ "import": "./dist/nuxt3.mjs",
21
+ "require": "./dist/nuxt3.cjs"
22
+ }
23
+ },
24
+ "main": "./dist/module.cjs",
25
+ "module": "./dist/module.mjs",
26
+ "types": "./dist/types.d.ts",
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "scripts": {
31
+ "build": "unbuild",
32
+ "dev": "unbuild --stub",
33
+ "prepublishOnly": "npm run build"
34
+ },
35
+ "peerDependencies": {
36
+ "nuxt": "^2.0.0 || ^3.0.0"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "nuxt": {
40
+ "optional": false
41
+ }
42
+ },
43
+ "devDependencies": {
44
+ "@nuxt/kit": "^3.9.0",
45
+ "@nuxt/schema": "^3.9.0",
46
+ "release-it": "^17.0.0",
47
+ "typescript": "^5.0.0",
48
+ "unbuild": "^2.0.0"
49
+ },
50
+ "keywords": [
51
+ "nuxt",
52
+ "nuxt2",
53
+ "nuxt3",
54
+ "nuxt-module",
55
+ "vue-pivottable",
56
+ "pivottable"
57
+ ],
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "git+https://github.com/vue-pivottable/nuxt.git"
61
+ },
62
+ "publishConfig": {
63
+ "access": "public"
64
+ }
65
+ }