ag-studio-vue3 2.1.2 → 3.0.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 +21 -21
- package/dist/main.mjs +282 -135
- package/dist/main.umd.js +1 -1
- package/dist/typings/components/AgStudio.vue.d.ts +1 -1
- package/dist/typings/components/GridWidget.vue.d.ts +14 -0
- package/dist/typings/components/PivotGridWidget.vue.d.ts +14 -0
- package/dist/typings/components/VueFrameworkComponentWrapper.d.ts +6 -2
- package/dist/typings/components/interfaces.d.ts +43 -1
- package/dist/typings/components/studioBeans.d.ts +4 -0
- package/dist/typings/components/utils.d.ts +39 -6
- package/dist/typings/createWidgets.d.ts +6 -0
- package/dist/typings/main.d.ts +5 -2
- package/dist/typings/widgetDefaults.d.ts +3 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
<picture>
|
|
5
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://ag-grid.com/studio/images/ag-studio-logo-dark.svg"/>
|
|
6
|
-
<source media="(prefers-color-scheme: light)" srcset="https://ag-grid.com/studio/images/ag-studio-logo.svg"/>
|
|
7
|
-
<img width="100%" alt="AG Studio Logo" src="https://ag-grid.com/studio/images/ag-studio-logo.svg"/>
|
|
5
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://www.ag-grid.com/studio/images/ag-studio-logo-dark.svg"/>
|
|
6
|
+
<source media="(prefers-color-scheme: light)" srcset="https://www.ag-grid.com/studio/images/ag-studio-logo.svg"/>
|
|
7
|
+
<img width="100%" alt="AG Studio Logo" src="https://www.ag-grid.com/studio/images/ag-studio-logo.svg"/>
|
|
8
8
|
</picture>
|
|
9
9
|
<div align="center">
|
|
10
|
-
<h4><a href="https://ag-grid.com/studio/">Website</a> · <a href="https://ag-grid.com/studio/vue/overview/">Documentation</a> · <a href="https://ag-grid.com/studio/example/">Live Demo</a></h4>
|
|
10
|
+
<h4><a href="https://www.ag-grid.com/studio/">Website</a> · <a href="https://www.ag-grid.com/studio/vue/overview/">Documentation</a> · <a href="https://www.ag-grid.com/studio/example/">Live Demo</a></h4>
|
|
11
11
|
</div>
|
|
12
12
|
<br>
|
|
13
13
|
<a href="https://www.npmjs.com/package/ag-studio-vue3">
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
</a>
|
|
19
19
|
<br><br>
|
|
20
20
|
<!-- START MAIN DESCRIPTION -->
|
|
21
|
-
<p><strong><a href="https://ag-grid.com/studio/vue/overview/"><img src="https://ag-grid.com/images/fw-logos/vue.svg" height="16" width="16" alt="Vue Logo"> AG Studio</a></strong> is a <strong>Vue</strong> Embedded Analytics component for creating dashboards, built on top of <a href="https://ag-grid.com">AG Grid</a> and <a href="https://ag-grid.com/charts">AG Charts</a>.</p>
|
|
21
|
+
<p><strong><a href="https://www.ag-grid.com/studio/vue/overview/"><img src="https://www.ag-grid.com/images/fw-logos/vue.svg" height="16" width="16" alt="Vue Logo"> AG Studio</a></strong> is a <strong>Vue</strong> Embedded Analytics component for creating dashboards, built on top of <a href="https://www.ag-grid.com/">AG Grid</a> and <a href="https://www.ag-grid.com/charts/">AG Charts</a>.</p>
|
|
22
22
|
<!-- END MAIN DESCRIPTION -->
|
|
23
23
|
<br>
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
<picture>
|
|
27
|
-
<source srcset="https://ag-grid.com/studio/images/studio-footer.png" media="(prefers-color-scheme: light)">
|
|
28
|
-
<source srcset="https://ag-grid.com/studio/images/studio-footer-dark.png" media="(prefers-color-scheme: dark)">
|
|
29
|
-
<img src="https://ag-grid.com/studio/images/studio-footer.png" alt="AG Studio Preview">
|
|
27
|
+
<source srcset="https://www.ag-grid.com/studio/images/studio-footer.png" media="(prefers-color-scheme: light)">
|
|
28
|
+
<source srcset="https://www.ag-grid.com/studio/images/studio-footer-dark.png" media="(prefers-color-scheme: dark)">
|
|
29
|
+
<img src="https://www.ag-grid.com/studio/images/studio-footer.png" alt="AG Studio Preview">
|
|
30
30
|
</picture>
|
|
31
31
|
<div align="right">
|
|
32
|
-
<a href="https://ag-grid.com/studio/example/"><br><img alt="Live Demo" src="https://img.shields.io/badge/ag--grid.com%2Fstudio-Live%20Demo-blue?style=for-the-badge"></a>
|
|
32
|
+
<a href="https://www.ag-grid.com/studio/example/"><br><img alt="Live Demo" src="https://img.shields.io/badge/ag--grid.com%2Fstudio-Live%20Demo-blue?style=for-the-badge"></a>
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
35
|
## Overview
|
|
@@ -46,13 +46,13 @@ You can ship pre-built reports in code so users see a finished dashboard on firs
|
|
|
46
46
|
|
|
47
47
|
### Features
|
|
48
48
|
|
|
49
|
-
| Feature
|
|
50
|
-
|
|
|
51
|
-
| [Drag & Drop Report Builder](https://ag-grid.com/studio/vue/modes-layout/) | Bar charts, line charts, pie charts, grids, KPI tiles, text, and images on a drag-and-drop canvas. Design in **edit mode**, then switch to **view mode** to lock the layout while keeping the dashboard fully interactive. |
|
|
52
|
-
| [Data Engine](https://ag-grid.com/studio/vue/data/) | Provide one or more data sources and the data engine automatically manages joins across tables via relationships, aggregation, filtering, and calculated fields through an expression language. No query layer required. |
|
|
53
|
-
| [Advanced Filtering](https://ag-grid.com/studio/vue/filters/) | Page-level filters, widget-level filters, and cross-filtering between widgets are all built in. Users can filter from the filters panel, from on-canvas filter widgets (list, button, and date), or by clicking data points in charts to cross-filter the rest of the page. |
|
|
54
|
-
| [Theming](https://ag-grid.com/studio/vue/theming/) | Full customisation via the Theming API. Override colours, fonts, spacing, and borders across the Studio UI, grid widgets, and chart widgets independently. Light and dark modes are supported out of the box. |
|
|
55
|
-
| [State Management](https://ag-grid.com/studio/vue/state/) | The entire dashboard state (pages, widgets, layout, and filters) is captured in a single serialisable JSON object. Save and restore state to persist reports, and let users switch between saved reports. |
|
|
49
|
+
| Feature | Description |
|
|
50
|
+
| ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| [Drag & Drop Report Builder](https://www.ag-grid.com/studio/vue/modes-layout/) | Bar charts, line charts, pie charts, grids, KPI tiles, text, and images on a drag-and-drop canvas. Design in **edit mode**, then switch to **view mode** to lock the layout while keeping the dashboard fully interactive. |
|
|
52
|
+
| [Data Engine](https://www.ag-grid.com/studio/vue/data/) | Provide one or more data sources and the data engine automatically manages joins across tables via relationships, aggregation, filtering, and calculated fields through an expression language. No query layer required. |
|
|
53
|
+
| [Advanced Filtering](https://www.ag-grid.com/studio/vue/filters/) | Page-level filters, widget-level filters, and cross-filtering between widgets are all built in. Users can filter from the filters panel, from on-canvas filter widgets (list, button, and date), or by clicking data points in charts to cross-filter the rest of the page. |
|
|
54
|
+
| [Theming](https://www.ag-grid.com/studio/vue/theming/) | Full customisation via the Theming API. Override colours, fonts, spacing, and borders across the Studio UI, grid widgets, and chart widgets independently. Light and dark modes are supported out of the box. |
|
|
55
|
+
| [State Management](https://www.ag-grid.com/studio/vue/state/) | The entire dashboard state (pages, widgets, layout, and filters) is captured in a single serialisable JSON object. Save and restore state to persist reports, and let users switch between saved reports. |
|
|
56
56
|
|
|
57
57
|
## Quick Start
|
|
58
58
|
|
|
@@ -128,11 +128,11 @@ const data = { /* ... */ };
|
|
|
128
128
|
|
|
129
129
|
That's it — users can now build reports using the drag-and-drop editor.
|
|
130
130
|
|
|
131
|
-
> **Note:** For more information on building dashboards with AG Studio, refer to our [Quick Start](https://ag-grid.com/studio/vue/quick-start/) guide or step through the full [Tutorial](https://ag-grid.com/studio/vue/tutorial/).
|
|
131
|
+
> **Note:** For more information on building dashboards with AG Studio, refer to our [Quick Start](https://www.ag-grid.com/studio/vue/quick-start/) guide or step through the full [Tutorial](https://www.ag-grid.com/studio/vue/tutorial/).
|
|
132
132
|
|
|
133
133
|
## User Guides
|
|
134
134
|
|
|
135
|
-
Our [User Guides](https://ag-grid.com/studio/vue/user-interface/) contain comprehensive guides to help users understand how to use AG Studio.
|
|
135
|
+
Our [User Guides](https://www.ag-grid.com/studio/vue/user-interface/) contain comprehensive guides to help users understand how to use AG Studio.
|
|
136
136
|
|
|
137
137
|
## Support
|
|
138
138
|
|
|
@@ -142,9 +142,9 @@ AG Studio customers have access to dedicated support via [ZenDesk](https://ag-gr
|
|
|
142
142
|
|
|
143
143
|
`ag-studio` has a **Commercial** license. See the [LICENSE file](https://www.ag-grid.com/studio/licenses/ag-studio-vue3/LICENSE.html) for more info.
|
|
144
144
|
|
|
145
|
-
[Request a free 45-day enterprise trial](https://ag-grid.com/studio/license-pricing/?tab=trial) to explore the full enterprise capabilities of AG Studio with no restrictions or watermarks.
|
|
145
|
+
[Request a free 45-day enterprise trial](https://www.ag-grid.com/studio/license-pricing/?tab=trial) to explore the full enterprise capabilities of AG Studio with no restrictions or watermarks.
|
|
146
146
|
|
|
147
|
-
<div><h2><img vertical-align="middle" width="32" height="32" src="https://ag-grid.com/images/ag-logos/svg-logos/AG-BrandMark_Light-Theme.svg" alt="AG Grid Logo"> AG Grid</h2></div>
|
|
147
|
+
<div><h2><img vertical-align="middle" width="32" height="32" src="https://www.ag-grid.com/images/ag-logos/svg-logos/AG-BrandMark_Light-Theme.svg" alt="AG Grid Logo"> AG Grid</h2></div>
|
|
148
148
|
|
|
149
149
|
AG Studio is built on top of [AG Grid](https://www.ag-grid.com/) — the best JavaScript Data Grid in the world. If you need a standalone data grid with sorting, filtering, grouping, pivoting, and more, check out [AG Grid Repo](https://github.com/ag-grid/ag-grid).
|
|
150
150
|
|
|
@@ -154,7 +154,7 @@ AG Studio is built on top of [AG Grid](https://www.ag-grid.com/) — the best Ja
|
|
|
154
154
|
<img src="https://github.com/ag-grid/ag-grid/blob/latest/readme-assets/kitchen-sink-demo-light.gif?raw=true" alt="High Performance Demo">
|
|
155
155
|
</picture>
|
|
156
156
|
|
|
157
|
-
<div><h2><img vertical-align="middle" width="32" height="32" src="https://ag-grid.com/images/ag-logos/svg-logos/AG-BrandMark_Light-Theme.svg" alt="AG Charts Logo"> AG Charts</h2></div>
|
|
157
|
+
<div><h2><img vertical-align="middle" width="32" height="32" src="https://www.ag-grid.com/images/ag-logos/svg-logos/AG-BrandMark_Light-Theme.svg" alt="AG Charts Logo"> AG Charts</h2></div>
|
|
158
158
|
|
|
159
159
|
AG Studio is built on top of [AG Charts](https://www.ag-grid.com/charts/) — the best JavaScript Charting library in the world. If you need standalone charts with bar, line, pie, scatter, treemap, and more, check out [AG Charts](https://github.com/ag-grid/ag-charts).
|
|
160
160
|
|
package/dist/main.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { isRef as
|
|
5
|
-
import { _AgLogger as
|
|
6
|
-
|
|
1
|
+
var Y = Object.defineProperty;
|
|
2
|
+
var q = (l, e, t) => e in l ? Y(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
|
|
3
|
+
var v = (l, e, t) => q(l, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { isRef as E, isReactive as G, isProxy as D, toRaw as F, defineComponent as x, createVNode as J, render as L, ref as B, useTemplateRef as R, shallowRef as y, inject as $, onMounted as A, onUnmounted as T, createElementBlock as O, openBlock as w, normalizeStyle as V, createBlock as N, createCommentVNode as U, unref as I, mergeDefaults as Q, toRefs as X, watch as Z, getCurrentInstance as S, markRaw as ee } from "vue";
|
|
5
|
+
import { _AgLogger as P, _BaseComponentWrapper as te, _VanillaFrameworkOverrides as oe, _GridWidgetCore as re, _STUDIO_GRID_MODULES as z, _PivotGridWidgetCore as ne, _createWidgetDefaults as se, _GET_SHALLOW_STUDIO_PROPERTIES as ie, _GET_ALL_STUDIO_PROPERTIES as M, _processPropertyChanges as ae, _combineAttributesAndStudioProperties as de, _PUBLIC_EVENT_HANDLERS_MAP as le, _createStudio as ce, _ALWAYS_SYNC_GLOBAL_EVENTS as ue, _createWidgets as pe } from "ag-studio";
|
|
6
|
+
import { AgGridVue as H } from "ag-grid-vue3";
|
|
7
|
+
function fe() {
|
|
7
8
|
return {
|
|
8
9
|
studioProperties: {},
|
|
9
10
|
// @START_DEFAULTS@
|
|
@@ -17,6 +18,7 @@ function X() {
|
|
|
17
18
|
themeStyleContainer: void 0,
|
|
18
19
|
getDocument: void 0,
|
|
19
20
|
suppressTouch: void 0,
|
|
21
|
+
suppressKeyboard: void 0,
|
|
20
22
|
localeText: void 0,
|
|
21
23
|
aiText: void 0,
|
|
22
24
|
getLocaleText: void 0,
|
|
@@ -25,8 +27,11 @@ function X() {
|
|
|
25
27
|
initialState: void 0,
|
|
26
28
|
data: void 0,
|
|
27
29
|
mode: void 0,
|
|
30
|
+
history: void 0,
|
|
31
|
+
enableFilterEditingInViewMode: void 0,
|
|
28
32
|
layout: void 0,
|
|
29
33
|
ai: void 0,
|
|
34
|
+
aiToolDisplay: void 0,
|
|
30
35
|
dataOptions: void 0,
|
|
31
36
|
panels: void 0,
|
|
32
37
|
page: void 0,
|
|
@@ -43,166 +48,179 @@ function X() {
|
|
|
43
48
|
// @END_EVENT_PROPS@
|
|
44
49
|
};
|
|
45
50
|
}
|
|
46
|
-
function
|
|
47
|
-
if (!
|
|
51
|
+
function he(l) {
|
|
52
|
+
if (!l || typeof l != "object" || Array.isArray(l))
|
|
48
53
|
return !1;
|
|
49
|
-
const e = Object.getPrototypeOf(
|
|
54
|
+
const e = Object.getPrototypeOf(l);
|
|
50
55
|
return e !== null && e !== Object.prototype;
|
|
51
56
|
}
|
|
52
|
-
function
|
|
53
|
-
if (
|
|
54
|
-
return
|
|
57
|
+
function me(l) {
|
|
58
|
+
if (l == null || typeof l != "object")
|
|
59
|
+
return l;
|
|
55
60
|
const e = /* @__PURE__ */ new WeakSet(), t = (o) => {
|
|
56
61
|
if (o == null || typeof o != "object")
|
|
57
62
|
return o;
|
|
58
|
-
if (
|
|
63
|
+
if (E(o))
|
|
59
64
|
return t(o.value);
|
|
60
|
-
if (
|
|
61
|
-
return t(
|
|
62
|
-
if (
|
|
63
|
-
return
|
|
65
|
+
if (G(o) || D(o))
|
|
66
|
+
return t(F(o));
|
|
67
|
+
if (he(o))
|
|
68
|
+
return F(o);
|
|
64
69
|
if (Array.isArray(o)) {
|
|
65
|
-
let
|
|
66
|
-
for (let
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
70
|
-
|
|
70
|
+
let r = !1;
|
|
71
|
+
for (let i = 0; i < o.length; i++) {
|
|
72
|
+
const n = o[i];
|
|
73
|
+
if (n !== null && typeof n == "object") {
|
|
74
|
+
if (E(n) || G(n) || D(n)) {
|
|
75
|
+
r = !0;
|
|
71
76
|
break;
|
|
72
77
|
}
|
|
73
|
-
|
|
78
|
+
r = !0;
|
|
74
79
|
break;
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
|
-
return
|
|
82
|
+
return r ? o.map((i) => t(i)) : o;
|
|
78
83
|
}
|
|
79
84
|
if (e.has(o))
|
|
80
85
|
return o;
|
|
81
86
|
e.add(o);
|
|
82
|
-
const
|
|
83
|
-
for (let
|
|
84
|
-
a[
|
|
85
|
-
return
|
|
87
|
+
const a = Object.keys(o), d = {};
|
|
88
|
+
for (let r = 0; r < a.length; r++)
|
|
89
|
+
d[a[r]] = t(o[a[r]]);
|
|
90
|
+
return d;
|
|
86
91
|
};
|
|
87
|
-
return t(
|
|
92
|
+
return t(l);
|
|
88
93
|
}
|
|
89
|
-
const
|
|
94
|
+
const b = class b {
|
|
90
95
|
static getComponentDefinition(e, t) {
|
|
91
96
|
let o;
|
|
92
|
-
return typeof e == "string" ? o = this.searchForComponentInstance(t, e) : o = { extends:
|
|
97
|
+
return typeof e == "string" ? o = this.searchForComponentInstance(t, e) : o = { extends: x({ ...e }) }, o || P.error(`Could not find component with name of ${e}. Is it in Vue.components?`), o.extends ? (o.extends.setup && (o.setup = o.extends.setup), o.extends.props = this.addParamsToProps(o.extends.props)) : o.props = this.addParamsToProps(o.props), o;
|
|
93
98
|
}
|
|
94
99
|
static addParamsToProps(e) {
|
|
95
100
|
return !e || Array.isArray(e) && e.indexOf("params") === -1 ? e = ["params", ...e || []] : typeof e == "object" && !e.params && (e.params = {
|
|
96
101
|
type: Object
|
|
97
102
|
}), e;
|
|
98
103
|
}
|
|
99
|
-
static createAndMountComponent(e, t, o,
|
|
100
|
-
const
|
|
101
|
-
if (!
|
|
104
|
+
static createAndMountComponent(e, t, o, a) {
|
|
105
|
+
const d = b.getComponentDefinition(e, o);
|
|
106
|
+
if (!d)
|
|
102
107
|
return;
|
|
103
|
-
const { vNode:
|
|
104
|
-
|
|
108
|
+
const { vNode: r, destroy: i, el: n } = this.mount(
|
|
109
|
+
d,
|
|
105
110
|
{ params: Object.freeze(t) },
|
|
106
111
|
o,
|
|
107
|
-
|
|
112
|
+
a || {}
|
|
108
113
|
);
|
|
109
114
|
return {
|
|
110
|
-
componentInstance:
|
|
111
|
-
element:
|
|
112
|
-
destroy:
|
|
115
|
+
componentInstance: r.component.proxy,
|
|
116
|
+
element: n,
|
|
117
|
+
destroy: i
|
|
113
118
|
};
|
|
114
119
|
}
|
|
115
|
-
static mount(e, t, o,
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
let
|
|
119
|
-
return
|
|
120
|
-
|
|
121
|
-
}, el:
|
|
120
|
+
static mount(e, t, o, a) {
|
|
121
|
+
let d = J(e, t);
|
|
122
|
+
d.appContext = { ...o.appContext, provides: a };
|
|
123
|
+
let r = document.createDocumentFragment();
|
|
124
|
+
return L(d, r), { vNode: d, destroy: () => {
|
|
125
|
+
r && L(null, r), r = null, d = null;
|
|
126
|
+
}, el: r };
|
|
122
127
|
}
|
|
123
|
-
static searchForComponentInstance(e, t, o = 10,
|
|
124
|
-
let
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
return
|
|
128
|
+
static searchForComponentInstance(e, t, o = 10, a = !1) {
|
|
129
|
+
let d = this.componentCache.get(e);
|
|
130
|
+
if (d) {
|
|
131
|
+
const s = d.get(t);
|
|
132
|
+
if (s !== void 0)
|
|
133
|
+
return s;
|
|
129
134
|
}
|
|
130
|
-
let
|
|
131
|
-
for (; !
|
|
132
|
-
|
|
133
|
-
for (
|
|
134
|
-
const
|
|
135
|
-
|
|
135
|
+
let r = null, i = 0, n = e.parent;
|
|
136
|
+
for (; !r && n && n.components && ++i < o; )
|
|
137
|
+
n.components && n.components[t] && (r = n.components[t]), n = n.parent;
|
|
138
|
+
for (i = 0, n = e.parent; !r && n && n.$options && ++i < o; ) {
|
|
139
|
+
const s = n;
|
|
140
|
+
s.$options && s.$options.components && s.$options.components[t] ? r = s.$options.components[t] : s[t] && (r = s[t]), n = n.parent;
|
|
136
141
|
}
|
|
137
|
-
for (
|
|
138
|
-
if (
|
|
139
|
-
const
|
|
140
|
-
|
|
142
|
+
for (i = 0, n = e.parent; !r && n && ++i < o; ) {
|
|
143
|
+
if (n.exposed) {
|
|
144
|
+
const s = n;
|
|
145
|
+
s.exposed && s.exposed[t] ? r = s.exposed[t] : s[t] && (r = s[t]);
|
|
141
146
|
}
|
|
142
|
-
|
|
147
|
+
n = n.parent;
|
|
143
148
|
}
|
|
144
|
-
if (!
|
|
145
|
-
const
|
|
146
|
-
|
|
149
|
+
if (!r) {
|
|
150
|
+
const s = e.appContext.components;
|
|
151
|
+
s && s[t] && (r = s[t]);
|
|
147
152
|
}
|
|
148
|
-
return !
|
|
153
|
+
return !r && !a ? (P.error(`Could not find component with name of ${t}. Is it in Vue.components?`), null) : (r && (d || (d = /* @__PURE__ */ new Map(), this.componentCache.set(e, d)), d.set(t, r)), r);
|
|
149
154
|
}
|
|
150
155
|
};
|
|
151
156
|
// WeakMap avoids repeat component tree traversals and allows GC of parent components
|
|
152
|
-
|
|
153
|
-
let
|
|
154
|
-
|
|
157
|
+
v(b, "componentCache", /* @__PURE__ */ new WeakMap());
|
|
158
|
+
let C = b;
|
|
159
|
+
const k = Symbol("ag-studio-beans"), j = "initialised";
|
|
160
|
+
class ve extends te {
|
|
155
161
|
constructor(t, o) {
|
|
156
162
|
super();
|
|
157
|
-
|
|
158
|
-
|
|
163
|
+
v(this, "parent");
|
|
164
|
+
v(this, "provides");
|
|
159
165
|
this.parent = t, this.provides = o;
|
|
160
166
|
}
|
|
161
167
|
createWrapper(t) {
|
|
162
|
-
return new
|
|
168
|
+
return new ye(this, t);
|
|
163
169
|
}
|
|
164
170
|
createComponent(t, o) {
|
|
165
|
-
return
|
|
171
|
+
return C.createAndMountComponent(t, o, this.parent, this.provides);
|
|
172
|
+
}
|
|
173
|
+
/** Keeps `provides` private to this class; see `DynamicComponent.wireBeans`. */
|
|
174
|
+
publishBeans(t) {
|
|
175
|
+
this.provides[k] = t;
|
|
166
176
|
}
|
|
167
177
|
destroy() {
|
|
168
178
|
this.parent = null;
|
|
169
179
|
}
|
|
170
180
|
}
|
|
171
|
-
class
|
|
181
|
+
class ye {
|
|
172
182
|
constructor(e, t) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
183
|
+
v(this, "componentInstance");
|
|
184
|
+
v(this, "element");
|
|
185
|
+
v(this, "unmount");
|
|
176
186
|
this.frameworkCompWrapper = e, this.component = t;
|
|
177
187
|
}
|
|
178
188
|
getGui() {
|
|
179
189
|
return this.element;
|
|
180
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Vue has no equivalent of `agInit`: a component's `setup()` has already run by the time an
|
|
193
|
+
* instance exists, so the beans cannot be handed to it. They go onto the provides object every
|
|
194
|
+
* wrapped component is mounted against instead. The studio's bean context calls this before
|
|
195
|
+
* `init`, so they are there before the mount that follows.
|
|
196
|
+
*/
|
|
197
|
+
wireBeans(e) {
|
|
198
|
+
this.frameworkCompWrapper.publishBeans(e);
|
|
199
|
+
}
|
|
181
200
|
init(e) {
|
|
182
201
|
const {
|
|
183
202
|
componentInstance: t,
|
|
184
203
|
element: o,
|
|
185
|
-
destroy:
|
|
204
|
+
destroy: a
|
|
186
205
|
} = this.frameworkCompWrapper.createComponent(this.component, e);
|
|
187
|
-
this.componentInstance = t, this.unmount =
|
|
206
|
+
return this.componentInstance = t, this.unmount = a, this.element = o.firstElementChild ?? o, this.hasMethod(j) ? this.callMethod(j, []) : void 0;
|
|
188
207
|
}
|
|
189
208
|
async refresh(e) {
|
|
190
|
-
|
|
191
|
-
return (o = (t = this.componentInstance).refresh) == null ? void 0 : o.call(t, e);
|
|
209
|
+
return this.hasMethod("refresh") ? this.callMethod("refresh", [e]) : void 0;
|
|
192
210
|
}
|
|
193
211
|
hasMethod(e) {
|
|
194
|
-
var o,
|
|
212
|
+
var o, a;
|
|
195
213
|
const t = this.componentInstance;
|
|
196
|
-
return t[e] ? !0 : ((o = t.$.exposed) == null ? void 0 : o[e]) != null || ((
|
|
214
|
+
return t[e] ? !0 : ((o = t.$.exposed) == null ? void 0 : o[e]) != null || ((a = t.exposed) == null ? void 0 : a[e]) != null || t.$.setupState[e] != null;
|
|
197
215
|
}
|
|
198
216
|
callMethod(e, t) {
|
|
199
|
-
var
|
|
217
|
+
var a, d;
|
|
200
218
|
const o = this.componentInstance;
|
|
201
219
|
if (o[e])
|
|
202
220
|
return o[e](...t);
|
|
203
221
|
{
|
|
204
|
-
const
|
|
205
|
-
return
|
|
222
|
+
const r = ((a = o.$.exposed) == null ? void 0 : a[e]) || ((d = o.exposed) == null ? void 0 : d[e]) || o.$.setupState[e];
|
|
223
|
+
return r == null ? void 0 : r.apply(o, t);
|
|
206
224
|
}
|
|
207
225
|
}
|
|
208
226
|
addMethod(e, t) {
|
|
@@ -219,7 +237,7 @@ class oe {
|
|
|
219
237
|
typeof ((e = this.componentInstance) == null ? void 0 : e.destroy) == "function" && this.componentInstance.destroy(), (t = this.unmount) == null || t.call(this);
|
|
220
238
|
}
|
|
221
239
|
}
|
|
222
|
-
class
|
|
240
|
+
class ge extends oe {
|
|
223
241
|
constructor(e) {
|
|
224
242
|
super("vue"), this.parent = e;
|
|
225
243
|
}
|
|
@@ -228,10 +246,10 @@ class ne extends z {
|
|
|
228
246
|
* if a given component is within that context - this method provides this
|
|
229
247
|
*/
|
|
230
248
|
frameworkComponent(e, t) {
|
|
231
|
-
let o =
|
|
249
|
+
let o = C.searchForComponentInstance(this.parent, e, 10, !0) ? e : null;
|
|
232
250
|
if (!o && t && t[e]) {
|
|
233
|
-
const
|
|
234
|
-
o =
|
|
251
|
+
const a = t[e];
|
|
252
|
+
o = C.searchForComponentInstance(this.parent, a, 10, !0) ? a : null;
|
|
235
253
|
}
|
|
236
254
|
return o;
|
|
237
255
|
}
|
|
@@ -239,9 +257,127 @@ class ne extends z {
|
|
|
239
257
|
return e !== null && typeof e == "object" && !Array.isArray(e);
|
|
240
258
|
}
|
|
241
259
|
}
|
|
242
|
-
const
|
|
260
|
+
const _e = /* @__PURE__ */ x({
|
|
261
|
+
__name: "GridWidget",
|
|
262
|
+
props: {
|
|
263
|
+
params: {}
|
|
264
|
+
},
|
|
265
|
+
setup(l, { expose: e }) {
|
|
266
|
+
const t = l, o = B({}), a = R("eRoot"), d = y(), r = $(k, void 0);
|
|
267
|
+
let i, n, s;
|
|
268
|
+
A(() => {
|
|
269
|
+
const f = a.value;
|
|
270
|
+
if (!r || !f) {
|
|
271
|
+
P.error("GridWidget can only be used as the component of a studio grid widget.");
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
i = new re({
|
|
275
|
+
beans: r,
|
|
276
|
+
createGrid: (u) => new Promise((h) => {
|
|
277
|
+
s = () => h(void 0), d.value = {
|
|
278
|
+
...u,
|
|
279
|
+
onGridReady: (c) => {
|
|
280
|
+
var p;
|
|
281
|
+
s = void 0;
|
|
282
|
+
try {
|
|
283
|
+
(p = u.onGridReady) == null || p.call(u, c);
|
|
284
|
+
} finally {
|
|
285
|
+
h(c.api);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
}),
|
|
290
|
+
setCssProperties: (u) => {
|
|
291
|
+
o.value = u;
|
|
292
|
+
},
|
|
293
|
+
getWidth: () => f.offsetWidth
|
|
294
|
+
}), n = i.init(t.params);
|
|
295
|
+
}), T(() => {
|
|
296
|
+
s == null || s(), s = void 0, i == null || i.destroy(), i = void 0;
|
|
297
|
+
});
|
|
298
|
+
function g() {
|
|
299
|
+
return n;
|
|
300
|
+
}
|
|
301
|
+
function _(f) {
|
|
302
|
+
return i == null ? void 0 : i.refresh(f);
|
|
303
|
+
}
|
|
304
|
+
return e({ initialised: g, refresh: _ }), (f, u) => (w(), O("div", {
|
|
305
|
+
ref_key: "eRoot",
|
|
306
|
+
ref: a,
|
|
307
|
+
class: "ag-studio-grid-widget",
|
|
308
|
+
style: V(o.value)
|
|
309
|
+
}, [
|
|
310
|
+
d.value ? (w(), N(I(H), {
|
|
311
|
+
key: 0,
|
|
312
|
+
style: { width: "100%", height: "100%" },
|
|
313
|
+
gridOptions: d.value,
|
|
314
|
+
modules: I(z)
|
|
315
|
+
}, null, 8, ["gridOptions", "modules"])) : U("", !0)
|
|
316
|
+
], 4));
|
|
317
|
+
}
|
|
318
|
+
}), we = /* @__PURE__ */ x({
|
|
319
|
+
__name: "PivotGridWidget",
|
|
320
|
+
props: {
|
|
321
|
+
params: {}
|
|
322
|
+
},
|
|
323
|
+
setup(l, { expose: e }) {
|
|
324
|
+
const t = l, o = B({}), a = R("eRoot"), d = y(), r = $(k, void 0);
|
|
325
|
+
let i, n, s;
|
|
326
|
+
A(() => {
|
|
327
|
+
const f = a.value;
|
|
328
|
+
if (!r || !f) {
|
|
329
|
+
P.error("PivotGridWidget can only be used as the component of a studio pivot grid widget.");
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
i = new ne({
|
|
333
|
+
beans: r,
|
|
334
|
+
createGrid: (u) => new Promise((h) => {
|
|
335
|
+
s = () => h(void 0), d.value = {
|
|
336
|
+
...u,
|
|
337
|
+
onGridReady: (c) => {
|
|
338
|
+
var p;
|
|
339
|
+
s = void 0;
|
|
340
|
+
try {
|
|
341
|
+
(p = u.onGridReady) == null || p.call(u, c);
|
|
342
|
+
} finally {
|
|
343
|
+
h(c.api);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
}),
|
|
348
|
+
setCssProperties: (u) => {
|
|
349
|
+
o.value = u;
|
|
350
|
+
}
|
|
351
|
+
}), n = i.init(t.params);
|
|
352
|
+
}), T(() => {
|
|
353
|
+
s == null || s(), s = void 0, i == null || i.destroy(), i = void 0;
|
|
354
|
+
});
|
|
355
|
+
function g() {
|
|
356
|
+
return n;
|
|
357
|
+
}
|
|
358
|
+
function _(f) {
|
|
359
|
+
return i == null ? void 0 : i.refresh(f);
|
|
360
|
+
}
|
|
361
|
+
return e({ initialised: g, refresh: _ }), (f, u) => (w(), O("div", {
|
|
362
|
+
ref_key: "eRoot",
|
|
363
|
+
ref: a,
|
|
364
|
+
class: "ag-studio-pivot-grid-widget",
|
|
365
|
+
style: V(o.value)
|
|
366
|
+
}, [
|
|
367
|
+
d.value ? (w(), N(I(H), {
|
|
368
|
+
key: 0,
|
|
369
|
+
style: { width: "100%", height: "100%" },
|
|
370
|
+
gridOptions: d.value,
|
|
371
|
+
modules: I(z)
|
|
372
|
+
}, null, 8, ["gridOptions", "modules"])) : U("", !0)
|
|
373
|
+
], 4));
|
|
374
|
+
}
|
|
375
|
+
}), K = se({
|
|
376
|
+
grid: _e,
|
|
377
|
+
"pivot-grid": we
|
|
378
|
+
}), Ce = { ref: "root" }, Se = /* @__PURE__ */ x({
|
|
243
379
|
__name: "AgStudio",
|
|
244
|
-
props: /* @__PURE__ */
|
|
380
|
+
props: /* @__PURE__ */ Q({
|
|
245
381
|
studioProperties: {},
|
|
246
382
|
modules: {},
|
|
247
383
|
tabIndex: {},
|
|
@@ -254,6 +390,7 @@ const re = { ref: "root" }, ce = /* @__PURE__ */ b({
|
|
|
254
390
|
themeStyleContainer: { type: Function },
|
|
255
391
|
getDocument: { type: Function },
|
|
256
392
|
suppressTouch: { type: Boolean },
|
|
393
|
+
suppressKeyboard: {},
|
|
257
394
|
localeText: {},
|
|
258
395
|
aiText: {},
|
|
259
396
|
getLocaleText: { type: Function },
|
|
@@ -262,8 +399,11 @@ const re = { ref: "root" }, ce = /* @__PURE__ */ b({
|
|
|
262
399
|
initialState: {},
|
|
263
400
|
data: {},
|
|
264
401
|
mode: {},
|
|
402
|
+
history: {},
|
|
403
|
+
enableFilterEditingInViewMode: { type: Boolean },
|
|
265
404
|
layout: {},
|
|
266
|
-
ai: {},
|
|
405
|
+
ai: { type: [Object, Function] },
|
|
406
|
+
aiToolDisplay: {},
|
|
267
407
|
dataOptions: {},
|
|
268
408
|
panels: {},
|
|
269
409
|
page: { type: [Object, Function] },
|
|
@@ -275,58 +415,65 @@ const re = { ref: "root" }, ce = /* @__PURE__ */ b({
|
|
|
275
415
|
"onRender-state-changed": {},
|
|
276
416
|
"onStudio-pre-destroyed": {},
|
|
277
417
|
"onError-raised": {}
|
|
278
|
-
},
|
|
279
|
-
setup(
|
|
280
|
-
const t =
|
|
281
|
-
let
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
(
|
|
288
|
-
|
|
418
|
+
}, fe()),
|
|
419
|
+
setup(l, { expose: e }) {
|
|
420
|
+
const t = l, o = R("root"), a = y(void 0), d = y(!1), r = y(!1), i = y(!1);
|
|
421
|
+
let n = {}, s = !1;
|
|
422
|
+
const g = X(t), _ = new Set(ie());
|
|
423
|
+
M().filter((c) => c != "studioProperties").forEach((c) => {
|
|
424
|
+
const p = g[c];
|
|
425
|
+
p && Z(
|
|
426
|
+
p,
|
|
427
|
+
(m, W) => {
|
|
428
|
+
u(c, m);
|
|
289
429
|
},
|
|
290
|
-
|
|
430
|
+
_.has(c) ? void 0 : { deep: !0 }
|
|
291
431
|
);
|
|
292
432
|
});
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
433
|
+
const f = (c) => (p) => {
|
|
434
|
+
if (r.value)
|
|
295
435
|
return;
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
},
|
|
299
|
-
if (
|
|
300
|
-
let
|
|
301
|
-
|
|
302
|
-
|
|
436
|
+
p === "apiReady" && (i.value = !0);
|
|
437
|
+
const m = ue.has(p);
|
|
438
|
+
}, u = (c, p, m) => {
|
|
439
|
+
if (d.value) {
|
|
440
|
+
let W = p;
|
|
441
|
+
n[c] = W, s || (s = !0, queueMicrotask(() => {
|
|
442
|
+
s = !1, !r.value && a.value && ae(n, a.value), n = {};
|
|
303
443
|
}));
|
|
304
444
|
}
|
|
305
|
-
},
|
|
306
|
-
return
|
|
307
|
-
const
|
|
308
|
-
globalListener:
|
|
309
|
-
globalSyncListener:
|
|
310
|
-
frameworkOverrides: new
|
|
445
|
+
}, h = () => Object.create(S().provides);
|
|
446
|
+
return A(() => {
|
|
447
|
+
const c = new ve(S(), h()), p = {
|
|
448
|
+
globalListener: f(),
|
|
449
|
+
globalSyncListener: f(!0),
|
|
450
|
+
frameworkOverrides: new ge(S()),
|
|
311
451
|
providedBeanInstances: {
|
|
312
|
-
frameworkCompWrapper:
|
|
452
|
+
frameworkCompWrapper: c,
|
|
453
|
+
widgetDefaults: K
|
|
313
454
|
},
|
|
314
455
|
modules: t.modules
|
|
315
|
-
},
|
|
316
|
-
|
|
317
|
-
...
|
|
318
|
-
...Object.values(
|
|
456
|
+
}, m = ee(
|
|
457
|
+
de(me(t.studioProperties), t, [
|
|
458
|
+
...M(),
|
|
459
|
+
...Object.values(le)
|
|
319
460
|
])
|
|
320
461
|
);
|
|
321
|
-
|
|
322
|
-
}),
|
|
323
|
-
var
|
|
324
|
-
|
|
462
|
+
a.value = ce(o.value, m, p), d.value = !0;
|
|
463
|
+
}), T(() => {
|
|
464
|
+
var c;
|
|
465
|
+
d.value && ((c = a == null ? void 0 : a.value) == null || c.destroy(), r.value = !0);
|
|
325
466
|
}), e({
|
|
326
|
-
api:
|
|
327
|
-
}), (
|
|
467
|
+
api: a
|
|
468
|
+
}), (c, p) => (w(), O("div", Ce, null, 512));
|
|
328
469
|
}
|
|
329
470
|
});
|
|
471
|
+
function Re(l) {
|
|
472
|
+
return pe(l, K);
|
|
473
|
+
}
|
|
330
474
|
export {
|
|
331
|
-
|
|
475
|
+
Se as AgStudio,
|
|
476
|
+
_e as GridWidget,
|
|
477
|
+
we as PivotGridWidget,
|
|
478
|
+
Re as createWidgets
|
|
332
479
|
};
|
package/dist/main.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("ag-studio")):typeof define=="function"&&define.amd?define(["exports","vue","ag-studio"],n):(f=typeof globalThis<"u"?globalThis:f||self,n(f.AgStudio={},f.Vue,f.agStudio))})(this,function(f,n,d){"use strict";var L=Object.defineProperty;var F=(f,n,d)=>n in f?L(f,n,{enumerable:!0,configurable:!0,writable:!0,value:d}):f[n]=d;var y=(f,n,d)=>F(f,typeof n!="symbol"?n+"":n,d);function x(){return{studioProperties:{},tabIndex:void 0,enableRtl:void 0,popupParent:void 0,theme:void 0,loadThemeGoogleFonts:void 0,themeCssLayer:void 0,styleNonce:void 0,themeStyleContainer:void 0,getDocument:void 0,suppressTouch:void 0,localeText:void 0,aiText:void 0,getLocaleText:void 0,studioId:void 0,context:void 0,initialState:void 0,data:void 0,mode:void 0,layout:void 0,ai:void 0,dataOptions:void 0,panels:void 0,page:void 0,widgets:void 0,components:void 0,"onState-updated":void 0,"onApi-ready":void 0,"onStudio-ready":void 0,"onRender-state-changed":void 0,"onStudio-pre-destroyed":void 0,"onError-raised":void 0}}function g(u){if(!u||typeof u!="object"||Array.isArray(u))return!1;const e=Object.getPrototypeOf(u);return e!==null&&e!==Object.prototype}function P(u){if(u==null||typeof u!="object")return u;const e=new WeakSet,o=t=>{if(t==null||typeof t!="object")return t;if(n.isRef(t))return o(t.value);if(n.isReactive(t)||n.isProxy(t))return o(n.toRaw(t));if(g(t))return n.toRaw(t);if(Array.isArray(t)){let r=!1;for(let l=0;l<t.length;l++){const s=t[l];if(s!==null&&typeof s=="object"){if(n.isRef(s)||n.isReactive(s)||n.isProxy(s)){r=!0;break}r=!0;break}}return r?t.map(l=>o(l)):t}if(e.has(t))return t;e.add(t);const i=Object.keys(t),a={};for(let r=0;r<i.length;r++)a[i[r]]=o(t[i[r]]);return a};return o(u)}const v=class v{static getComponentDefinition(e,o){let t;return typeof e=="string"?t=this.searchForComponentInstance(o,e):t={extends:n.defineComponent({...e})},t||d._AgLogger.error(`Could not find component with name of ${e}. Is it in Vue.components?`),t.extends?(t.extends.setup&&(t.setup=t.extends.setup),t.extends.props=this.addParamsToProps(t.extends.props)):t.props=this.addParamsToProps(t.props),t}static addParamsToProps(e){return!e||Array.isArray(e)&&e.indexOf("params")===-1?e=["params",...e||[]]:typeof e=="object"&&!e.params&&(e.params={type:Object}),e}static createAndMountComponent(e,o,t,i){const a=v.getComponentDefinition(e,t);if(!a)return;const{vNode:r,destroy:l,el:s}=this.mount(a,{params:Object.freeze(o)},t,i||{});return{componentInstance:r.component.proxy,element:s,destroy:l}}static mount(e,o,t,i){let a=n.createVNode(e,o);a.appContext={...t.appContext,provides:i};let r=document.createDocumentFragment();return n.render(a,r),{vNode:a,destroy:()=>{r&&n.render(null,r),r=null,a=null},el:r}}static searchForComponentInstance(e,o,t=10,i=!1){let a=this.componentCache.get(e);if(a){const c=a.get(o);if(c!==void 0)return c}let r=null,l=0,s=e.parent;for(;!r&&s&&s.components&&++l<t;)s.components&&s.components[o]&&(r=s.components[o]),s=s.parent;for(l=0,s=e.parent;!r&&s&&s.$options&&++l<t;){const c=s;c.$options&&c.$options.components&&c.$options.components[o]?r=c.$options.components[o]:c[o]&&(r=c[o]),s=s.parent}for(l=0,s=e.parent;!r&&s&&++l<t;){if(s.exposed){const c=s;c.exposed&&c.exposed[o]?r=c.exposed[o]:c[o]&&(r=c[o])}s=s.parent}if(!r){const c=e.appContext.components;c&&c[o]&&(r=c[o])}return!r&&!i?(d._AgLogger.error(`Could not find component with name of ${o}. Is it in Vue.components?`),null):(r&&(a||(a=new Map,this.componentCache.set(e,a)),a.set(o,r)),r)}};y(v,"componentCache",new WeakMap);let C=v;class _ extends d._BaseComponentWrapper{constructor(o,t){super();y(this,"parent");y(this,"provides");this.parent=o,this.provides=t}createWrapper(o){return new A(this,o)}createComponent(o,t){return C.createAndMountComponent(o,t,this.parent,this.provides)}destroy(){this.parent=null}}class A{constructor(e,o){y(this,"componentInstance");y(this,"element");y(this,"unmount");this.frameworkCompWrapper=e,this.component=o}getGui(){return this.element}init(e){const{componentInstance:o,element:t,destroy:i}=this.frameworkCompWrapper.createComponent(this.component,e);this.componentInstance=o,this.unmount=i,this.element=t.firstElementChild??t}async refresh(e){var o,t;return(t=(o=this.componentInstance).refresh)==null?void 0:t.call(o,e)}hasMethod(e){var t,i;const o=this.componentInstance;return o[e]?!0:((t=o.$.exposed)==null?void 0:t[e])!=null||((i=o.exposed)==null?void 0:i[e])!=null||o.$.setupState[e]!=null}callMethod(e,o){var i,a;const t=this.componentInstance;if(t[e])return t[e](...o);{const r=((i=t.$.exposed)==null?void 0:i[e])||((a=t.exposed)==null?void 0:a[e])||t.$.setupState[e];return r==null?void 0:r.apply(t,o)}}addMethod(e,o){this[e]=o}processMethod(e,o){return e==="refresh"&&(this.componentInstance.params=Object.freeze(o[0])),this.hasMethod(e)?this.callMethod(e,o):e==="refresh"}getFrameworkComponentInstance(){return this.componentInstance}destroy(){var e,o;typeof((e=this.componentInstance)==null?void 0:e.destroy)=="function"&&this.componentInstance.destroy(),(o=this.unmount)==null||o.call(this)}}class R extends d._VanillaFrameworkOverrides{constructor(e){super("vue"),this.parent=e}frameworkComponent(e,o){let t=C.searchForComponentInstance(this.parent,e,10,!0)?e:null;if(!t&&o&&o[e]){const i=o[e];t=C.searchForComponentInstance(this.parent,i,10,!0)?i:null}return t}isFrameworkComponent(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}}const T={ref:"root"},b=n.defineComponent({__name:"AgStudio",props:n.mergeDefaults({studioProperties:{},modules:{},tabIndex:{},enableRtl:{type:Boolean},popupParent:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{type:Function},getDocument:{type:Function},suppressTouch:{type:Boolean},localeText:{},aiText:{},getLocaleText:{type:Function},studioId:{},context:{},initialState:{},data:{},mode:{},layout:{},ai:{},dataOptions:{},panels:{},page:{type:[Object,Function]},widgets:{type:[Object,Function]},components:{},"onState-updated":{},"onApi-ready":{},"onStudio-ready":{},"onRender-state-changed":{},"onStudio-pre-destroyed":{},"onError-raised":{}},x()),setup(u,{expose:e}){const o=u,t=n.useTemplateRef("root"),i=n.shallowRef(void 0),a=n.shallowRef(!1),r=n.shallowRef(!1),l=n.shallowRef(!1);let s={},c=!1;const S=n.toRefs(o),O=new Set(d._GET_SHALLOW_STUDIO_PROPERTIES());d._GET_ALL_STUDIO_PROPERTIES().filter(p=>p!="studioProperties").forEach(p=>{const h=S[p];h&&n.watch(h,(m,I)=>{k(p,m)},O.has(p)?void 0:{deep:!0})});const w=p=>h=>{if(r.value)return;h==="apiReady"&&(l.value=!0);const m=d._ALWAYS_SYNC_GLOBAL_EVENTS.has(h)},k=(p,h,m)=>{if(a.value){let I=h;s[p]=I,c||(c=!0,queueMicrotask(()=>{c=!1,!r.value&&i.value&&d._processPropertyChanges(s,i.value),s={}}))}},E=()=>Object.create(n.getCurrentInstance().provides);return n.onMounted(()=>{const p=new _(n.getCurrentInstance(),E()),h={globalListener:w(),globalSyncListener:w(!0),frameworkOverrides:new R(n.getCurrentInstance()),providedBeanInstances:{frameworkCompWrapper:p},modules:o.modules},m=n.markRaw(d._combineAttributesAndStudioProperties(P(o.studioProperties),o,[...d._GET_ALL_STUDIO_PROPERTIES(),...Object.values(d._PUBLIC_EVENT_HANDLERS_MAP)]));i.value=d._createStudio(t.value,m,h),a.value=!0}),n.onUnmounted(()=>{var p;a.value&&((p=i==null?void 0:i.value)==null||p.destroy(),r.value=!0)}),e({api:i}),(p,h)=>(n.openBlock(),n.createElementBlock("div",T,null,512))}});f.AgStudio=b,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(u,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("ag-studio"),require("ag-grid-vue3")):typeof define=="function"&&define.amd?define(["exports","vue","ag-studio","ag-grid-vue3"],o):(u=typeof globalThis<"u"?globalThis:u||self,o(u.AgStudio={},u.Vue,u.agStudio,u.agGridVue3))})(this,function(u,o,c,b){"use strict";var j=Object.defineProperty;var V=(u,o,c)=>o in u?j(u,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):u[o]=c;var w=(u,o,c)=>V(u,typeof o!="symbol"?o+"":o,c);function E(){return{studioProperties:{},tabIndex:void 0,enableRtl:void 0,popupParent:void 0,theme:void 0,loadThemeGoogleFonts:void 0,themeCssLayer:void 0,styleNonce:void 0,themeStyleContainer:void 0,getDocument:void 0,suppressTouch:void 0,suppressKeyboard:void 0,localeText:void 0,aiText:void 0,getLocaleText:void 0,studioId:void 0,context:void 0,initialState:void 0,data:void 0,mode:void 0,history:void 0,enableFilterEditingInViewMode:void 0,layout:void 0,ai:void 0,aiToolDisplay:void 0,dataOptions:void 0,panels:void 0,page:void 0,widgets:void 0,components:void 0,"onState-updated":void 0,"onApi-ready":void 0,"onStudio-ready":void 0,"onRender-state-changed":void 0,"onStudio-pre-destroyed":void 0,"onError-raised":void 0}}function G(f){if(!f||typeof f!="object"||Array.isArray(f))return!1;const e=Object.getPrototypeOf(f);return e!==null&&e!==Object.prototype}function S(f){if(f==null||typeof f!="object")return f;const e=new WeakSet,n=t=>{if(t==null||typeof t!="object")return t;if(o.isRef(t))return n(t.value);if(o.isReactive(t)||o.isProxy(t))return n(o.toRaw(t));if(G(t))return o.toRaw(t);if(Array.isArray(t)){let r=!1;for(let a=0;a<t.length;a++){const s=t[a];if(s!==null&&typeof s=="object"){if(o.isRef(s)||o.isReactive(s)||o.isProxy(s)){r=!0;break}r=!0;break}}return r?t.map(a=>n(a)):t}if(e.has(t))return t;e.add(t);const d=Object.keys(t),l={};for(let r=0;r<d.length;r++)l[d[r]]=n(t[d[r]]);return l};return n(f)}const R=class R{static getComponentDefinition(e,n){let t;return typeof e=="string"?t=this.searchForComponentInstance(n,e):t={extends:o.defineComponent({...e})},t||c._AgLogger.error(`Could not find component with name of ${e}. Is it in Vue.components?`),t.extends?(t.extends.setup&&(t.setup=t.extends.setup),t.extends.props=this.addParamsToProps(t.extends.props)):t.props=this.addParamsToProps(t.props),t}static addParamsToProps(e){return!e||Array.isArray(e)&&e.indexOf("params")===-1?e=["params",...e||[]]:typeof e=="object"&&!e.params&&(e.params={type:Object}),e}static createAndMountComponent(e,n,t,d){const l=R.getComponentDefinition(e,t);if(!l)return;const{vNode:r,destroy:a,el:s}=this.mount(l,{params:Object.freeze(n)},t,d||{});return{componentInstance:r.component.proxy,element:s,destroy:a}}static mount(e,n,t,d){let l=o.createVNode(e,n);l.appContext={...t.appContext,provides:d};let r=document.createDocumentFragment();return o.render(l,r),{vNode:l,destroy:()=>{r&&o.render(null,r),r=null,l=null},el:r}}static searchForComponentInstance(e,n,t=10,d=!1){let l=this.componentCache.get(e);if(l){const i=l.get(n);if(i!==void 0)return i}let r=null,a=0,s=e.parent;for(;!r&&s&&s.components&&++a<t;)s.components&&s.components[n]&&(r=s.components[n]),s=s.parent;for(a=0,s=e.parent;!r&&s&&s.$options&&++a<t;){const i=s;i.$options&&i.$options.components&&i.$options.components[n]?r=i.$options.components[n]:i[n]&&(r=i[n]),s=s.parent}for(a=0,s=e.parent;!r&&s&&++a<t;){if(s.exposed){const i=s;i.exposed&&i.exposed[n]?r=i.exposed[n]:i[n]&&(r=i[n])}s=s.parent}if(!r){const i=e.appContext.components;i&&i[n]&&(r=i[n])}return!r&&!d?(c._AgLogger.error(`Could not find component with name of ${n}. Is it in Vue.components?`),null):(r&&(l||(l=new Map,this.componentCache.set(e,l)),l.set(n,r)),r)}};w(R,"componentCache",new WeakMap);let C=R;const P=Symbol("ag-studio-beans"),T="initialised";class W extends c._BaseComponentWrapper{constructor(n,t){super();w(this,"parent");w(this,"provides");this.parent=n,this.provides=t}createWrapper(n){return new D(this,n)}createComponent(n,t){return C.createAndMountComponent(n,t,this.parent,this.provides)}publishBeans(n){this.provides[P]=n}destroy(){this.parent=null}}class D{constructor(e,n){w(this,"componentInstance");w(this,"element");w(this,"unmount");this.frameworkCompWrapper=e,this.component=n}getGui(){return this.element}wireBeans(e){this.frameworkCompWrapper.publishBeans(e)}init(e){const{componentInstance:n,element:t,destroy:d}=this.frameworkCompWrapper.createComponent(this.component,e);return this.componentInstance=n,this.unmount=d,this.element=t.firstElementChild??t,this.hasMethod(T)?this.callMethod(T,[]):void 0}async refresh(e){return this.hasMethod("refresh")?this.callMethod("refresh",[e]):void 0}hasMethod(e){var t,d;const n=this.componentInstance;return n[e]?!0:((t=n.$.exposed)==null?void 0:t[e])!=null||((d=n.exposed)==null?void 0:d[e])!=null||n.$.setupState[e]!=null}callMethod(e,n){var d,l;const t=this.componentInstance;if(t[e])return t[e](...n);{const r=((d=t.$.exposed)==null?void 0:d[e])||((l=t.exposed)==null?void 0:l[e])||t.$.setupState[e];return r==null?void 0:r.apply(t,n)}}addMethod(e,n){this[e]=n}processMethod(e,n){return e==="refresh"&&(this.componentInstance.params=Object.freeze(n[0])),this.hasMethod(e)?this.callMethod(e,n):e==="refresh"}getFrameworkComponentInstance(){return this.componentInstance}destroy(){var e,n;typeof((e=this.componentInstance)==null?void 0:e.destroy)=="function"&&this.componentInstance.destroy(),(n=this.unmount)==null||n.call(this)}}class L extends c._VanillaFrameworkOverrides{constructor(e){super("vue"),this.parent=e}frameworkComponent(e,n){let t=C.searchForComponentInstance(this.parent,e,10,!0)?e:null;if(!t&&n&&n[e]){const d=n[e];t=C.searchForComponentInstance(this.parent,d,10,!0)?d:null}return t}isFrameworkComponent(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}}const A=o.defineComponent({__name:"GridWidget",props:{params:{}},setup(f,{expose:e}){const n=f,t=o.ref({}),d=o.useTemplateRef("eRoot"),l=o.shallowRef(),r=o.inject(P,void 0);let a,s,i;o.onMounted(()=>{const y=d.value;if(!r||!y){c._AgLogger.error("GridWidget can only be used as the component of a studio grid widget.");return}a=new c._GridWidgetCore({beans:r,createGrid:h=>new Promise(g=>{i=()=>g(void 0),l.value={...h,onGridReady:p=>{var m;i=void 0;try{(m=h.onGridReady)==null||m.call(h,p)}finally{g(p.api)}}}}),setCssProperties:h=>{t.value=h},getWidth:()=>y.offsetWidth}),s=a.init(n.params)}),o.onUnmounted(()=>{i==null||i(),i=void 0,a==null||a.destroy(),a=void 0});function I(){return s}function v(y){return a==null?void 0:a.refresh(y)}return e({initialised:I,refresh:v}),(y,h)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"eRoot",ref:d,class:"ag-studio-grid-widget",style:o.normalizeStyle(t.value)},[l.value?(o.openBlock(),o.createBlock(o.unref(b.AgGridVue),{key:0,style:{width:"100%",height:"100%"},gridOptions:l.value,modules:o.unref(c._STUDIO_GRID_MODULES)},null,8,["gridOptions","modules"])):o.createCommentVNode("",!0)],4))}}),x=o.defineComponent({__name:"PivotGridWidget",props:{params:{}},setup(f,{expose:e}){const n=f,t=o.ref({}),d=o.useTemplateRef("eRoot"),l=o.shallowRef(),r=o.inject(P,void 0);let a,s,i;o.onMounted(()=>{const y=d.value;if(!r||!y){c._AgLogger.error("PivotGridWidget can only be used as the component of a studio pivot grid widget.");return}a=new c._PivotGridWidgetCore({beans:r,createGrid:h=>new Promise(g=>{i=()=>g(void 0),l.value={...h,onGridReady:p=>{var m;i=void 0;try{(m=h.onGridReady)==null||m.call(h,p)}finally{g(p.api)}}}}),setCssProperties:h=>{t.value=h}}),s=a.init(n.params)}),o.onUnmounted(()=>{i==null||i(),i=void 0,a==null||a.destroy(),a=void 0});function I(){return s}function v(y){return a==null?void 0:a.refresh(y)}return e({initialised:I,refresh:v}),(y,h)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"eRoot",ref:d,class:"ag-studio-pivot-grid-widget",style:o.normalizeStyle(t.value)},[l.value?(o.openBlock(),o.createBlock(o.unref(b.AgGridVue),{key:0,style:{width:"100%",height:"100%"},gridOptions:l.value,modules:o.unref(c._STUDIO_GRID_MODULES)},null,8,["gridOptions","modules"])):o.createCommentVNode("",!0)],4))}}),k=c._createWidgetDefaults({grid:A,"pivot-grid":x}),M={ref:"root"},B=o.defineComponent({__name:"AgStudio",props:o.mergeDefaults({studioProperties:{},modules:{},tabIndex:{},enableRtl:{type:Boolean},popupParent:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{type:Function},getDocument:{type:Function},suppressTouch:{type:Boolean},suppressKeyboard:{},localeText:{},aiText:{},getLocaleText:{type:Function},studioId:{},context:{},initialState:{},data:{},mode:{},history:{},enableFilterEditingInViewMode:{type:Boolean},layout:{},ai:{type:[Object,Function]},aiToolDisplay:{},dataOptions:{},panels:{},page:{type:[Object,Function]},widgets:{type:[Object,Function]},components:{},"onState-updated":{},"onApi-ready":{},"onStudio-ready":{},"onRender-state-changed":{},"onStudio-pre-destroyed":{},"onError-raised":{}},E()),setup(f,{expose:e}){const n=f,t=o.useTemplateRef("root"),d=o.shallowRef(void 0),l=o.shallowRef(!1),r=o.shallowRef(!1),a=o.shallowRef(!1);let s={},i=!1;const I=o.toRefs(n),v=new Set(c._GET_SHALLOW_STUDIO_PROPERTIES());c._GET_ALL_STUDIO_PROPERTIES().filter(p=>p!="studioProperties").forEach(p=>{const m=I[p];m&&o.watch(m,(_,O)=>{h(p,_)},v.has(p)?void 0:{deep:!0})});const y=p=>m=>{if(r.value)return;m==="apiReady"&&(a.value=!0);const _=c._ALWAYS_SYNC_GLOBAL_EVENTS.has(m)},h=(p,m,_)=>{if(l.value){let O=m;s[p]=O,i||(i=!0,queueMicrotask(()=>{i=!1,!r.value&&d.value&&c._processPropertyChanges(s,d.value),s={}}))}},g=()=>Object.create(o.getCurrentInstance().provides);return o.onMounted(()=>{const p=new W(o.getCurrentInstance(),g()),m={globalListener:y(),globalSyncListener:y(!0),frameworkOverrides:new L(o.getCurrentInstance()),providedBeanInstances:{frameworkCompWrapper:p,widgetDefaults:k},modules:n.modules},_=o.markRaw(c._combineAttributesAndStudioProperties(S(n.studioProperties),n,[...c._GET_ALL_STUDIO_PROPERTIES(),...Object.values(c._PUBLIC_EVENT_HANDLERS_MAP)]));d.value=c._createStudio(t.value,_,m),l.value=!0}),o.onUnmounted(()=>{var p;l.value&&((p=d==null?void 0:d.value)==null||p.destroy(),r.value=!0)}),e({api:d}),(p,m)=>(o.openBlock(),o.createElementBlock("div",M,null,512))}});function F(f){return c._createWidgets(f,k)}u.AgStudio=B,u.GridWidget=A,u.PivotGridWidget=x,u.createWidgets=F,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -13,7 +13,7 @@ declare const __VLS_export: <TRegistry extends AgRegistry = AgDefaultRegistry>(_
|
|
|
13
13
|
slots: {};
|
|
14
14
|
emit: {};
|
|
15
15
|
}>) => import("vue").VNode & {
|
|
16
|
-
__ctx?: Awaited<typeof __VLS_setup
|
|
16
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
17
17
|
};
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
19
19
|
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgGridWidget, AgWidgetParams } from 'ag-studio';
|
|
2
|
+
import type { AgGridWidgetOptions } from './interfaces';
|
|
3
|
+
type GridWidgetParams = AgWidgetParams<AgGridWidget, AgGridWidgetOptions>;
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
params: GridWidgetParams;
|
|
6
|
+
};
|
|
7
|
+
declare function initialised(): Promise<void> | undefined;
|
|
8
|
+
declare function refresh(params: GridWidgetParams): Promise<void> | undefined;
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
initialised: typeof initialised;
|
|
11
|
+
refresh: typeof refresh;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgPivotGridWidget, AgWidgetParams } from 'ag-studio';
|
|
2
|
+
import type { AgPivotGridWidgetOptions } from './interfaces';
|
|
3
|
+
type PivotGridWidgetParams = AgWidgetParams<AgPivotGridWidget, AgPivotGridWidgetOptions>;
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
params: PivotGridWidgetParams;
|
|
6
|
+
};
|
|
7
|
+
declare function initialised(): Promise<void> | undefined;
|
|
8
|
+
declare function refresh(params: PivotGridWidgetParams): Promise<void> | undefined;
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
initialised: typeof initialised;
|
|
11
|
+
refresh: typeof refresh;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { _BaseComponentWrapper } from 'ag-studio';
|
|
2
|
-
import type { _WrappableInterface } from 'ag-studio';
|
|
2
|
+
import type { _BeanCollection, _WrappableInterface } from 'ag-studio';
|
|
3
3
|
interface VueWrappableInterface extends _WrappableInterface {
|
|
4
4
|
processMethod(methodName: string, args: IArguments): any;
|
|
5
|
+
/** Required here, though optional on `_WrappableInterface`, so it cannot be dropped silently. */
|
|
6
|
+
wireBeans(beans: _BeanCollection): void;
|
|
5
7
|
}
|
|
6
8
|
export declare class VueFrameworkComponentWrapper extends _BaseComponentWrapper<VueWrappableInterface> {
|
|
7
9
|
private parent;
|
|
8
10
|
private readonly provides;
|
|
9
|
-
constructor(parent: any, provides
|
|
11
|
+
constructor(parent: any, provides: any);
|
|
10
12
|
protected createWrapper(component: any): VueWrappableInterface;
|
|
11
13
|
createComponent(component: any, params: any): any;
|
|
14
|
+
/** Keeps `provides` private to this class; see `DynamicComponent.wireBeans`. */
|
|
15
|
+
publishBeans(beans: _BeanCollection): void;
|
|
12
16
|
protected destroy(): void;
|
|
13
17
|
}
|
|
14
18
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgBaseRegistry, AgBaseWidgetDefinition, AgDefaultWidgetType, AgTypeScriptComponent, AgWidgetData, AgWidgetDataFormat, AgWidgetParams, AgWidgetRegistry } from 'ag-studio';
|
|
1
|
+
import type { AgAiToolDetailParams, AgBaseAiToolDisplay, AgBaseRegistry, AgBaseWidgetDefinition, AgGridWidgetOptions as AgCoreGridWidgetOptions, AgPivotGridWidgetOptions as AgCorePivotGridWidgetOptions, AgDefaultWidgetType, AgTypeScriptComponent, AgWidgetData, AgWidgetDataFormat, AgWidgetField, AgWidgetParams, AgWidgetRegistry } from 'ag-studio';
|
|
2
2
|
import type { Component } from 'vue';
|
|
3
3
|
export interface AgWidgetDefinition<TWidgetType extends string = string, TIn extends AgWidgetData<unknown, AgWidgetDataFormat<unknown>> = any, TOut extends AgWidgetData<unknown, AgWidgetDataFormat<unknown>> = TIn, TOptions = unknown> extends AgBaseWidgetDefinition<TWidgetType, TIn, TOut, TOptions> {
|
|
4
4
|
/**
|
|
@@ -21,5 +21,47 @@ export type AgCustomComponentDefs<TRegistry extends AgBaseRegistry> = {
|
|
|
21
21
|
export interface AgRegistry extends AgBaseRegistry {
|
|
22
22
|
widgets: readonly AgWidgetDefinition[];
|
|
23
23
|
components: AgCustomComponentDefs<this>;
|
|
24
|
+
aiToolDisplay: AgAiToolDisplay;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Grid widget options, with `createCellRenderer` typed for a Vue component.
|
|
28
|
+
* See `AgGridWidgetOptions` in `ag-studio`.
|
|
29
|
+
*/
|
|
30
|
+
export interface AgGridWidgetOptions extends Omit<AgCoreGridWidgetOptions, 'createCellRenderer'> {
|
|
31
|
+
/**
|
|
32
|
+
* Optional. Returns the cell renderer to use for a field's column, or `undefined` to leave that
|
|
33
|
+
* column with its default rendering. Called once for every column, each time the widget builds
|
|
34
|
+
* its columns.
|
|
35
|
+
*/
|
|
36
|
+
createCellRenderer?: (field: AgWidgetField) => Component | undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Pivot grid widget options, with `createCellRenderer` typed for a Vue component.
|
|
40
|
+
* See `AgPivotGridWidgetOptions` in `ag-studio`.
|
|
41
|
+
*/
|
|
42
|
+
export interface AgPivotGridWidgetOptions extends Omit<AgCorePivotGridWidgetOptions, 'createCellRenderer'> {
|
|
43
|
+
/**
|
|
44
|
+
* Optional. Returns the cell renderer to use for a field's cells, or `undefined` to leave them
|
|
45
|
+
* with their default rendering. Called for each value field and each Row Labels field.
|
|
46
|
+
*
|
|
47
|
+
* A renderer returned for a Row Labels field renders alongside the row's expand control and
|
|
48
|
+
* indentation rather than replacing the whole cell, and it receives no field information in its
|
|
49
|
+
* parameters - a renderer that needs to know which field it is rendering should close over the
|
|
50
|
+
* one passed to this callback.
|
|
51
|
+
*/
|
|
52
|
+
createCellRenderer?: (field: AgWidgetField) => Component | undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* How a tool's calls are presented in the chat panel, with `detail` typed for a Vue component.
|
|
56
|
+
* See `AgBaseAiToolDisplay`.
|
|
57
|
+
*/
|
|
58
|
+
export interface AgAiToolDisplay extends AgBaseAiToolDisplay {
|
|
59
|
+
/**
|
|
60
|
+
* Component rendering the expanded body of this tool's calls. Either:
|
|
61
|
+
* - The name of a Vue component registered on the component that hosts Studio
|
|
62
|
+
* - A custom Vue component
|
|
63
|
+
* - A custom TypeScript component class (no Vue; working directly with the DOM)
|
|
64
|
+
*/
|
|
65
|
+
detail?: string | Component<AgAiToolDetailParams> | (new () => AgTypeScriptComponent<AgAiToolDetailParams>);
|
|
24
66
|
}
|
|
25
67
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AgAiHarnessSetup, AgAiStrings, AgDataEngine, AgDataOptions, AgDataSourcesDefinition, AgDefaultRegistry, AgHistoryOptions, AgPageConfig, AgPageLayoutState, AgPanelConfig, AgReportState, AgStudioGetLocaleTextParams, AgStudioLocaleText, AgStudioMode, AgStudioTheme, AgSuppressKeyboard, AgWidgetsConfig } from 'ag-studio';
|
|
2
2
|
import type { AgStudioApiReadyEvent, AgStudioErrorRaisedEvent, AgStudioPreDestroyedEvent, AgStudioReadyEvent, AgStudioRenderStateChangedEvent, AgStudioStateUpdatedEvent } from 'ag-studio';
|
|
3
3
|
import type { AgStudioModule, AgStudioProperties } from 'ag-studio';
|
|
4
4
|
import type { AgRegistry } from './interfaces';
|
|
@@ -74,6 +74,11 @@ export interface Props<TRegistry extends AgRegistry = AgDefaultRegistry> {
|
|
|
74
74
|
* @initial
|
|
75
75
|
*/
|
|
76
76
|
suppressTouch?: boolean;
|
|
77
|
+
/** Keyboard shortcuts Studio should not handle, so an application can bind them itself.
|
|
78
|
+
* Each shortcut is suppressed independently, e.g. `{ redo: true }` keeps undo on ctrl/cmd+Z and
|
|
79
|
+
* leaves ctrl/cmd+shift+Z to the application.
|
|
80
|
+
*/
|
|
81
|
+
suppressKeyboard?: AgSuppressKeyboard;
|
|
77
82
|
/** A map of key->value pairs for localising text within Studio.
|
|
78
83
|
* @initial
|
|
79
84
|
*/
|
|
@@ -106,20 +111,44 @@ export interface Props<TRegistry extends AgRegistry = AgDefaultRegistry> {
|
|
|
106
111
|
*/
|
|
107
112
|
data?: AgDataSourcesDefinition<TRegistry> | AgDataEngine;
|
|
108
113
|
/** Which mode Studio is in.
|
|
114
|
+
* Changing this only changes what is shown and what is editable: the active state is
|
|
115
|
+
* neither saved nor restored on a mode change, and carries across the switch unchanged.
|
|
116
|
+
* The undo and redo history also carries across by default; set `history.onModeChange` to
|
|
117
|
+
* discard it instead.
|
|
109
118
|
* @default 'view'
|
|
110
119
|
*/
|
|
111
120
|
mode?: AgStudioMode;
|
|
121
|
+
/** How Studio's undo and redo history behaves. */
|
|
122
|
+
history?: AgHistoryOptions;
|
|
123
|
+
/** Allows filters to be added to, and removed from, the filters panel while in view mode.
|
|
124
|
+
*
|
|
125
|
+
* When `false`, filters can only be added and removed in edit mode.
|
|
126
|
+
*
|
|
127
|
+
* Studio does not store filters added this way. Listen to `onStateUpdated` and persist the
|
|
128
|
+
* state yourself if it needs to survive a reload.
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
enableFilterEditingInViewMode?: boolean;
|
|
112
132
|
/** Default layout styling.
|
|
113
133
|
*/
|
|
114
134
|
layout?: Partial<AgPageLayoutState>;
|
|
115
|
-
/** AI Assistant
|
|
116
|
-
*
|
|
117
|
-
* NOTE: The **AI Assistant** is an experimental feature. Behaviour will be
|
|
118
|
-
* slightly different depending on the LLM being used, and results can vary across queries.
|
|
135
|
+
/** The agent harness powering the AI Assistant panel: either a harness, or a function building
|
|
136
|
+
* one from the Studio API. Results vary with the LLM you supply.
|
|
119
137
|
*
|
|
120
138
|
* @initial
|
|
121
139
|
*/
|
|
122
|
-
ai?:
|
|
140
|
+
ai?: AgAiHarnessSetup;
|
|
141
|
+
/** How each tool's calls are presented in the AI Assistant panel, keyed by tool name: the words
|
|
142
|
+
* on the step, an optional component for the body that opens beneath it, or `hidden` to leave
|
|
143
|
+
* the tool out of the transcript. Studio's own tools come pre-declared; an entry here overrides
|
|
144
|
+
* them, and any tool of your own needs one to render as more than its name.
|
|
145
|
+
*
|
|
146
|
+
* Keyed by name because a call replayed from history no longer carries the tool that ran it,
|
|
147
|
+
* only the name it was called by. Applies whichever harness is driving the panel.
|
|
148
|
+
*
|
|
149
|
+
* `detail` is checked against the component type of the framework you are using.
|
|
150
|
+
*/
|
|
151
|
+
aiToolDisplay?: Record<string, TRegistry['aiToolDisplay']>;
|
|
123
152
|
/** Data-layer configuration. Controls behaviours such as export row limits.
|
|
124
153
|
*/
|
|
125
154
|
dataOptions?: AgDataOptions;
|
|
@@ -153,6 +182,7 @@ export declare function getProps(): {
|
|
|
153
182
|
themeStyleContainer: undefined;
|
|
154
183
|
getDocument: undefined;
|
|
155
184
|
suppressTouch: undefined;
|
|
185
|
+
suppressKeyboard: undefined;
|
|
156
186
|
localeText: undefined;
|
|
157
187
|
aiText: undefined;
|
|
158
188
|
getLocaleText: undefined;
|
|
@@ -161,8 +191,11 @@ export declare function getProps(): {
|
|
|
161
191
|
initialState: undefined;
|
|
162
192
|
data: undefined;
|
|
163
193
|
mode: undefined;
|
|
194
|
+
history: undefined;
|
|
195
|
+
enableFilterEditingInViewMode: undefined;
|
|
164
196
|
layout: undefined;
|
|
165
197
|
ai: undefined;
|
|
198
|
+
aiToolDisplay: undefined;
|
|
166
199
|
dataOptions: undefined;
|
|
167
200
|
panels: undefined;
|
|
168
201
|
page: undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgCreateWidgetsParams, AgDefaultRegistry, AgWidgetsConfig } from 'ag-studio';
|
|
2
|
+
import type { AgRegistry } from './components/interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Helper function for the `widgets` Studio property.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createWidgets<TRegistry extends AgRegistry = AgDefaultRegistry>(params: AgCreateWidgetsParams<TRegistry>): AgWidgetsConfig<TRegistry>;
|
package/dist/typings/main.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import AgStudio from './components/AgStudio.vue';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import GridWidget from './components/GridWidget.vue';
|
|
3
|
+
import PivotGridWidget from './components/PivotGridWidget.vue';
|
|
4
|
+
export { AgStudio, GridWidget, PivotGridWidget };
|
|
5
|
+
export { createWidgets } from './createWidgets';
|
|
6
|
+
export type { AgWidgetDefinition, AgRegistry, AgAiToolDisplay, AgGridWidgetOptions, AgPivotGridWidgetOptions, } from './components/interfaces';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ag-studio-vue3",
|
|
3
3
|
"description": "AG Studio Vue Component",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"author": "Sean Landsman <sean@thelandsmans.com>",
|
|
6
6
|
"license": "Commercial",
|
|
7
7
|
"files": [
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://ag-grid.zendesk.com/"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://www.ag-grid.com/studio",
|
|
13
|
+
"homepage": "https://www.ag-grid.com/studio/",
|
|
14
14
|
"keywords": [],
|
|
15
15
|
"main": "./dist/main.umd.js",
|
|
16
16
|
"module": "./dist/main.mjs",
|
|
@@ -34,8 +34,10 @@
|
|
|
34
34
|
"build-only:watch": "vite build --watch"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"ag-
|
|
38
|
-
"ag-
|
|
37
|
+
"ag-grid-enterprise": "~36.2.0",
|
|
38
|
+
"ag-grid-vue3": "~36.2.0",
|
|
39
|
+
"ag-stack": "~36.2.0",
|
|
40
|
+
"ag-studio": "3.0.0"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
41
43
|
"vue": "^3.5.0",
|