@citizenplane/pimp 9.1.1 → 9.1.3
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/pimp.es.js +254 -253
- package/dist/pimp.umd.js +10 -10
- package/package.json +1 -1
- package/src/components/CpMenuItem.vue +1 -1
- package/src/components/CpTable.vue +7 -4
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ interface Props {
|
|
|
36
36
|
tooltip?: string
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const props = withDefaults(defineProps<Props & Omit<MenuItem, 'class' | 'disabled'>>(), {
|
|
39
|
+
const props = withDefaults(defineProps<Props & Omit<MenuItem, 'class' | 'disabled' | 'key'>>(), {
|
|
40
40
|
label: '',
|
|
41
41
|
tooltip: '',
|
|
42
42
|
icon: '',
|
|
@@ -214,7 +214,9 @@ const defaultRowOption = computed<RowOptions>(() => {
|
|
|
214
214
|
id: 'more',
|
|
215
215
|
label: 'More',
|
|
216
216
|
icon: 'more-vertical',
|
|
217
|
-
action: (rowData: Record<string, unknown>, $event: MouseEvent) =>
|
|
217
|
+
action: (rowData: Record<string, unknown>, $event: MouseEvent) => {
|
|
218
|
+
handleContextMenu({ rowData, rowIndex: null }, $event)
|
|
219
|
+
},
|
|
218
220
|
}
|
|
219
221
|
})
|
|
220
222
|
|
|
@@ -373,11 +375,12 @@ const paginationResultsDetails = computed(() => {
|
|
|
373
375
|
})
|
|
374
376
|
|
|
375
377
|
const handleContextMenu = (
|
|
376
|
-
{ rowData, rowIndex }: { rowData: Record<string, unknown>; rowIndex: number },
|
|
378
|
+
{ rowData, rowIndex }: { rowData: Record<string, unknown>; rowIndex: number | null },
|
|
377
379
|
event: MouseEvent,
|
|
378
380
|
) => {
|
|
379
381
|
if (!hasRowOptions.value || isFullWidthRow(rowData)) return
|
|
380
|
-
|
|
382
|
+
|
|
383
|
+
currentRowData.value = rowIndex !== null ? getRowPayload(rowIndex) : rowData
|
|
381
384
|
|
|
382
385
|
showContextualMenu(event)
|
|
383
386
|
}
|
|
@@ -517,7 +520,7 @@ const areRowOptionsEnabled = (rowData: Record<string, unknown>) => props.enableR
|
|
|
517
520
|
|
|
518
521
|
const resetPagination = () => (pageNumber.value = 0)
|
|
519
522
|
|
|
520
|
-
defineExpose({ hideContextualMenu, resetPagination })
|
|
523
|
+
defineExpose({ hideContextualMenu, resetPagination, currentRowData })
|
|
521
524
|
</script>
|
|
522
525
|
|
|
523
526
|
<style lang="scss">
|