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