x-next 0.0.0-alpha.59 → 0.0.0-alpha.60
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/README.md +47 -39
- package/dist/_hooks/_types.d.ts +3 -0
- package/dist/_utils/is-equal.d.ts +3 -0
- package/dist/_utils/vue-eco.d.ts +1 -0
- package/dist/components/form-radio/Radio.d.ts +153 -0
- package/dist/components/form-radio/RadioGroup.d.ts +143 -0
- package/dist/components/form-radio/context.d.ts +14 -0
- package/dist/components/form-radio/index.d.ts +328 -0
- package/dist/components/form-radio/interface.d.ts +18 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/spin/Spin.d.ts +72 -0
- package/dist/components/spin/dot-loading.d.ts +21 -0
- package/dist/components/spin/index.d.ts +64 -0
- package/dist/index.es.js +2992 -2561
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
- package/volar.d.ts +3 -0
package/README.md
CHANGED
@@ -27,43 +27,51 @@ app.mount('#app')
|
|
27
27
|
### 目前已完成的组件
|
28
28
|
|
29
29
|
```
|
30
|
-
XButton: (typeof import('x-next'))['Button']
|
31
|
-
XDialog: (typeof import('x-next'))['Dialog']
|
32
|
-
XMessage: (typeof import('x-next'))['Message']
|
33
|
-
XMessageBox: (typeof import('x-next'))['MessageBox']
|
34
|
-
XNotification: (typeof import('x-next'))['Notification']
|
35
|
-
XSpace: (typeof import('x-next'))['Space']
|
36
|
-
XPopconfirm: (typeof import('x-next'))['Popconfirm']
|
37
|
-
XTrendChart: (typeof import('x-next'))['TrendChart']
|
38
|
-
XTimeline: (typeof import('x-next'))['Timeline']
|
39
|
-
XTimelineItem: (typeof import('x-next'))['TimelineItem']
|
40
|
-
XPopup: (typeof import('x-next'))['Popup']
|
41
|
-
XScrollbar: (typeof import('x-next'))['Scrollbar']
|
42
|
-
XDrawer: (typeof import('x-next'))['Drawer']
|
43
|
-
XTag: (typeof import('x-next'))['Tag']
|
44
|
-
XTooltip: (typeof import('x-next'))['Tooltip']
|
45
|
-
XImage: (typeof import('x-next'))['Image']
|
46
|
-
XImagePreview: (typeof import('x-next'))['ImagePreview']
|
47
|
-
XImagePreviewGroup: (typeof import('x-next'))['ImagePreviewGroup']
|
48
|
-
XImagePreviewAction: (typeof import('x-next'))['ImagePreviewAction']
|
49
|
-
XTabPane: (typeof import('x-next'))['TabPane']
|
50
|
-
XTabs: (typeof import('x-next'))['Tabs']
|
51
|
-
XButtonGroup: (typeof import('x-next'))['ButtonGroup']
|
52
|
-
XDropdown: (typeof import('x-next'))['Dropdown']
|
53
|
-
XDropdownButton: (typeof import('x-next'))['DropdownButton']
|
54
|
-
XEmpty: (typeof import('x-next'))['Empty']
|
55
|
-
XDropdownOption: (typeof import('x-next'))['DropdownOption']
|
56
|
-
XDropdownGroup: (typeof import('x-next'))['DropdownGroup']
|
57
|
-
XDropdownSubmenu: (typeof import('x-next'))['DropdownSubmenu']
|
58
|
-
XInput: (typeof import('x-next'))['Input']
|
59
|
-
XInputGroup: (typeof import('x-next'))['InputGroup']
|
60
|
-
XInputPassword: (typeof import('x-next'))['InputPassword']
|
61
|
-
XInputSearch: (typeof import('x-next'))['InputSearch']
|
62
|
-
XCol: (typeof import('x-next'))['Col']
|
63
|
-
XGrid: (typeof import('x-next'))['Grid']
|
64
|
-
XGridItem: (typeof import('x-next'))['GridItem']
|
65
|
-
XRow: (typeof import('x-next'))['Row']
|
66
|
-
XForm: (typeof import('x-next'))['Form']
|
67
|
-
XFormItem: (typeof import('x-next'))['FormItem']
|
68
|
-
XNetwork: (typeof import('x-next'))['Network']
|
30
|
+
XButton: (typeof import('x-next'))['Button']
|
31
|
+
XDialog: (typeof import('x-next'))['Dialog']
|
32
|
+
XMessage: (typeof import('x-next'))['Message']
|
33
|
+
XMessageBox: (typeof import('x-next'))['MessageBox']
|
34
|
+
XNotification: (typeof import('x-next'))['Notification']
|
35
|
+
XSpace: (typeof import('x-next'))['Space']
|
36
|
+
XPopconfirm: (typeof import('x-next'))['Popconfirm']
|
37
|
+
XTrendChart: (typeof import('x-next'))['TrendChart']
|
38
|
+
XTimeline: (typeof import('x-next'))['Timeline']
|
39
|
+
XTimelineItem: (typeof import('x-next'))['TimelineItem']
|
40
|
+
XPopup: (typeof import('x-next'))['Popup']
|
41
|
+
XScrollbar: (typeof import('x-next'))['Scrollbar']
|
42
|
+
XDrawer: (typeof import('x-next'))['Drawer']
|
43
|
+
XTag: (typeof import('x-next'))['Tag']
|
44
|
+
XTooltip: (typeof import('x-next'))['Tooltip']
|
45
|
+
XImage: (typeof import('x-next'))['Image']
|
46
|
+
XImagePreview: (typeof import('x-next'))['ImagePreview']
|
47
|
+
XImagePreviewGroup: (typeof import('x-next'))['ImagePreviewGroup']
|
48
|
+
XImagePreviewAction: (typeof import('x-next'))['ImagePreviewAction']
|
49
|
+
XTabPane: (typeof import('x-next'))['TabPane']
|
50
|
+
XTabs: (typeof import('x-next'))['Tabs']
|
51
|
+
XButtonGroup: (typeof import('x-next'))['ButtonGroup']
|
52
|
+
XDropdown: (typeof import('x-next'))['Dropdown']
|
53
|
+
XDropdownButton: (typeof import('x-next'))['DropdownButton']
|
54
|
+
XEmpty: (typeof import('x-next'))['Empty']
|
55
|
+
XDropdownOption: (typeof import('x-next'))['DropdownOption']
|
56
|
+
XDropdownGroup: (typeof import('x-next'))['DropdownGroup']
|
57
|
+
XDropdownSubmenu: (typeof import('x-next'))['DropdownSubmenu']
|
58
|
+
XInput: (typeof import('x-next'))['Input']
|
59
|
+
XInputGroup: (typeof import('x-next'))['InputGroup']
|
60
|
+
XInputPassword: (typeof import('x-next'))['InputPassword']
|
61
|
+
XInputSearch: (typeof import('x-next'))['InputSearch']
|
62
|
+
XCol: (typeof import('x-next'))['Col']
|
63
|
+
XGrid: (typeof import('x-next'))['Grid']
|
64
|
+
XGridItem: (typeof import('x-next'))['GridItem']
|
65
|
+
XRow: (typeof import('x-next'))['Row']
|
66
|
+
XForm: (typeof import('x-next'))['Form']
|
67
|
+
XFormItem: (typeof import('x-next'))['FormItem']
|
68
|
+
XNetwork: (typeof import('x-next'))['Network']
|
69
|
+
XStep: (typeof import('x-next'))['Step']
|
70
|
+
XSteps: (typeof import('x-next'))['Steps']
|
71
|
+
XCheckbox: (typeof import('x-next'))['Checkbox']
|
72
|
+
XCheckboxGroup: (typeof import('x-next'))['CheckboxGroup']
|
73
|
+
XSwitch: (typeof import('x-next'))['Switch']
|
74
|
+
XRadio: (typeof import('x-next'))['Radio']
|
75
|
+
XRadioGroup: (typeof import('x-next'))['RadioGroup']
|
76
|
+
XSpin: (typeof import('x-next'))['Spin']
|
69
77
|
```
|
package/dist/_hooks/_types.d.ts
CHANGED
@@ -7,4 +7,7 @@ export type EmitFn2<Options = Record<string, any>, Event extends keyof Options =
|
|
7
7
|
[key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => void : (event: key, ...args: any[]) => void;
|
8
8
|
}[Event]>;
|
9
9
|
export type EmitType<T> = T | T[];
|
10
|
+
export type FieldString<T> = {
|
11
|
+
[K in keyof T]?: string;
|
12
|
+
};
|
10
13
|
export {};
|
@@ -0,0 +1,3 @@
|
|
1
|
+
export declare const isEqualObject: (obj: Record<string, unknown> | undefined, other: Record<string, unknown> | undefined) => boolean;
|
2
|
+
export declare const isEqualArray: (arr: unknown[] | undefined, other: unknown[] | undefined) => boolean;
|
3
|
+
export declare const isEqual: (a: unknown, b: unknown) => boolean;
|
package/dist/_utils/vue-eco.d.ts
CHANGED
@@ -36,6 +36,7 @@ export declare const getFirstElementFromChildren: (children: VNode[] | undefined
|
|
36
36
|
export declare const getChildrenArray: (vn: VNode) => VNode[] | undefined;
|
37
37
|
export declare const getComponentsFromVNode: (vn: VNode, name: string) => number[];
|
38
38
|
export declare const getComponentsFromChildren: (children: VNode[] | undefined, name: string) => number[];
|
39
|
+
export declare const getFirstComponent: (children: VNode[] | undefined) => VNode | undefined;
|
39
40
|
export declare const resolveProps: (vn: VNode) => Data;
|
40
41
|
export declare const mergeFirstChild: (children: VNode[] | undefined, extraProps: ObjectData | ((vn: VNode) => ObjectData)) => boolean;
|
41
42
|
export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
|
@@ -0,0 +1,153 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { RadioType } from './context';
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
4
|
+
/**
|
5
|
+
* @zh 绑定值
|
6
|
+
* @en Value
|
7
|
+
* @vModel
|
8
|
+
*/
|
9
|
+
modelValue: {
|
10
|
+
type: PropType<string | number | boolean>;
|
11
|
+
default: undefined;
|
12
|
+
};
|
13
|
+
/**
|
14
|
+
* @zh 默认是否选中(非受控状态)
|
15
|
+
* @en Whether checked by default (uncontrolled state)
|
16
|
+
*/
|
17
|
+
defaultChecked: {
|
18
|
+
type: BooleanConstructor;
|
19
|
+
default: boolean;
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* @zh 选项的 `value`
|
23
|
+
* @en The `value` of the option
|
24
|
+
*/
|
25
|
+
value: {
|
26
|
+
type: PropType<string | number | boolean>;
|
27
|
+
default: boolean;
|
28
|
+
};
|
29
|
+
/**
|
30
|
+
* @zh 单选的类型
|
31
|
+
* @en Radio type
|
32
|
+
* @values 'radio', 'button'
|
33
|
+
*/
|
34
|
+
type: {
|
35
|
+
type: PropType<RadioType>;
|
36
|
+
default: string;
|
37
|
+
};
|
38
|
+
/**
|
39
|
+
* @zh 是否禁用
|
40
|
+
* @en Whether to disable
|
41
|
+
*/
|
42
|
+
disabled: {
|
43
|
+
type: BooleanConstructor;
|
44
|
+
default: boolean;
|
45
|
+
};
|
46
|
+
uninjectGroupContext: {
|
47
|
+
type: BooleanConstructor;
|
48
|
+
default: boolean;
|
49
|
+
};
|
50
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
51
|
+
'update:modelValue': (value: string | number | boolean) => true;
|
52
|
+
/**
|
53
|
+
* @zh 值改变时触发
|
54
|
+
* @en Trigger when the value changes
|
55
|
+
* @param { string | number | boolean } value
|
56
|
+
* @param {Event} ev
|
57
|
+
*/
|
58
|
+
change: (value: string | number | boolean, ev: Event) => true;
|
59
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
60
|
+
/**
|
61
|
+
* @zh 绑定值
|
62
|
+
* @en Value
|
63
|
+
* @vModel
|
64
|
+
*/
|
65
|
+
modelValue: {
|
66
|
+
type: PropType<string | number | boolean>;
|
67
|
+
default: undefined;
|
68
|
+
};
|
69
|
+
/**
|
70
|
+
* @zh 默认是否选中(非受控状态)
|
71
|
+
* @en Whether checked by default (uncontrolled state)
|
72
|
+
*/
|
73
|
+
defaultChecked: {
|
74
|
+
type: BooleanConstructor;
|
75
|
+
default: boolean;
|
76
|
+
};
|
77
|
+
/**
|
78
|
+
* @zh 选项的 `value`
|
79
|
+
* @en The `value` of the option
|
80
|
+
*/
|
81
|
+
value: {
|
82
|
+
type: PropType<string | number | boolean>;
|
83
|
+
default: boolean;
|
84
|
+
};
|
85
|
+
/**
|
86
|
+
* @zh 单选的类型
|
87
|
+
* @en Radio type
|
88
|
+
* @values 'radio', 'button'
|
89
|
+
*/
|
90
|
+
type: {
|
91
|
+
type: PropType<RadioType>;
|
92
|
+
default: string;
|
93
|
+
};
|
94
|
+
/**
|
95
|
+
* @zh 是否禁用
|
96
|
+
* @en Whether to disable
|
97
|
+
*/
|
98
|
+
disabled: {
|
99
|
+
type: BooleanConstructor;
|
100
|
+
default: boolean;
|
101
|
+
};
|
102
|
+
uninjectGroupContext: {
|
103
|
+
type: BooleanConstructor;
|
104
|
+
default: boolean;
|
105
|
+
};
|
106
|
+
}>> & Readonly<{
|
107
|
+
onChange?: ((value: string | number | boolean, ev: Event) => any) | undefined;
|
108
|
+
"onUpdate:modelValue"?: ((value: string | number | boolean) => any) | undefined;
|
109
|
+
}>, {
|
110
|
+
type: "button" | "radio";
|
111
|
+
disabled: boolean;
|
112
|
+
value: string | number | boolean;
|
113
|
+
modelValue: string | number | boolean;
|
114
|
+
defaultChecked: boolean;
|
115
|
+
uninjectGroupContext: boolean;
|
116
|
+
}, {}, {
|
117
|
+
IconHover: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
118
|
+
prefix: {
|
119
|
+
type: StringConstructor;
|
120
|
+
};
|
121
|
+
size: {
|
122
|
+
type: PropType<"mini" | "small" | "medium" | "large" | "huge">;
|
123
|
+
default: string;
|
124
|
+
};
|
125
|
+
disabled: {
|
126
|
+
type: BooleanConstructor;
|
127
|
+
default: boolean;
|
128
|
+
};
|
129
|
+
}>, {
|
130
|
+
className: {
|
131
|
+
block: string;
|
132
|
+
element: (className: string) => string;
|
133
|
+
modifier: (className: string) => string;
|
134
|
+
is: (className: string) => string;
|
135
|
+
};
|
136
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
137
|
+
prefix: {
|
138
|
+
type: StringConstructor;
|
139
|
+
};
|
140
|
+
size: {
|
141
|
+
type: PropType<"mini" | "small" | "medium" | "large" | "huge">;
|
142
|
+
default: string;
|
143
|
+
};
|
144
|
+
disabled: {
|
145
|
+
type: BooleanConstructor;
|
146
|
+
default: boolean;
|
147
|
+
};
|
148
|
+
}>> & Readonly<{}>, {
|
149
|
+
size: "mini" | "small" | "medium" | "large" | "huge";
|
150
|
+
disabled: boolean;
|
151
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
152
|
+
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
153
|
+
export default _default;
|
@@ -0,0 +1,143 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { Size, Direction } from '../../_utils/constant';
|
3
|
+
import { RadioType } from './context';
|
4
|
+
import { RadioOption } from './interface';
|
5
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
6
|
+
/**
|
7
|
+
* @zh 绑定值
|
8
|
+
* @en Value
|
9
|
+
* @vModel
|
10
|
+
*/
|
11
|
+
modelValue: {
|
12
|
+
type: PropType<string | number | boolean>;
|
13
|
+
default: undefined;
|
14
|
+
};
|
15
|
+
/**
|
16
|
+
* @zh 默认值(非受控状态)
|
17
|
+
* @en Default value (uncontrolled state)
|
18
|
+
*/
|
19
|
+
defaultValue: {
|
20
|
+
type: PropType<string | number | boolean>;
|
21
|
+
default: string;
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* @zh 单选框组的类型
|
25
|
+
* @en Types of radio group
|
26
|
+
* @values 'radio', 'button'
|
27
|
+
*/
|
28
|
+
type: {
|
29
|
+
type: PropType<RadioType>;
|
30
|
+
default: string;
|
31
|
+
};
|
32
|
+
/**
|
33
|
+
* @zh 单选框组的尺寸
|
34
|
+
* @en The size of the radio group
|
35
|
+
* @values 'mini','small','medium','large'
|
36
|
+
*/
|
37
|
+
size: {
|
38
|
+
type: PropType<Size>;
|
39
|
+
};
|
40
|
+
/**
|
41
|
+
* @zh 选项
|
42
|
+
* @en Options
|
43
|
+
* @version 2.27.0
|
44
|
+
*/
|
45
|
+
options: {
|
46
|
+
type: PropType<Array<string | number | RadioOption>>;
|
47
|
+
};
|
48
|
+
/**
|
49
|
+
* @zh 单选框组的方向
|
50
|
+
* @en The direction of the radio group
|
51
|
+
* @values 'horizontal', 'vertical'
|
52
|
+
*/
|
53
|
+
direction: {
|
54
|
+
type: PropType<Direction>;
|
55
|
+
default: string;
|
56
|
+
};
|
57
|
+
/**
|
58
|
+
* @zh 是否禁用
|
59
|
+
* @en Whether to disable
|
60
|
+
*/
|
61
|
+
disabled: {
|
62
|
+
type: BooleanConstructor;
|
63
|
+
default: boolean;
|
64
|
+
};
|
65
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
66
|
+
'update:modelValue': (value: string | number | boolean) => true;
|
67
|
+
/**
|
68
|
+
* @zh 值改变时触发
|
69
|
+
* @en Trigger when the value changes
|
70
|
+
* @property { string | number | boolean } value
|
71
|
+
*/
|
72
|
+
change: (value: string | number | boolean, ev: Event) => true;
|
73
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
74
|
+
/**
|
75
|
+
* @zh 绑定值
|
76
|
+
* @en Value
|
77
|
+
* @vModel
|
78
|
+
*/
|
79
|
+
modelValue: {
|
80
|
+
type: PropType<string | number | boolean>;
|
81
|
+
default: undefined;
|
82
|
+
};
|
83
|
+
/**
|
84
|
+
* @zh 默认值(非受控状态)
|
85
|
+
* @en Default value (uncontrolled state)
|
86
|
+
*/
|
87
|
+
defaultValue: {
|
88
|
+
type: PropType<string | number | boolean>;
|
89
|
+
default: string;
|
90
|
+
};
|
91
|
+
/**
|
92
|
+
* @zh 单选框组的类型
|
93
|
+
* @en Types of radio group
|
94
|
+
* @values 'radio', 'button'
|
95
|
+
*/
|
96
|
+
type: {
|
97
|
+
type: PropType<RadioType>;
|
98
|
+
default: string;
|
99
|
+
};
|
100
|
+
/**
|
101
|
+
* @zh 单选框组的尺寸
|
102
|
+
* @en The size of the radio group
|
103
|
+
* @values 'mini','small','medium','large'
|
104
|
+
*/
|
105
|
+
size: {
|
106
|
+
type: PropType<Size>;
|
107
|
+
};
|
108
|
+
/**
|
109
|
+
* @zh 选项
|
110
|
+
* @en Options
|
111
|
+
* @version 2.27.0
|
112
|
+
*/
|
113
|
+
options: {
|
114
|
+
type: PropType<Array<string | number | RadioOption>>;
|
115
|
+
};
|
116
|
+
/**
|
117
|
+
* @zh 单选框组的方向
|
118
|
+
* @en The direction of the radio group
|
119
|
+
* @values 'horizontal', 'vertical'
|
120
|
+
*/
|
121
|
+
direction: {
|
122
|
+
type: PropType<Direction>;
|
123
|
+
default: string;
|
124
|
+
};
|
125
|
+
/**
|
126
|
+
* @zh 是否禁用
|
127
|
+
* @en Whether to disable
|
128
|
+
*/
|
129
|
+
disabled: {
|
130
|
+
type: BooleanConstructor;
|
131
|
+
default: boolean;
|
132
|
+
};
|
133
|
+
}>> & Readonly<{
|
134
|
+
onChange?: ((value: string | number | boolean, ev: Event) => any) | undefined;
|
135
|
+
"onUpdate:modelValue"?: ((value: string | number | boolean) => any) | undefined;
|
136
|
+
}>, {
|
137
|
+
type: "button" | "radio";
|
138
|
+
disabled: boolean;
|
139
|
+
direction: "horizontal" | "vertical";
|
140
|
+
modelValue: string | number | boolean;
|
141
|
+
defaultValue: string | number | boolean;
|
142
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
143
|
+
export default _default;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { InjectionKey, Slots } from 'vue';
|
2
|
+
import { Size } from '../../_utils/constant';
|
3
|
+
export declare const RADIO_TYPES: readonly ["radio", "button"];
|
4
|
+
export type RadioType = (typeof RADIO_TYPES)[number];
|
5
|
+
export interface RadioGroupContext {
|
6
|
+
name: 'XRadioGroup';
|
7
|
+
value: string | number | boolean;
|
8
|
+
size: Size;
|
9
|
+
type: RadioType;
|
10
|
+
disabled: boolean;
|
11
|
+
slots: Slots;
|
12
|
+
handleChange: (value: string | number | boolean, e: Event) => void;
|
13
|
+
}
|
14
|
+
export declare const radioGroupKey: InjectionKey<RadioGroupContext>;
|