@alaarab/ogrid-vue-vuetify 2.0.22 → 2.1.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, computed, h } from 'vue';
|
|
2
2
|
import { VBtn, VMenu, VList, VListItem, VDivider } from 'vuetify/components';
|
|
3
3
|
import { useColumnChooserState } from '@alaarab/ogrid-vue';
|
|
4
4
|
export const ColumnChooser = defineComponent({
|
|
@@ -9,7 +9,6 @@ export const ColumnChooser = defineComponent({
|
|
|
9
9
|
onVisibilityChange: { type: Function, required: true },
|
|
10
10
|
},
|
|
11
11
|
setup(props) {
|
|
12
|
-
const menuOpen = ref(false);
|
|
13
12
|
const columnsRef = computed(() => props.columns);
|
|
14
13
|
const visibleColumnsRef = computed(() => props.visibleColumns);
|
|
15
14
|
const state = useColumnChooserState({
|
|
@@ -19,8 +18,8 @@ export const ColumnChooser = defineComponent({
|
|
|
19
18
|
});
|
|
20
19
|
return () => {
|
|
21
20
|
return h(VMenu, {
|
|
22
|
-
modelValue:
|
|
23
|
-
'onUpdate:modelValue': (v) => {
|
|
21
|
+
modelValue: state.open.value,
|
|
22
|
+
'onUpdate:modelValue': (v) => { state.setOpen(v); },
|
|
24
23
|
closeOnContentClick: false,
|
|
25
24
|
location: 'bottom end',
|
|
26
25
|
}, {
|
|
@@ -29,7 +28,7 @@ export const ColumnChooser = defineComponent({
|
|
|
29
28
|
variant: 'outlined',
|
|
30
29
|
size: 'small',
|
|
31
30
|
prependIcon: 'mdi-view-column',
|
|
32
|
-
appendIcon:
|
|
31
|
+
appendIcon: state.open.value ? 'mdi-chevron-up' : 'mdi-chevron-down',
|
|
33
32
|
}, () => `Column Visibility (${state.visibleCount.value} of ${state.totalCount.value})`),
|
|
34
33
|
default: () => h('div', { style: { minWidth: '220px' } }, [
|
|
35
34
|
// Header
|
|
@@ -32,23 +32,8 @@ export const ColumnHeaderFilter = defineComponent({
|
|
|
32
32
|
onDateChange: { type: Function, default: undefined },
|
|
33
33
|
},
|
|
34
34
|
setup(props) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
isSorted: props.isSorted,
|
|
38
|
-
isSortedDescending: props.isSortedDescending,
|
|
39
|
-
onSort: props.onSort,
|
|
40
|
-
selectedValues: props.selectedValues,
|
|
41
|
-
onFilterChange: props.onFilterChange,
|
|
42
|
-
options: props.options,
|
|
43
|
-
isLoadingOptions: props.isLoadingOptions,
|
|
44
|
-
textValue: props.textValue,
|
|
45
|
-
onTextChange: props.onTextChange,
|
|
46
|
-
selectedUser: props.selectedUser,
|
|
47
|
-
onUserChange: props.onUserChange,
|
|
48
|
-
peopleSearch: props.peopleSearch,
|
|
49
|
-
dateValue: props.dateValue,
|
|
50
|
-
onDateChange: props.onDateChange,
|
|
51
|
-
});
|
|
35
|
+
// Pass props directly so useColumnHeaderFilterState accesses reactive prop values
|
|
36
|
+
const state = useColumnHeaderFilterState(props);
|
|
52
37
|
const renderPopoverContent = () => {
|
|
53
38
|
if (props.filterType === 'multiSelect') {
|
|
54
39
|
return h(MultiSelectFilterPopover, {
|
|
@@ -188,7 +173,7 @@ export const ColumnHeaderFilter = defineComponent({
|
|
|
188
173
|
padding: '8px 12px',
|
|
189
174
|
fontWeight: '600',
|
|
190
175
|
fontSize: '0.875rem',
|
|
191
|
-
backgroundColor: '
|
|
176
|
+
backgroundColor: 'rgb(var(--v-theme-surface))',
|
|
192
177
|
},
|
|
193
178
|
}, `Filter: ${props.columnName}`),
|
|
194
179
|
renderPopoverContent(),
|
|
@@ -24,10 +24,10 @@ export const PeopleFilterPopover = defineComponent({
|
|
|
24
24
|
h('div', { style: { padding: '12px 12px 8px', borderBottom: '1px solid rgba(0,0,0,0.12)' } }, [
|
|
25
25
|
h('span', { style: { fontSize: '0.75rem', color: 'rgba(0,0,0,0.6)' } }, 'Currently filtered by:'),
|
|
26
26
|
h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', marginTop: '4px' } }, [
|
|
27
|
-
h(_VAvatar, { size: 32, image: props.selectedUser.photo }, () => props.selectedUser
|
|
27
|
+
h(_VAvatar, { size: 32, image: props.selectedUser.photo }, () => props.selectedUser?.displayName?.[0] ?? ''),
|
|
28
28
|
h('div', { style: { flex: '1', minWidth: '0' } }, [
|
|
29
|
-
h('div', { style: { fontSize: '0.875rem', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, props.selectedUser
|
|
30
|
-
h('div', { style: { fontSize: '0.75rem', color: 'rgba(0,0,0,0.6)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, props.selectedUser
|
|
29
|
+
h('div', { style: { fontSize: '0.875rem', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, props.selectedUser?.displayName),
|
|
30
|
+
h('div', { style: { fontSize: '0.75rem', color: 'rgba(0,0,0,0.6)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, props.selectedUser?.email),
|
|
31
31
|
]),
|
|
32
32
|
h(_VBtn, {
|
|
33
33
|
icon: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PropType } from 'vue';
|
|
1
|
+
import { type PropType, type VNode } from 'vue';
|
|
2
2
|
export interface ColumnHeaderMenuProps {
|
|
3
3
|
isOpen: boolean;
|
|
4
4
|
anchorElement: HTMLElement | null;
|
|
@@ -87,7 +87,7 @@ export declare const ColumnHeaderMenu: import("vue").DefineComponent<import("vue
|
|
|
87
87
|
type: BooleanConstructor;
|
|
88
88
|
default: boolean;
|
|
89
89
|
};
|
|
90
|
-
}>, () =>
|
|
90
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
91
91
|
[key: string]: any;
|
|
92
92
|
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
93
93
|
isOpen: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-vue-vuetify",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "OGrid Vuetify – Vuetify-based data grid with sorting, filtering, pagination, column chooser, and CSV export.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"types": "./dist/types/index.d.ts",
|
|
11
11
|
"import": "./dist/esm/index.js",
|
|
12
12
|
"require": "./dist/esm/index.js"
|
|
13
|
-
}
|
|
13
|
+
},
|
|
14
|
+
"./styles/*": "./dist/esm/*"
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|
|
16
17
|
"build": "rimraf dist && tsc -p tsconfig.build.json && node scripts/copy-css.js",
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
"node": ">=18"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
|
-
"@alaarab/ogrid-vue": "2.0
|
|
41
|
+
"@alaarab/ogrid-vue": "2.1.0"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
44
|
"vue": "^3.3.0",
|
|
@@ -59,5 +60,12 @@
|
|
|
59
60
|
],
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"access": "public"
|
|
62
|
-
}
|
|
63
|
+
},
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "https://github.com/alaarab/ogrid.git",
|
|
67
|
+
"directory": "packages/vue-vuetify"
|
|
68
|
+
},
|
|
69
|
+
"homepage": "https://ogrid.dev",
|
|
70
|
+
"bugs": "https://github.com/alaarab/ogrid/issues"
|
|
63
71
|
}
|