1 | import { SetupContext, RenderFunction, ComponentPublicInstance } from 'vue'
|
2 | import { VXEComponent, VxeComponentBase, SizeType, VxeEvent, ValueOf } from './component'
|
3 | import { VxeGlobalRendererHandles } from './v-x-e-table'
|
4 | import { VxeRadioPropTypes } from './radio'
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export const VxeRadioGroup: VXEComponent<VxeRadioGroupProps, VxeRadioGroupEventProps, VxeRadioGroupSlots>
|
13 |
|
14 |
|
15 |
|
16 | export const RadioGroup: typeof VxeRadioGroup
|
17 |
|
18 | export type VxeRadioGroupInstance = ComponentPublicInstance<VxeRadioGroupProps, VxeRadioGroupConstructor>
|
19 |
|
20 | export interface VxeRadioGroupConstructor extends VxeComponentBase, VxeRadioGroupMethods {
|
21 | name: string
|
22 | props: VxeRadioGroupProps
|
23 | context: SetupContext<VxeRadioGroupEmits>
|
24 | renderVN: RenderFunction
|
25 | }
|
26 |
|
27 | export type VxeRadioGroupEmits = [
|
28 | 'update:modelValue',
|
29 | 'change'
|
30 | ]
|
31 |
|
32 | export type VxeRadioGroupProps = {
|
33 | size?: VxeRadioGroupPropTypes.Size
|
34 | type?: VxeRadioGroupPropTypes.Type
|
35 | options?: VxeRadioGroupPropTypes.Options
|
36 | optionProps?: VxeRadioGroupPropTypes.OptionProps
|
37 | |
38 |
|
39 |
|
40 | strict?: VxeRadioGroupPropTypes.Strict
|
41 | modelValue?: VxeRadioGroupPropTypes.ModelValue
|
42 | disabled?: VxeRadioGroupPropTypes.Disabled
|
43 | }
|
44 |
|
45 | export namespace VxeRadioGroupPropTypes {
|
46 | export type Size = SizeType
|
47 | export type Type = 'button' | 'default' | '' | null
|
48 | export type Options = {
|
49 | value?: VxeRadioPropTypes.Label
|
50 | label?: VxeRadioPropTypes.Content
|
51 |
|
52 | [key: string]: any
|
53 | }[]
|
54 | export type OptionProps = VxeGlobalRendererHandles.RenderOptionProps
|
55 | export type ModelValue = any
|
56 | export type Strict = boolean
|
57 | export type Disabled = boolean
|
58 | }
|
59 |
|
60 | export interface RadioGroupMethods {
|
61 | dispatchEvent(type: ValueOf<VxeRadioGroupEmits>, params: any, evnt?: Event): void
|
62 | }
|
63 | export interface VxeRadioGroupMethods extends RadioGroupMethods { }
|
64 |
|
65 | export interface RadioGroupPrivateMethods {
|
66 | handleChecked(params: { label: any }, evnt: Event): void
|
67 | }
|
68 | export interface VxeRadioGroupPrivateMethods extends RadioGroupPrivateMethods { }
|
69 |
|
70 | export namespace VxeRadioGroupDefines {
|
71 | interface RadioGroupEventParams extends VxeEvent {
|
72 | $radioGroup: VxeRadioGroupConstructor
|
73 | }
|
74 |
|
75 | export interface ChangeParams {
|
76 | label: any
|
77 | }
|
78 | export interface ChangeEventParams extends RadioGroupEventParams, ChangeParams { }
|
79 | }
|
80 |
|
81 | export type VxeRadioGroupEventProps = {
|
82 | onChange?: VxeRadioGroupEvents.Change
|
83 | }
|
84 |
|
85 | export interface VxeRadioGroupListeners {
|
86 | change?: VxeRadioGroupEvents.Change
|
87 | }
|
88 |
|
89 | export namespace VxeRadioGroupEvents {
|
90 | export type Change = (params: VxeRadioGroupDefines.ChangeEventParams) => void
|
91 | }
|
92 |
|
93 | export interface VxeRadioGroupSlots {
|
94 | |
95 |
|
96 |
|
97 | [key: string]: ((params: {
|
98 | [key: string]: any
|
99 | }) => any) | undefined
|
100 | }
|