@autoafleveren/ui 1.4.14 → 1.4.15
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/dist/ui.cjs +18 -18
- package/dist/ui.js +2440 -2436
- package/package.json +1 -1
- package/src/modules/components/AppDataTable/AppDataTable.vue +10 -1
- package/src/modules/components/AppDataTable/index.d.ts +2 -0
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import AppDataTableFooter from './AppDataTableFooter.vue';
|
|
8
8
|
|
|
9
9
|
import type { ServerOptions, UpdateSortArgument } from 'vue3-easy-data-table';
|
|
10
|
+
import type { Action } from '~components/AppActionBar/index.d';
|
|
10
11
|
import type { Props, DataTableInstance } from '.';
|
|
11
12
|
|
|
12
13
|
const props = withDefaults(defineProps<Props<Item>>(), {
|
|
@@ -130,6 +131,14 @@
|
|
|
130
131
|
emit('sortClient', value);
|
|
131
132
|
}
|
|
132
133
|
|
|
134
|
+
function contextMenuOpen(item: unknown, event: PointerEvent | MouseEvent, confirmed?: Action['name']): void {
|
|
135
|
+
const result = props.onContextMenu?.(item, event, confirmed);
|
|
136
|
+
|
|
137
|
+
if (result !== false) {
|
|
138
|
+
contextMenu.open(item, event, confirmed);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
133
142
|
defineExpose({ dataTableInstance });
|
|
134
143
|
|
|
135
144
|
defineOptions({ inheritAttrs: false });
|
|
@@ -160,7 +169,7 @@
|
|
|
160
169
|
body-row-class-name="drop-shadow-xs rounded-xl"
|
|
161
170
|
@update:items-selected="updateSelection"
|
|
162
171
|
@click-row="clickRow"
|
|
163
|
-
@contextmenu-row="
|
|
172
|
+
@contextmenu-row="contextMenuOpen"
|
|
164
173
|
@update:server-options="onUpdateServerOptions"
|
|
165
174
|
@update-sort="onUpdateClientSort"
|
|
166
175
|
>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Header } from 'vue3-easy-data-table';
|
|
2
|
+
import type { Action } from '~components/AppActionBar/index.d';
|
|
2
3
|
|
|
3
4
|
export interface Props<Item> {
|
|
4
5
|
headers: Header[];
|
|
@@ -10,6 +11,7 @@ export interface Props<Item> {
|
|
|
10
11
|
actionBarSelection?: boolean;
|
|
11
12
|
actionBarSelectionKey?: string;
|
|
12
13
|
hideFooter?: boolean;
|
|
14
|
+
onContextMenu?: (item: unknown, event: PointerEvent | MouseEvent, confirmed?: Action['name']) => void | false;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export interface DataTableInstance {
|