@adaptabletools/adaptable-vue3-aggrid-cjs 23.0.4 → 23.0.5-canary.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/lib/AdaptableAgGridVue.js +0 -33
- package/lib/AdaptableProvider.js +0 -10
- package/lib/AdaptableUI.js +0 -12
- package/lib/utils.js +0 -1
- package/package.json +2 -2
|
@@ -17,34 +17,12 @@ const PASS_THROUGH_PROPS = [
|
|
|
17
17
|
];
|
|
18
18
|
const watch = _ALL_GRID_OPTIONS_KEYS.reduce((acc, key) => {
|
|
19
19
|
acc[key] = function (newValue) {
|
|
20
|
-
/**
|
|
21
|
-
* We need to unwrap all potential refs inside the new grid option.
|
|
22
|
-
*/
|
|
23
20
|
this.agGridApi.setGridOption(key, (0, utils_1.deepToRaw)(newValue));
|
|
24
21
|
};
|
|
25
22
|
return acc;
|
|
26
23
|
}, {});
|
|
27
24
|
exports.AdaptableAgGridVue = (0, vue_1.defineComponent)({
|
|
28
25
|
name: 'adaptable-ag-grid-vue',
|
|
29
|
-
/**
|
|
30
|
-
* Ag-Grid Vue only has typings for a few props, of which a few cannot find docs:
|
|
31
|
-
* - gridOptions
|
|
32
|
-
* - modules
|
|
33
|
-
*
|
|
34
|
-
* Not documented
|
|
35
|
-
* - componentDependencies
|
|
36
|
-
* - plugins
|
|
37
|
-
* - modelValue
|
|
38
|
-
*
|
|
39
|
-
* Other props have a flag of 'VUE_OMITTED_PROPERTY', that work, but are not typed.
|
|
40
|
-
* https://github.com/ag-grid/ag-grid/blob/latest/packages/ag-grid-vue3/src/Utils.ts#L16
|
|
41
|
-
*
|
|
42
|
-
* We let pass through:
|
|
43
|
-
* - class
|
|
44
|
-
* - style
|
|
45
|
-
*
|
|
46
|
-
* The rest we add to gridOptions, and we intercept when they change
|
|
47
|
-
*/
|
|
48
26
|
props: {
|
|
49
27
|
class: {
|
|
50
28
|
type: String,
|
|
@@ -54,7 +32,6 @@ exports.AdaptableAgGridVue = (0, vue_1.defineComponent)({
|
|
|
54
32
|
type: [String, Object],
|
|
55
33
|
required: false,
|
|
56
34
|
},
|
|
57
|
-
// Internal types, that are passed through, defined in ag-grid-vue3.
|
|
58
35
|
modelValue: {
|
|
59
36
|
type: Array,
|
|
60
37
|
default: undefined,
|
|
@@ -65,8 +42,6 @@ exports.AdaptableAgGridVue = (0, vue_1.defineComponent)({
|
|
|
65
42
|
default: () => [],
|
|
66
43
|
},
|
|
67
44
|
plugins: [],
|
|
68
|
-
// These are not defined in AgGridVue typings
|
|
69
|
-
// But are useful for users to control via props
|
|
70
45
|
columnDefs: {
|
|
71
46
|
type: Array,
|
|
72
47
|
required: false,
|
|
@@ -75,11 +50,6 @@ exports.AdaptableAgGridVue = (0, vue_1.defineComponent)({
|
|
|
75
50
|
setup(props) {
|
|
76
51
|
const { class: className, style } = props;
|
|
77
52
|
const { gridOptions, transition, setAgGridProps, setTransition, modules, agGridApi } = (0, vue_1.inject)(AdaptableProviderContext_1.AdaptableProviderContextKey);
|
|
78
|
-
/**
|
|
79
|
-
* We pick up props that are on gridOptions.
|
|
80
|
-
* We send these to the the provider, where are added to gridOptions.
|
|
81
|
-
* These props do not make it to the AgGridVue component.
|
|
82
|
-
*/
|
|
83
53
|
const agGridProps = Object.entries(props).reduce((acc, [key, value]) => {
|
|
84
54
|
if (PASS_THROUGH_PROPS.includes(key)) {
|
|
85
55
|
return acc;
|
|
@@ -108,9 +78,6 @@ exports.AdaptableAgGridVue = (0, vue_1.defineComponent)({
|
|
|
108
78
|
if (this.transition !== AdaptableProviderContext_1.AdaptableAgGridStateTransitions.INITIALIZE_AG_GRID) {
|
|
109
79
|
return null;
|
|
110
80
|
}
|
|
111
|
-
/**
|
|
112
|
-
* We pass through props that are internal, and adaptable does not use/change.
|
|
113
|
-
*/
|
|
114
81
|
const passedThroughProps = Object.entries(this.$props).reduce((acc, [key, value]) => {
|
|
115
82
|
if (!PASS_THROUGH_PROPS.includes(key)) {
|
|
116
83
|
return acc;
|
package/lib/AdaptableProvider.js
CHANGED
|
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AdaptableProvider = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
5
|
const AdaptableProviderContext_1 = require("./AdaptableProviderContext");
|
|
6
|
-
/**
|
|
7
|
-
* The provider handles the communication between the Adaptable and Ag-Grid.
|
|
8
|
-
* Steps are very similar to the react wrapper.
|
|
9
|
-
*/
|
|
10
6
|
exports.AdaptableProvider = (0, vue_1.defineComponent)({
|
|
11
7
|
name: 'adaptable-provider',
|
|
12
8
|
props: {
|
|
@@ -34,7 +30,6 @@ exports.AdaptableProvider = (0, vue_1.defineComponent)({
|
|
|
34
30
|
},
|
|
35
31
|
setup(props, { emit }) {
|
|
36
32
|
const currentTransition = (0, vue_1.ref)(AdaptableProviderContext_1.AdaptableAgGridStateTransitions.AG_GRID_EMIT_PROPS);
|
|
37
|
-
// destructure gridOptions, to ensure we don't mutate the outer object
|
|
38
33
|
const gridOptions = (0, vue_1.ref)({ ...props.gridOptions });
|
|
39
34
|
const agGridApi = (0, vue_1.ref)(null);
|
|
40
35
|
const agGridProps = (0, vue_1.ref)(null);
|
|
@@ -61,7 +56,6 @@ exports.AdaptableProvider = (0, vue_1.defineComponent)({
|
|
|
61
56
|
setTransition: (transition) => {
|
|
62
57
|
currentTransition.value = transition;
|
|
63
58
|
},
|
|
64
|
-
// AG GRID
|
|
65
59
|
modules: props.modules,
|
|
66
60
|
gridOptions,
|
|
67
61
|
setGridOptions: (gridOptions) => {
|
|
@@ -72,7 +66,6 @@ exports.AdaptableProvider = (0, vue_1.defineComponent)({
|
|
|
72
66
|
setAgGridProps: (props) => {
|
|
73
67
|
agGridProps.value = props;
|
|
74
68
|
},
|
|
75
|
-
// ADAPTABLE
|
|
76
69
|
renderAgGridFrameworkComponent,
|
|
77
70
|
onAdaptableReady(adaptableReadyInfo) {
|
|
78
71
|
emit('onAdaptableReady', adaptableReadyInfo);
|
|
@@ -82,9 +75,6 @@ exports.AdaptableProvider = (0, vue_1.defineComponent)({
|
|
|
82
75
|
(0, vue_1.provide)(AdaptableProviderContext_1.AdaptableProviderContextKey, context);
|
|
83
76
|
},
|
|
84
77
|
render() {
|
|
85
|
-
/**
|
|
86
|
-
* This just renders whatever are passed as children.
|
|
87
|
-
*/
|
|
88
78
|
return this.$slots.default && this.$slots.default();
|
|
89
79
|
},
|
|
90
80
|
});
|
package/lib/AdaptableUI.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AdaptableUI = void 0;
|
|
4
|
-
// AdaptableUI.ts
|
|
5
4
|
const ag_grid_enterprise_1 = require("ag-grid-enterprise");
|
|
6
5
|
const adaptable_1 = require("@adaptabletools/adaptable-cjs");
|
|
7
6
|
const vue_1 = require("vue");
|
|
@@ -25,7 +24,6 @@ exports.AdaptableUI = (0, vue_1.defineComponent)({
|
|
|
25
24
|
const isInitialized = (0, vue_1.ref)(false);
|
|
26
25
|
const initializeAdaptable = async () => {
|
|
27
26
|
if (isInitialized.value) {
|
|
28
|
-
// Adaptable already initialized
|
|
29
27
|
logger.value?.warn('Adaptable already initialized');
|
|
30
28
|
return;
|
|
31
29
|
}
|
|
@@ -48,12 +46,6 @@ exports.AdaptableUI = (0, vue_1.defineComponent)({
|
|
|
48
46
|
},
|
|
49
47
|
gridOptions: {
|
|
50
48
|
...(0, vue_1.toRaw)(gridOptions.value),
|
|
51
|
-
/**
|
|
52
|
-
* Because `columnDefs` are define in props, it is defined in props
|
|
53
|
-
* and it's value is 'undefined'.
|
|
54
|
-
* We need to allow gridOptions passed to provider to override undefined
|
|
55
|
-
* values that come from props.
|
|
56
|
-
*/
|
|
57
49
|
...(0, utils_1.deleteUndefinedShallow)(rawAgGridProps),
|
|
58
50
|
},
|
|
59
51
|
variant: 'vue',
|
|
@@ -68,20 +60,17 @@ exports.AdaptableUI = (0, vue_1.defineComponent)({
|
|
|
68
60
|
logger.value?.error('Failed to initialize Adaptable:', error);
|
|
69
61
|
}
|
|
70
62
|
};
|
|
71
|
-
// Watch for transition changes after mount
|
|
72
63
|
(0, vue_1.watch)(transition, async (newTransition) => {
|
|
73
64
|
if (newTransition !== AdaptableProviderContext_1.AdaptableAgGridStateTransitions.INITIALIZE_ADAPTABLE) {
|
|
74
65
|
return;
|
|
75
66
|
}
|
|
76
67
|
await initializeAdaptable();
|
|
77
68
|
});
|
|
78
|
-
// Ensure initialization after mount if transition is already correct
|
|
79
69
|
(0, vue_1.onMounted)(async () => {
|
|
80
70
|
if (transition.value === AdaptableProviderContext_1.AdaptableAgGridStateTransitions.INITIALIZE_ADAPTABLE) {
|
|
81
71
|
await initializeAdaptable();
|
|
82
72
|
}
|
|
83
73
|
});
|
|
84
|
-
// Cleanup
|
|
85
74
|
(0, vue_1.onUnmounted)(() => {
|
|
86
75
|
logger.value?.info('Destroying Adaptable...');
|
|
87
76
|
if (adaptableApi.value) {
|
|
@@ -94,7 +83,6 @@ exports.AdaptableUI = (0, vue_1.defineComponent)({
|
|
|
94
83
|
else {
|
|
95
84
|
logger.value?.warn('Adaptable API not available for destruction');
|
|
96
85
|
}
|
|
97
|
-
// Clear logger reference
|
|
98
86
|
logger.value = null;
|
|
99
87
|
});
|
|
100
88
|
return () => (0, vue_1.h)('div', {
|
package/lib/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-vue3-aggrid-cjs",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.5-canary.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"vue": "^3.0.0"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@adaptabletools/adaptable-cjs": "23.0.
|
|
12
|
+
"@adaptabletools/adaptable-cjs": "23.0.5-canary.0"
|
|
13
13
|
}
|
|
14
14
|
}
|