-
Notifications
You must be signed in to change notification settings - Fork 731
/
types.ts
43 lines (34 loc) · 1.07 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
import type { Ref, Component } from 'vue'
import type { RequiredPermission } from '#shared/types/permission.ts'
import type { ObjectLike } from '#shared/types/utils.ts'
import { type Props as ItemProps } from './CommonPopoverMenuItem.vue'
export interface CommonPopoverInstance {
openPopover(): void
closePopover(isInteractive?: boolean): void
togglePopover(isInteractive?: boolean): void
isOpen: boolean
}
export interface CommonPopoverInternalInstance
extends Omit<CommonPopoverInstance, 'isOpen'> {
isOpen: Ref<boolean>
}
export type Orientation =
| 'top'
| 'bottom'
| 'left'
| 'right'
| 'autoVertical'
| 'autoHorizontal'
export type Placement = 'start' | 'end'
export type Variant = 'secondary' | 'danger'
export interface MenuItem extends ItemProps {
key: string
permission?: RequiredPermission
show?: (entity?: ObjectLike) => boolean
separatorTop?: boolean
onClick?: (entity?: ObjectLike) => void
noCloseOnClick?: boolean
component?: Component
variant?: Variant
}