1 | import { SetupContext, RenderFunction, ComponentPublicInstance } from 'vue'
|
2 | import { VXEComponent, VxeComponentBase, VxeEvent, SizeType, ValueOf } from './component'
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export const VxeCheckbox: VXEComponent<VxeCheckboxProps, VxeCheckboxEventProps, VxeCheckboxSlots>
|
11 |
|
12 |
|
13 |
|
14 | export const Checkbox: typeof VxeCheckbox
|
15 |
|
16 | export type VxeCheckboxInstance = ComponentPublicInstance<VxeCheckboxProps, VxeCheckboxConstructor>
|
17 |
|
18 | export interface VxeCheckboxConstructor extends VxeComponentBase, VxeCheckboxMethods {
|
19 | props: VxeCheckboxProps
|
20 | context: SetupContext<VxeCheckboxEmits>
|
21 | renderVN: RenderFunction
|
22 | }
|
23 |
|
24 | export type VxeCheckboxProps = {
|
25 | size?: VxeCheckboxPropTypes.Size
|
26 | |
27 |
|
28 |
|
29 | modelValue?: VxeCheckboxPropTypes.ModelValue
|
30 | |
31 |
|
32 |
|
33 | label?: VxeCheckboxPropTypes.Label
|
34 | |
35 |
|
36 |
|
37 | indeterminate?: VxeCheckboxPropTypes.Indeterminate
|
38 | |
39 |
|
40 |
|
41 | title?: VxeCheckboxPropTypes.Title
|
42 | checkedValue?: VxeCheckboxPropTypes.CheckedValue
|
43 | uncheckedValue?: VxeCheckboxPropTypes.UncheckedValue
|
44 | |
45 |
|
46 |
|
47 | content?: VxeCheckboxPropTypes.Content
|
48 | |
49 |
|
50 |
|
51 | disabled?: VxeCheckboxPropTypes.Disabled
|
52 | }
|
53 |
|
54 | export namespace VxeCheckboxPropTypes {
|
55 | export type Size = SizeType
|
56 | export type ModelValue = string | number | boolean
|
57 | export type Label = string | number
|
58 | export type Indeterminate = boolean
|
59 | export type Title = string | number
|
60 | export type CheckedValue = string | number | boolean
|
61 | export type UncheckedValue = string | number | boolean
|
62 | export type Content = string | number
|
63 | export type Disabled = boolean
|
64 | }
|
65 |
|
66 | export interface CheckboxMethods {
|
67 | dispatchEvent(type: ValueOf<VxeCheckboxEmits>, params: any, evnt: Event): void
|
68 | }
|
69 | export interface VxeCheckboxMethods extends CheckboxMethods { }
|
70 |
|
71 | export interface CheckboxPrivateMethods { }
|
72 | export interface VxeCheckboxPrivateMethods extends CheckboxPrivateMethods { }
|
73 |
|
74 | export type VxeCheckboxEmits = [
|
75 | 'update:modelValue',
|
76 | 'change'
|
77 | ]
|
78 |
|
79 | export namespace VxeCheckboxDefines {
|
80 | interface CheckboxEventParams extends VxeEvent {
|
81 | $checkbox: VxeCheckboxConstructor
|
82 | }
|
83 |
|
84 | export interface ChangeParams {
|
85 | checked: boolean
|
86 | label: any
|
87 | }
|
88 | export interface ChangeEventParams extends CheckboxEventParams, ChangeParams { }
|
89 | }
|
90 |
|
91 | export type VxeCheckboxEventProps = {
|
92 | onChange?: VxeCheckboxEvents.Change
|
93 | }
|
94 |
|
95 | export interface VxeCheckboxListeners {
|
96 | change?: VxeCheckboxEvents.Change
|
97 | }
|
98 |
|
99 | export namespace VxeCheckboxEvents {
|
100 | export type Change = (params: VxeCheckboxDefines.ChangeEventParams) => void
|
101 | }
|
102 |
|
103 | export interface VxeCheckboxSlots {
|
104 | |
105 |
|
106 |
|
107 | [key: string]: ((params: {
|
108 | [key: string]: any
|
109 | }) => any) | undefined
|
110 | }
|