Skip to content

Commit f70dd20

Browse files
committed
update ag-grid
1 parent 3b4e49c commit f70dd20

File tree

11 files changed

+3854
-115
lines changed

11 files changed

+3854
-115
lines changed

packages/example/src/examples/ag-grid/uischema.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
{ "field": "date", "rowDrag": true },
1212
{ "field": "message", "flex": 1 },
1313
{ "field": "enum", "resizable": false }
14-
]
14+
],
15+
"pagination": false,
16+
"paginationPageSize": 4
1517
}
1618
}
1719
}

packages/jsonforms-vuetify-renderers/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050
"@jsonforms/vue-vuetify": "catalog:",
5151
"@monaco-editor/loader": "^1.4.0",
5252
"@vue/compiler-dom": "^3.5.0",
53-
"ag-grid-community": "^34.0.0",
54-
"ag-grid-vue3": "^34.0.0",
53+
"ag-charts-types": "^12.2.0",
54+
"ag-grid-community": "^34.2.0",
55+
"ag-grid-vue3": "^34.2.0",
5556
"ajv": "^8.6.1",
5657
"ajv-errors": "^3.0.0",
5758
"ajv-i18n": "^4.2.0",
@@ -73,8 +74,9 @@
7374
"@monaco-editor/loader": "^1.4.0",
7475
"@types/lodash": "^4.17.16",
7576
"@types/splitpanes": "^2.2.6",
76-
"ag-grid-community": "^34.0.0",
77-
"ag-grid-vue3": "^34.0.0",
77+
"ag-charts-types": "^12.2.0",
78+
"ag-grid-community": "^34.2.0",
79+
"ag-grid-vue3": "^34.2.0",
7880
"ajv": "^8.6.1",
7981
"ajv-errors": "^3.0.0",
8082
"ajv-i18n": "^4.2.0",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@use 'vuetify/tools' as tools;
2+
@use './themes/quartz/_index' as quartz;
3+
4+
@include tools.layer('components') {
5+
@include quartz.quartz-theme('.v-ag-grid');
6+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<script lang="ts" setup generic="TData = any">
2+
import type { GridApi } from 'ag-grid-community';
3+
import {
4+
computed,
5+
defineAsyncComponent,
6+
nextTick,
7+
onMounted,
8+
ref,
9+
useAttrs,
10+
type CSSProperties,
11+
type Ref,
12+
} from 'vue';
13+
import { useRtl, useTheme } from 'vuetify';
14+
import type { Props } from './utils';
15+
import { getProps } from './utils';
16+
17+
import 'ag-grid-community/styles/ag-grid.css';
18+
import './VAgGrid.scss';
19+
20+
type StyleValue =
21+
| string
22+
| CSSProperties
23+
| Array<string | CSSProperties>
24+
| undefined;
25+
26+
const attrs = useAttrs();
27+
const props = withDefaults(defineProps<Props<TData>>(), { ...getProps() });
28+
const style = (attrs.style as StyleValue) || {};
29+
const theme = useTheme();
30+
31+
const themeClass = computed(() =>
32+
theme.current.value.dark ? 'ag-theme-quartz-dark' : 'ag-theme-quartz',
33+
);
34+
35+
// RTL support
36+
const rtl = useRtl();
37+
38+
// AG Grid API ref
39+
const api: Ref<GridApi | undefined> = ref(undefined);
40+
const gridRef = ref<any>(null);
41+
42+
// Async load AG Grid Vue + modules
43+
const AgGridVue = defineAsyncComponent(() =>
44+
Promise.all([import('ag-grid-vue3'), import('ag-grid-community')]).then(
45+
([vueModule, gridModule]) => {
46+
const { ModuleRegistry, AllCommunityModule } = gridModule;
47+
48+
ModuleRegistry.registerModules([AllCommunityModule]);
49+
50+
return vueModule.AgGridVue;
51+
},
52+
),
53+
);
54+
55+
// Expose API
56+
defineExpose({
57+
api,
58+
});
59+
60+
// Bind the grid instance API once mounted
61+
onMounted(() => {
62+
nextTick(() => {
63+
if (gridRef.value?.api) {
64+
api.value = gridRef.value.api;
65+
}
66+
});
67+
});
68+
</script>
69+
70+
<template>
71+
<Suspense>
72+
<template #default>
73+
<ag-grid-vue
74+
ref="gridRef"
75+
v-bind="{ ...props, ...attrs }"
76+
class="v-ag-grid"
77+
:class="themeClass"
78+
:enableRtl="rtl.isRtl.value"
79+
theme="legacy"
80+
/>
81+
</template>
82+
83+
<template #fallback>
84+
<div class="d-flex align-center justify-center" :style="style">
85+
<v-progress-circular indeterminate color="primary" size="48" />
86+
</div>
87+
</template>
88+
</Suspense>
89+
</template>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as VAgGrid } from './VAgGrid.vue';

packages/jsonforms-vuetify-renderers/src/components/VAgGrid/themes/quartz/_index.scss

Lines changed: 763 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)