@smallwebco/tinypivot-vue 1.0.53 → 1.0.55
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 +91 -1
- package/dist/components/AIAnalyst.vue.d.ts +38 -0
- package/dist/components/AIAnalyst.vue.d.ts.map +1 -0
- package/dist/components/ChartBuilder.vue.d.ts.map +1 -1
- package/dist/components/ColumnFilter.vue.d.ts +2 -2
- package/dist/components/ColumnFilter.vue.d.ts.map +1 -1
- package/dist/components/DataGrid.vue.d.ts +17 -0
- package/dist/components/DataGrid.vue.d.ts.map +1 -1
- package/dist/components/PivotConfig.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/useAIAnalyst.d.ts +98 -0
- package/dist/composables/useAIAnalyst.d.ts.map +1 -0
- package/dist/composables/useLicense.d.ts +2 -0
- package/dist/composables/useLicense.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tinypivot-vue.js +4945 -14106
- package/dist/tinypivot-vue.js.map +1 -1
- package/dist/tinypivot-vue.umd.cjs +276 -34
- package/dist/tinypivot-vue.umd.cjs.map +1 -1
- package/dist/vue3-apexcharts-CAskEAyG.js +10891 -0
- package/dist/vue3-apexcharts-CAskEAyG.js.map +1 -0
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
# @smallwebco/tinypivot-vue
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A lightweight, AI-ready data grid with pivot tables and charts for Vue 3. **Under 50KB gzipped** — 10x smaller than AG Grid.
|
|
4
4
|
|
|
5
5
|
**[Live Demo](https://tiny-pivot.com)** · **[Buy License](https://tiny-pivot.com/#pricing)**
|
|
6
6
|
|
|
7
|
+
## Why TinyPivot?
|
|
8
|
+
|
|
9
|
+
- **Lightweight**: Under 50KB gzipped vs 500KB+ for AG Grid
|
|
10
|
+
- **AI-Ready**: Natural language data exploration with your own API key (BYOK)
|
|
11
|
+
- **Batteries Included**: Pivot tables, charts, and Excel-like features out of the box
|
|
12
|
+
- **One-Time License**: No subscriptions — pay once, use forever
|
|
13
|
+
|
|
7
14
|
## Installation
|
|
8
15
|
|
|
9
16
|
```bash
|
|
@@ -49,6 +56,8 @@ const data = [
|
|
|
49
56
|
| Column resizing | ✅ | ✅ |
|
|
50
57
|
| Clipboard (Ctrl+C) | ✅ | ✅ |
|
|
51
58
|
| Dark mode | ✅ | ✅ |
|
|
59
|
+
| **AI Data Analyst** (natural language, BYOK) | ❌ | ✅ |
|
|
60
|
+
| **Chart Builder** (6 chart types) | ❌ | ✅ |
|
|
52
61
|
| Pivot table | ❌ | ✅ |
|
|
53
62
|
| Aggregations (Sum, Avg, etc.) | ❌ | ✅ |
|
|
54
63
|
| Row/column totals | ❌ | ✅ |
|
|
@@ -79,6 +88,87 @@ const data = [
|
|
|
79
88
|
| `@export` | `{ rowCount, filename }` | CSV exported |
|
|
80
89
|
| `@copy` | `{ text, cellCount }` | Cells copied |
|
|
81
90
|
|
|
91
|
+
## AI Data Analyst (Pro)
|
|
92
|
+
|
|
93
|
+
Enable natural language data exploration with your own AI API key (BYOK).
|
|
94
|
+
|
|
95
|
+
```vue
|
|
96
|
+
<script setup lang="ts">
|
|
97
|
+
import { DataGrid } from '@smallwebco/tinypivot-vue'
|
|
98
|
+
import '@smallwebco/tinypivot-vue/style.css'
|
|
99
|
+
|
|
100
|
+
const data = [/* your data */]
|
|
101
|
+
|
|
102
|
+
const aiConfig = {
|
|
103
|
+
enabled: true,
|
|
104
|
+
aiEndpoint: '/api/ai-proxy', // Your AI proxy endpoint
|
|
105
|
+
databaseEndpoint: '/api/tp-database', // Optional: auto-discover tables
|
|
106
|
+
aiModelName: 'Claude Sonnet 4', // Optional: display in UI
|
|
107
|
+
persistToLocalStorage: true, // Preserve conversation on tab switch
|
|
108
|
+
}
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<template>
|
|
112
|
+
<DataGrid
|
|
113
|
+
:data="data"
|
|
114
|
+
:ai-analyst="aiConfig"
|
|
115
|
+
/>
|
|
116
|
+
</template>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### AI Analyst Config Options
|
|
120
|
+
|
|
121
|
+
| Option | Type | Description |
|
|
122
|
+
|--------|------|-------------|
|
|
123
|
+
| `enabled` | `boolean` | Enable the AI Analyst tab |
|
|
124
|
+
| `aiEndpoint` | `string` | Your AI proxy endpoint (keeps API keys secure) |
|
|
125
|
+
| `databaseEndpoint` | `string` | Unified endpoint for table discovery and queries |
|
|
126
|
+
| `dataSources` | `AIDataSource[]` | Manual list of available tables |
|
|
127
|
+
| `queryExecutor` | `function` | Custom query executor (e.g., client-side DuckDB) |
|
|
128
|
+
| `aiModelName` | `string` | Display name for the AI model in UI |
|
|
129
|
+
| `persistToLocalStorage` | `boolean` | Persist conversation across tab switches |
|
|
130
|
+
| `sessionId` | `string` | Unique session ID for conversation isolation |
|
|
131
|
+
| `maxRows` | `number` | Max rows to return (default: 10000) |
|
|
132
|
+
| `demoMode` | `boolean` | Use canned responses (no real AI calls) |
|
|
133
|
+
|
|
134
|
+
### AI Analyst Events
|
|
135
|
+
|
|
136
|
+
| Event | Payload | Description |
|
|
137
|
+
|-------|---------|-------------|
|
|
138
|
+
| `@ai-data-loaded` | `{ data, query, rowCount }` | Query results loaded |
|
|
139
|
+
| `@ai-conversation-update` | `{ conversation }` | Conversation state changed |
|
|
140
|
+
| `@ai-query-executed` | `{ query, rowCount, duration, success }` | SQL query executed |
|
|
141
|
+
| `@ai-error` | `{ message, type }` | Error occurred |
|
|
142
|
+
|
|
143
|
+
### State Preservation
|
|
144
|
+
|
|
145
|
+
The AI Analyst preserves state when switching between tabs (Grid, Pivot, Chart, AI):
|
|
146
|
+
|
|
147
|
+
- **Conversation history** is maintained in memory
|
|
148
|
+
- **Query results** are preserved
|
|
149
|
+
- **SQL queries** remain accessible via the SQL panel
|
|
150
|
+
|
|
151
|
+
To persist across page refreshes, enable `persistToLocalStorage: true`. The conversation will be saved to localStorage using the `sessionId` as the key.
|
|
152
|
+
|
|
153
|
+
For production apps, listen to `@ai-conversation-update` to implement your own persistence:
|
|
154
|
+
|
|
155
|
+
```vue
|
|
156
|
+
<template>
|
|
157
|
+
<DataGrid
|
|
158
|
+
:data="data"
|
|
159
|
+
:ai-analyst="aiConfig"
|
|
160
|
+
@ai-conversation-update="saveConversation"
|
|
161
|
+
/>
|
|
162
|
+
</template>
|
|
163
|
+
|
|
164
|
+
<script setup>
|
|
165
|
+
function saveConversation({ conversation }) {
|
|
166
|
+
// Save to your backend
|
|
167
|
+
api.saveConversation(userId, conversation)
|
|
168
|
+
}
|
|
169
|
+
</script>
|
|
170
|
+
```
|
|
171
|
+
|
|
82
172
|
## Documentation
|
|
83
173
|
|
|
84
174
|
See the [full documentation](https://github.com/Small-Web-Co/tinypivot) for complete API reference, styling, and Pro license activation.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AIAnalystConfig, AIConversationUpdateEvent, AIDataLoadedEvent, AIErrorEvent, AIQueryExecutedEvent } from '@smallwebco/tinypivot-core';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
config: AIAnalystConfig;
|
|
5
|
+
theme?: "light" | "dark" | undefined;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
dataLoaded: (payload: AIDataLoadedEvent) => void;
|
|
8
|
+
conversationUpdate: (payload: AIConversationUpdateEvent) => void;
|
|
9
|
+
queryExecuted: (payload: AIQueryExecutedEvent) => void;
|
|
10
|
+
error: (payload: AIErrorEvent) => void;
|
|
11
|
+
viewResults: (payload: {
|
|
12
|
+
data: Record<string, unknown>[];
|
|
13
|
+
query: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
16
|
+
config: AIAnalystConfig;
|
|
17
|
+
theme?: "light" | "dark" | undefined;
|
|
18
|
+
}>>> & Readonly<{
|
|
19
|
+
onError?: ((payload: AIErrorEvent) => any) | undefined;
|
|
20
|
+
onDataLoaded?: ((payload: AIDataLoadedEvent) => any) | undefined;
|
|
21
|
+
onConversationUpdate?: ((payload: AIConversationUpdateEvent) => any) | undefined;
|
|
22
|
+
onQueryExecuted?: ((payload: AIQueryExecutedEvent) => any) | undefined;
|
|
23
|
+
onViewResults?: ((payload: {
|
|
24
|
+
data: Record<string, unknown>[];
|
|
25
|
+
query: string;
|
|
26
|
+
}) => any) | undefined;
|
|
27
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
30
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
31
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
32
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
33
|
+
} : {
|
|
34
|
+
type: import('vue').PropType<T[K]>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=AIAnalyst.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AIAnalyst.vue.d.ts","sourceRoot":"","sources":["../../src/components/AIAnalyst.vue"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EAEZ,oBAAoB,EAErB,MAAM,4BAA4B,CAAA;;YA8rEzB,eAAe;;;;;;;;;;;;YAAf,eAAe;;;;;;;;;;;;AANzB,wBAUG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartBuilder.vue.d.ts","sourceRoot":"","sources":["../../src/components/ChartBuilder.vue"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,4BAA4B,CAAA;;
|
|
1
|
+
{"version":3,"file":"ChartBuilder.vue.d.ts","sourceRoot":"","sources":["../../src/components/ChartBuilder.vue"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,4BAA4B,CAAA;;UA4pD3B,OAAO,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;UAAzB,OAAO,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;AANjC,wBAUG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
|
|
@@ -9,9 +9,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
9
9
|
/** Current numeric range filter (if any) */
|
|
10
10
|
numericRange?: NumericRange | null | undefined;
|
|
11
11
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
-
close: () => void;
|
|
13
12
|
sort: (direction: "desc" | "asc" | null) => void;
|
|
14
13
|
filter: (values: string[]) => void;
|
|
14
|
+
close: () => void;
|
|
15
15
|
rangeFilter: (range: NumericRange | null) => void;
|
|
16
16
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
17
17
|
columnId: string;
|
|
@@ -22,9 +22,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
22
22
|
/** Current numeric range filter (if any) */
|
|
23
23
|
numericRange?: NumericRange | null | undefined;
|
|
24
24
|
}>>> & Readonly<{
|
|
25
|
-
onClose?: (() => any) | undefined;
|
|
26
25
|
onSort?: ((direction: "desc" | "asc" | null) => any) | undefined;
|
|
27
26
|
onFilter?: ((values: string[]) => any) | undefined;
|
|
27
|
+
onClose?: (() => any) | undefined;
|
|
28
28
|
onRangeFilter?: ((range: NumericRange | null) => any) | undefined;
|
|
29
29
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
30
30
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnFilter.vue.d.ts","sourceRoot":"","sources":["../../src/components/ColumnFilter.vue"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;;
|
|
1
|
+
{"version":3,"file":"ColumnFilter.vue.d.ts","sourceRoot":"","sources":["../../src/components/ColumnFilter.vue"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;;cA+zB/D,MAAM;gBACJ,MAAM;WACX,WAAW;oBACF,MAAM,EAAE;mBACT,KAAK,GAAG,MAAM,GAAG,IAAI;IACpC,4CAA4C;;;;;;;;cALlC,MAAM;gBACJ,MAAM;WACX,WAAW;oBACF,MAAM,EAAE;mBACT,KAAK,GAAG,MAAM,GAAG,IAAI;IACpC,4CAA4C;;;;;;;;AAX9C,wBAeG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AIAnalystConfig, AIConversationUpdateEvent, AIDataLoadedEvent, AIErrorEvent, AIQueryExecutedEvent } from '@smallwebco/tinypivot-core';
|
|
2
|
+
|
|
1
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
4
|
data: Record<string, unknown>[];
|
|
3
5
|
loading?: boolean | undefined;
|
|
@@ -18,6 +20,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
18
20
|
initialHeight?: number | undefined;
|
|
19
21
|
minHeight?: number | undefined;
|
|
20
22
|
maxHeight?: number | undefined;
|
|
23
|
+
/** AI Data Analyst configuration (Pro feature, disabled by default) */
|
|
24
|
+
aiAnalyst?: AIAnalystConfig | undefined;
|
|
21
25
|
}>, {
|
|
22
26
|
loading: boolean;
|
|
23
27
|
rowHeight: number;
|
|
@@ -37,6 +41,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
37
41
|
initialHeight: number;
|
|
38
42
|
minHeight: number;
|
|
39
43
|
maxHeight: number;
|
|
44
|
+
aiAnalyst: undefined;
|
|
40
45
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
41
46
|
cellClick: (payload: {
|
|
42
47
|
row: number;
|
|
@@ -59,6 +64,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
59
64
|
text: string;
|
|
60
65
|
cellCount: number;
|
|
61
66
|
}) => void;
|
|
67
|
+
aiDataLoaded: (payload: AIDataLoadedEvent) => void;
|
|
68
|
+
aiConversationUpdate: (payload: AIConversationUpdateEvent) => void;
|
|
69
|
+
aiQueryExecuted: (payload: AIQueryExecutedEvent) => void;
|
|
70
|
+
aiError: (payload: AIErrorEvent) => void;
|
|
62
71
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
63
72
|
data: Record<string, unknown>[];
|
|
64
73
|
loading?: boolean | undefined;
|
|
@@ -79,6 +88,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
79
88
|
initialHeight?: number | undefined;
|
|
80
89
|
minHeight?: number | undefined;
|
|
81
90
|
maxHeight?: number | undefined;
|
|
91
|
+
/** AI Data Analyst configuration (Pro feature, disabled by default) */
|
|
92
|
+
aiAnalyst?: AIAnalystConfig | undefined;
|
|
82
93
|
}>, {
|
|
83
94
|
loading: boolean;
|
|
84
95
|
rowHeight: number;
|
|
@@ -98,6 +109,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
98
109
|
initialHeight: number;
|
|
99
110
|
minHeight: number;
|
|
100
111
|
maxHeight: number;
|
|
112
|
+
aiAnalyst: undefined;
|
|
101
113
|
}>>> & Readonly<{
|
|
102
114
|
onCopy?: ((payload: {
|
|
103
115
|
text: string;
|
|
@@ -120,9 +132,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
120
132
|
rowCount: number;
|
|
121
133
|
filename: string;
|
|
122
134
|
}) => any) | undefined;
|
|
135
|
+
onAiDataLoaded?: ((payload: AIDataLoadedEvent) => any) | undefined;
|
|
136
|
+
onAiConversationUpdate?: ((payload: AIConversationUpdateEvent) => any) | undefined;
|
|
137
|
+
onAiQueryExecuted?: ((payload: AIQueryExecutedEvent) => any) | undefined;
|
|
138
|
+
onAiError?: ((payload: AIErrorEvent) => any) | undefined;
|
|
123
139
|
}>, {
|
|
124
140
|
theme: 'light' | 'dark' | 'auto';
|
|
125
141
|
fontSize: 'xs' | 'sm' | 'base';
|
|
142
|
+
aiAnalyst: AIAnalystConfig;
|
|
126
143
|
loading: boolean;
|
|
127
144
|
rowHeight: number;
|
|
128
145
|
headerHeight: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.vue.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataGrid.vue.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.vue"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EAGrB,MAAM,4BAA4B,CAAA;;UA0oH3B,OAAO,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;;;;;;;;;;;;;;;IAoB/B,uEAAuE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UApBjE,OAAO,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;;;;;;;;;;;;;;;IAoB/B,uEAAuE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAP/D,OAAO,GAAG,MAAM,GAAG,MAAM;cATtB,IAAI,GAAG,IAAI,GAAG,MAAM;eAiBnB,eAAe;aApBjB,OAAO;eACL,MAAM;kBACH,MAAM;eAET,OAAO;kBAEJ,OAAO;kBACP,OAAO;sBACH,OAAO;cACf,MAAM;wBACI,OAAO;qBACV,OAAO;iBAEX,OAAO;oBACJ,MAAM;0BACA,OAAO;mBACd,MAAM;eACV,MAAM;eACN,MAAM;;AAzBpB,wBA8BG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PivotConfig.vue.d.ts","sourceRoot":"","sources":["../../src/components/PivotConfig.vue"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAYvG,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IACxD,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;CACnB;;
|
|
1
|
+
{"version":3,"file":"PivotConfig.vue.d.ts","sourceRoot":"","sources":["../../src/components/PivotConfig.vue"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAYvG,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IACxD,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;CACnB;;qBAwgCkB,UAAU,EAAE;eAClB,MAAM,EAAE;kBACL,MAAM,EAAE;iBACT,eAAe,EAAE;mBACf,OAAO;sBACJ,OAAO;;;;;;;;;;;;;;;;;;;qBALR,UAAU,EAAE;eAClB,MAAM,EAAE;kBACL,MAAM,EAAE;iBACT,eAAe,EAAE;mBACf,OAAO;sBACJ,OAAO;;;;;;;;;;;;;;;;;;;AAX3B,wBAeG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { useAIAnalyst } from './useAIAnalyst';
|
|
2
|
+
export type { UseAIAnalystOptions } from './useAIAnalyst';
|
|
1
3
|
export { formatCellValue, getColumnUniqueValues, useExcelGrid } from './useExcelGrid';
|
|
2
4
|
export { copyToClipboard, exportPivotToCSV, exportToCSV, formatSelectionForClipboard, useColumnResize, useGlobalSearch, usePagination, useRowSelection, } from './useGridFeatures';
|
|
3
5
|
export { configureLicenseSecret, enableDemoMode, setLicenseKey, useLicense } from './useLicense';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACrF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAChG,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACrF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAChG,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { AIAnalystConfig, AIConversation, AIConversationUpdateEvent, AIDataLoadedEvent, AIDataSource, AIErrorEvent, AIQueryExecutedEvent, AITableSchema } from '@smallwebco/tinypivot-core';
|
|
2
|
+
|
|
3
|
+
export interface UseAIAnalystOptions {
|
|
4
|
+
config: AIAnalystConfig;
|
|
5
|
+
onDataLoaded?: (event: AIDataLoadedEvent) => void;
|
|
6
|
+
onConversationUpdate?: (event: AIConversationUpdateEvent) => void;
|
|
7
|
+
onQueryExecuted?: (event: AIQueryExecutedEvent) => void;
|
|
8
|
+
onError?: (event: AIErrorEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useAIAnalyst(options: UseAIAnalystOptions): {
|
|
11
|
+
conversation: import('vue').Ref<{
|
|
12
|
+
id: string;
|
|
13
|
+
messages: {
|
|
14
|
+
id: string;
|
|
15
|
+
role: "user" | "assistant" | "system";
|
|
16
|
+
content: string;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
metadata?: {
|
|
19
|
+
query?: string | undefined;
|
|
20
|
+
rowCount?: number | undefined;
|
|
21
|
+
error?: string | undefined;
|
|
22
|
+
duration?: number | undefined;
|
|
23
|
+
dataSourceId?: string | undefined;
|
|
24
|
+
data?: Record<string, unknown>[] | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
}[];
|
|
27
|
+
dataSourceId?: string | undefined;
|
|
28
|
+
createdAt: number;
|
|
29
|
+
updatedAt: number;
|
|
30
|
+
}, AIConversation | {
|
|
31
|
+
id: string;
|
|
32
|
+
messages: {
|
|
33
|
+
id: string;
|
|
34
|
+
role: "user" | "assistant" | "system";
|
|
35
|
+
content: string;
|
|
36
|
+
timestamp: number;
|
|
37
|
+
metadata?: {
|
|
38
|
+
query?: string | undefined;
|
|
39
|
+
rowCount?: number | undefined;
|
|
40
|
+
error?: string | undefined;
|
|
41
|
+
duration?: number | undefined;
|
|
42
|
+
dataSourceId?: string | undefined;
|
|
43
|
+
data?: Record<string, unknown>[] | undefined;
|
|
44
|
+
} | undefined;
|
|
45
|
+
}[];
|
|
46
|
+
dataSourceId?: string | undefined;
|
|
47
|
+
createdAt: number;
|
|
48
|
+
updatedAt: number;
|
|
49
|
+
}>;
|
|
50
|
+
messages: import('vue').ComputedRef<{
|
|
51
|
+
id: string;
|
|
52
|
+
role: "user" | "assistant" | "system";
|
|
53
|
+
content: string;
|
|
54
|
+
timestamp: number;
|
|
55
|
+
metadata?: {
|
|
56
|
+
query?: string | undefined;
|
|
57
|
+
rowCount?: number | undefined;
|
|
58
|
+
error?: string | undefined;
|
|
59
|
+
duration?: number | undefined;
|
|
60
|
+
dataSourceId?: string | undefined;
|
|
61
|
+
data?: Record<string, unknown>[] | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
}[]>;
|
|
64
|
+
hasMessages: import('vue').ComputedRef<boolean>;
|
|
65
|
+
schemas: import('vue').Ref<Map<string, {
|
|
66
|
+
table: string;
|
|
67
|
+
columns: {
|
|
68
|
+
name: string;
|
|
69
|
+
type: "string" | "number" | "boolean" | "date" | "unknown";
|
|
70
|
+
nullable: boolean;
|
|
71
|
+
description?: string | undefined;
|
|
72
|
+
}[];
|
|
73
|
+
}> & Omit<Map<string, AITableSchema>, keyof Map<any, any>>, Map<string, AITableSchema> | (Map<string, {
|
|
74
|
+
table: string;
|
|
75
|
+
columns: {
|
|
76
|
+
name: string;
|
|
77
|
+
type: "string" | "number" | "boolean" | "date" | "unknown";
|
|
78
|
+
nullable: boolean;
|
|
79
|
+
description?: string | undefined;
|
|
80
|
+
}[];
|
|
81
|
+
}> & Omit<Map<string, AITableSchema>, keyof Map<any, any>>)>;
|
|
82
|
+
isLoading: import('vue').Ref<boolean, boolean>;
|
|
83
|
+
isLoadingTables: import('vue').Ref<boolean, boolean>;
|
|
84
|
+
error: import('vue').Ref<string | null, string | null>;
|
|
85
|
+
lastLoadedData: import('vue').Ref<Record<string, unknown>[] | null, Record<string, unknown>[] | null>;
|
|
86
|
+
selectedDataSource: import('vue').ComputedRef<string | undefined>;
|
|
87
|
+
selectedDataSourceInfo: import('vue').ComputedRef<AIDataSource | undefined>;
|
|
88
|
+
/** Available data sources (either from config or auto-discovered) */
|
|
89
|
+
dataSources: import('vue').ComputedRef<AIDataSource[]>;
|
|
90
|
+
selectDataSource: (dataSourceId: string) => Promise<void>;
|
|
91
|
+
sendMessage: (content: string) => Promise<void>;
|
|
92
|
+
clearConversation: () => void;
|
|
93
|
+
exportConversation: () => AIConversation;
|
|
94
|
+
importConversation: (conv: AIConversation) => void;
|
|
95
|
+
/** Refresh table list from endpoint */
|
|
96
|
+
fetchTables: () => Promise<void>;
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=useAIAnalyst.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAIAnalyst.d.ts","sourceRoot":"","sources":["../../src/composables/useAIAnalyst.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EAEZ,oBAAoB,EACpB,aAAa,EAGd,MAAM,4BAA4B,CAAA;AAkBnC,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACjD,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAA;IACjE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;CACxC;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAynBrD,qEAAqE;;qCAxfzB,MAAM;2BAwGhB,MAAM;;8BAgXX,cAAc;+BAOX,cAAc;IAkC9C,uCAAuC;;EAG1C"}
|
|
@@ -28,6 +28,7 @@ export declare function useLicense(): {
|
|
|
28
28
|
sessionPersistence: boolean;
|
|
29
29
|
noWatermark: boolean;
|
|
30
30
|
charts: boolean;
|
|
31
|
+
aiAnalyst: boolean;
|
|
31
32
|
};
|
|
32
33
|
}>;
|
|
33
34
|
isDemo: import('vue').ComputedRef<boolean>;
|
|
@@ -36,6 +37,7 @@ export declare function useLicense(): {
|
|
|
36
37
|
canUseAdvancedAggregations: import('vue').ComputedRef<boolean>;
|
|
37
38
|
canUsePercentageMode: import('vue').ComputedRef<boolean>;
|
|
38
39
|
canUseCharts: import('vue').ComputedRef<boolean>;
|
|
40
|
+
canUseAIAnalyst: import('vue').ComputedRef<boolean>;
|
|
39
41
|
showWatermark: import('vue').ComputedRef<boolean>;
|
|
40
42
|
requirePro: (feature: string) => boolean;
|
|
41
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLicense.d.ts","sourceRoot":"","sources":["../../src/composables/useLicense.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLicense.d.ts","sourceRoot":"","sources":["../../src/composables/useLicense.ts"],"names":[],"mappings":"AA2BA;;;GAGG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAc9D;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUrE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE3D;AAED;;GAEG;AACH,wBAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;;;0BAqBK,MAAM,KAAG,OAAO;EAoB9C"}
|