@adaptabletools/adaptable-vue3-aggrid-cjs 18.1.4 → 18.1.6
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 +3 -20
- package/lib/AdaptableUI.js +3 -1
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +33 -0
- package/package.json +2 -2
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AdaptableAgGridVue = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
5
|
const AdaptableProviderContext_1 = require("./AdaptableProviderContext");
|
|
6
|
-
const vue3_1 = require("ag-grid-
|
|
6
|
+
const vue3_1 = require("ag-grid-vue3");
|
|
7
7
|
const core_1 = require("ag-grid-community");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
8
9
|
const agGridPropertySet = new Set(core_1.ComponentUtil.ALL_PROPERTIES);
|
|
9
10
|
const PASS_THROUGH_PROPS = [
|
|
10
11
|
'modelValue',
|
|
@@ -13,30 +14,12 @@ const PASS_THROUGH_PROPS = [
|
|
|
13
14
|
'componentDependencies',
|
|
14
15
|
'plugins',
|
|
15
16
|
];
|
|
16
|
-
function deepToRaw(sourceObj) {
|
|
17
|
-
const objectIterator = (input) => {
|
|
18
|
-
if (Array.isArray(input)) {
|
|
19
|
-
return input.map((item) => objectIterator(item));
|
|
20
|
-
}
|
|
21
|
-
if ((0, vue_1.isRef)(input) || (0, vue_1.isReactive)(input) || (0, vue_1.isProxy)(input)) {
|
|
22
|
-
return objectIterator((0, vue_1.toRaw)(input));
|
|
23
|
-
}
|
|
24
|
-
if (input && typeof input === 'object') {
|
|
25
|
-
return Object.keys(input).reduce((acc, key) => {
|
|
26
|
-
acc[key] = objectIterator(input[key]);
|
|
27
|
-
return acc;
|
|
28
|
-
}, {});
|
|
29
|
-
}
|
|
30
|
-
return input;
|
|
31
|
-
};
|
|
32
|
-
return objectIterator(sourceObj);
|
|
33
|
-
}
|
|
34
17
|
const watch = core_1.ComponentUtil.ALL_PROPERTIES.reduce((acc, key) => {
|
|
35
18
|
acc[key] = function (newValue) {
|
|
36
19
|
/**
|
|
37
20
|
* We need to unwrap all potential refs inside the new grid option.
|
|
38
21
|
*/
|
|
39
|
-
this.agGridApi.setGridOption(key, deepToRaw(newValue));
|
|
22
|
+
this.agGridApi.setGridOption(key, (0, utils_1.deepToRaw)(newValue));
|
|
40
23
|
};
|
|
41
24
|
return acc;
|
|
42
25
|
}, {});
|
package/lib/AdaptableUI.js
CHANGED
|
@@ -5,6 +5,7 @@ const agGrid_1 = require("@adaptabletools/adaptable-cjs/agGrid");
|
|
|
5
5
|
const vue_1 = require("vue");
|
|
6
6
|
const AdaptableProviderContext_1 = require("./AdaptableProviderContext");
|
|
7
7
|
const setupFrameworkComponents_1 = require("./setupFrameworkComponents");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
8
9
|
/**
|
|
9
10
|
* This component handles the logic of initializing the Adaptable.
|
|
10
11
|
* It always renders a div, which is the container for the Adaptable.
|
|
@@ -57,10 +58,11 @@ exports.AdaptableUI = (0, vue_1.defineComponent)({
|
|
|
57
58
|
if (transition === AdaptableProviderContext_1.AdaptableAgGridStateTransitions.INITIALIZE_ADAPTABLE) {
|
|
58
59
|
this.adaptableInitialized = true;
|
|
59
60
|
const el = this.$el;
|
|
61
|
+
const gridOptions = Object.assign(Object.assign({}, (0, utils_1.deepToRaw)(this.gridOptions)), (0, utils_1.deleteUndefinedShallow)(rawAgGridProps));
|
|
60
62
|
const adaptableApi = await agGrid_1._AdaptableAgGrid._initInternal({
|
|
61
63
|
modules: this.modules,
|
|
62
64
|
adaptableOptions: Object.assign(Object.assign({}, this.adaptableOptions), { containerOptions: Object.assign(Object.assign({}, (_a = this.adaptableOptions) === null || _a === void 0 ? void 0 : _a.containerOptions), { adaptableContainer: el }) }),
|
|
63
|
-
gridOptions
|
|
65
|
+
gridOptions,
|
|
64
66
|
variant: 'vue',
|
|
65
67
|
renderAgGridFrameworkComponent: this.renderAgGridFrameworkComponent,
|
|
66
68
|
});
|
package/lib/utils.d.ts
ADDED
package/lib/utils.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteUndefinedShallow = exports.deepToRaw = void 0;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
function deepToRaw(sourceObj) {
|
|
6
|
+
const objectIterator = (input) => {
|
|
7
|
+
if (Array.isArray(input)) {
|
|
8
|
+
return input.map((item) => objectIterator(item));
|
|
9
|
+
}
|
|
10
|
+
if ((0, vue_1.isRef)(input) || (0, vue_1.isReactive)(input) || (0, vue_1.isProxy)(input)) {
|
|
11
|
+
return objectIterator((0, vue_1.toRaw)(input));
|
|
12
|
+
}
|
|
13
|
+
if (input && typeof input === 'object') {
|
|
14
|
+
return Object.keys(input).reduce((acc, key) => {
|
|
15
|
+
acc[key] = objectIterator(input[key]);
|
|
16
|
+
return acc;
|
|
17
|
+
}, {});
|
|
18
|
+
}
|
|
19
|
+
return input;
|
|
20
|
+
};
|
|
21
|
+
return objectIterator(sourceObj);
|
|
22
|
+
}
|
|
23
|
+
exports.deepToRaw = deepToRaw;
|
|
24
|
+
function deleteUndefinedShallow(sourceObj) {
|
|
25
|
+
return Object.keys(sourceObj).reduce((acc, key) => {
|
|
26
|
+
if (sourceObj[key] !== undefined) {
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
acc[key] = sourceObj[key];
|
|
29
|
+
}
|
|
30
|
+
return acc;
|
|
31
|
+
}, {});
|
|
32
|
+
}
|
|
33
|
+
exports.deleteUndefinedShallow = deleteUndefinedShallow;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-vue3-aggrid-cjs",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.6",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
"ag-grid-community": "^31.3.2"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@adaptabletools/adaptable-cjs": "18.1.
|
|
11
|
+
"@adaptabletools/adaptable-cjs": "18.1.6"
|
|
12
12
|
}
|
|
13
13
|
}
|