1 | import { SetupContext, RenderFunction, ComponentPublicInstance, ComputedRef } from 'vue'
|
2 | import { VXEComponent, VxeComponentBase, SizeType, VxeEvent, ValueOf } from './component'
|
3 | import { VxeGlobalRendererHandles } from './v-x-e-table'
|
4 | import { VxeCheckboxPropTypes } from './checkbox'
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export const VxeCheckboxGroup: VXEComponent<VxeCheckboxGroupProps, VxeCheckboxGroupEventProps, VxeCheckboxGroupSlots>
|
13 |
|
14 |
|
15 |
|
16 | export const CheckboxGroup: typeof VxeCheckboxGroup
|
17 |
|
18 | export type VxeCheckboxGroupInstance = ComponentPublicInstance<VxeCheckboxGroupProps, VxeCheckboxGroupConstructor>
|
19 |
|
20 | export interface VxeCheckboxGroupConstructor extends VxeComponentBase, VxeCheckboxGroupMethods {
|
21 | props: VxeCheckboxGroupProps
|
22 | context: SetupContext<VxeCheckboxGroupEmits>
|
23 | getComputeMaps(): CheckboxPrivateComputed
|
24 | renderVN: RenderFunction
|
25 | }
|
26 |
|
27 | export type VxeCheckboxGroupProps = {
|
28 | size?: VxeCheckboxGroupPropTypes.Size
|
29 | options?: VxeCheckboxGroupPropTypes.Options
|
30 | optionProps?: VxeCheckboxGroupPropTypes.OptionProps
|
31 | |
32 |
|
33 |
|
34 | modelValue?: VxeCheckboxGroupPropTypes.ModelValue
|
35 | max?: VxeCheckboxGroupPropTypes.Max
|
36 | |
37 |
|
38 |
|
39 | disabled?: VxeCheckboxGroupPropTypes.Disabled
|
40 | }
|
41 |
|
42 | export namespace VxeCheckboxGroupPropTypes {
|
43 | export type Size = SizeType
|
44 | export type ModelValue = any[]
|
45 | export type Options = {
|
46 | value?: VxeCheckboxPropTypes.Label
|
47 | label?: VxeCheckboxPropTypes.Content
|
48 |
|
49 | [key: string]: any
|
50 | }[]
|
51 | export type OptionProps = VxeGlobalRendererHandles.RenderOptionProps
|
52 | export type Max = string | number
|
53 | export type Disabled = boolean
|
54 | }
|
55 |
|
56 | export interface CheckboxPrivateComputed {
|
57 | computeIsMaximize: ComputedRef<boolean>
|
58 | }
|
59 |
|
60 | export interface CheckboxGroupMethods {
|
61 | dispatchEvent(type: ValueOf<VxeCheckboxGroupEmits>, params: any, evnt: Event): void
|
62 | }
|
63 | export interface VxeCheckboxGroupMethods extends CheckboxGroupMethods { }
|
64 |
|
65 | export interface CheckboxGroupPrivateMethods {
|
66 | handleChecked(params: {
|
67 | checked: boolean
|
68 | value: VxeCheckboxPropTypes.ModelValue
|
69 | label: VxeCheckboxPropTypes.Label
|
70 | }, evnt: Event): void
|
71 | }
|
72 | export interface VxeCheckboxGroupPrivateMethods extends CheckboxGroupPrivateMethods { }
|
73 |
|
74 | export type VxeCheckboxGroupEmits = [
|
75 | 'update:modelValue',
|
76 | 'change'
|
77 | ]
|
78 |
|
79 | export namespace VxeCheckboxGroupDefines {
|
80 | interface CheckboxGroupEventParams extends VxeEvent {
|
81 | $checkboxGroup: VxeCheckboxGroupConstructor
|
82 | }
|
83 |
|
84 | export type ChangeParams = {
|
85 | checklist: any[]
|
86 | }
|
87 | export interface ChangeEventParams extends CheckboxGroupEventParams, ChangeParams { }
|
88 | }
|
89 |
|
90 | export type VxeCheckboxGroupEventProps = {
|
91 | onChange?: VxeCheckboxGroupEvents.Change
|
92 | }
|
93 |
|
94 | export interface VxeCheckboxGroupListeners {
|
95 | change?: VxeCheckboxGroupEvents.Change
|
96 | }
|
97 |
|
98 | export namespace VxeCheckboxGroupEvents {
|
99 | export type Change = (params: VxeCheckboxGroupDefines.ChangeEventParams) => void
|
100 | }
|
101 |
|
102 | export interface VxeCheckboxGroupSlots {
|
103 | |
104 |
|
105 |
|
106 | [key: string]: ((params: {
|
107 | [key: string]: any
|
108 | }) => any) | undefined
|
109 | }
|