straw-ui-vue 0.1.0
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 +42 -0
- package/dist/_virtual/_plugin-vue_export-helper.cjs +1 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/components/st-button/index.d.ts +162 -0
- package/dist/components/st-button/st-button.vue.cjs +1 -0
- package/dist/components/st-button/st-button.vue.d.ts +29 -0
- package/dist/components/st-button/st-button.vue.js +5 -0
- package/dist/components/st-button/st-button.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-button/st-button.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/components/st-button/types.d.ts +49 -0
- package/dist/components/st-button.cjs +1 -0
- package/dist/components/st-button.js +6 -0
- package/dist/components/st-checkbox/index.d.ts +153 -0
- package/dist/components/st-checkbox/st-checkbox.vue.cjs +1 -0
- package/dist/components/st-checkbox/st-checkbox.vue.d.ts +27 -0
- package/dist/components/st-checkbox/st-checkbox.vue.js +5 -0
- package/dist/components/st-checkbox/st-checkbox.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-checkbox/st-checkbox.vue_vue_type_script_setup_true_lang.js +109 -0
- package/dist/components/st-checkbox/types.d.ts +20 -0
- package/dist/components/st-checkbox-group/index.d.ts +171 -0
- package/dist/components/st-checkbox-group/st-checkbox-group.vue.cjs +1 -0
- package/dist/components/st-checkbox-group/st-checkbox-group.vue.d.ts +29 -0
- package/dist/components/st-checkbox-group/st-checkbox-group.vue.js +5 -0
- package/dist/components/st-checkbox-group/st-checkbox-group.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-checkbox-group/st-checkbox-group.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/st-checkbox-group/types.d.ts +43 -0
- package/dist/components/st-checkbox-group.cjs +1 -0
- package/dist/components/st-checkbox-group.js +6 -0
- package/dist/components/st-checkbox.cjs +1 -0
- package/dist/components/st-checkbox.js +6 -0
- package/dist/components/st-dialog/index.d.ts +243 -0
- package/dist/components/st-dialog/st-dialog.vue.cjs +1 -0
- package/dist/components/st-dialog/st-dialog.vue.d.ts +41 -0
- package/dist/components/st-dialog/st-dialog.vue.js +5 -0
- package/dist/components/st-dialog/st-dialog.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-dialog/st-dialog.vue_vue_type_script_setup_true_lang.js +175 -0
- package/dist/components/st-dialog/types.d.ts +29 -0
- package/dist/components/st-dialog.cjs +1 -0
- package/dist/components/st-dialog.js +6 -0
- package/dist/components/st-input/index.d.ts +315 -0
- package/dist/components/st-input/st-input.vue.cjs +1 -0
- package/dist/components/st-input/st-input.vue.d.ts +48 -0
- package/dist/components/st-input/st-input.vue.js +7 -0
- package/dist/components/st-input/st-input.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-input/st-input.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/st-input/types.d.ts +68 -0
- package/dist/components/st-input.cjs +1 -0
- package/dist/components/st-input.js +6 -0
- package/dist/components/st-menu/index.d.ts +217 -0
- package/dist/components/st-menu/st-menu-node.vue.cjs +1 -0
- package/dist/components/st-menu/st-menu-node.vue.d.ts +14 -0
- package/dist/components/st-menu/st-menu-node.vue.js +5 -0
- package/dist/components/st-menu/st-menu-node.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-menu/st-menu-node.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/components/st-menu/st-menu.vue.cjs +1 -0
- package/dist/components/st-menu/st-menu.vue.d.ts +26 -0
- package/dist/components/st-menu/st-menu.vue.js +5 -0
- package/dist/components/st-menu/st-menu.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-menu/st-menu.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/components/st-menu/types.d.ts +82 -0
- package/dist/components/st-menu.cjs +1 -0
- package/dist/components/st-menu.js +7 -0
- package/dist/components/st-popover/index.d.ts +243 -0
- package/dist/components/st-popover/st-popover.vue.cjs +1 -0
- package/dist/components/st-popover/st-popover.vue.d.ts +37 -0
- package/dist/components/st-popover/st-popover.vue.js +5 -0
- package/dist/components/st-popover/st-popover.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-popover/st-popover.vue_vue_type_script_setup_true_lang.js +355 -0
- package/dist/components/st-popover/types.d.ts +103 -0
- package/dist/components/st-popover.cjs +1 -0
- package/dist/components/st-popover.js +6 -0
- package/dist/components/st-radio/index.d.ts +135 -0
- package/dist/components/st-radio/st-radio.vue.cjs +1 -0
- package/dist/components/st-radio/st-radio.vue.d.ts +28 -0
- package/dist/components/st-radio/st-radio.vue.js +5 -0
- package/dist/components/st-radio/st-radio.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-radio/st-radio.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/components/st-radio/types.d.ts +15 -0
- package/dist/components/st-radio-group/index.d.ts +180 -0
- package/dist/components/st-radio-group/st-radio-group.vue.cjs +1 -0
- package/dist/components/st-radio-group/st-radio-group.vue.d.ts +35 -0
- package/dist/components/st-radio-group/st-radio-group.vue.js +5 -0
- package/dist/components/st-radio-group/st-radio-group.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-radio-group/st-radio-group.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/st-radio-group/types.d.ts +43 -0
- package/dist/components/st-radio-group.cjs +1 -0
- package/dist/components/st-radio-group.js +6 -0
- package/dist/components/st-radio.cjs +1 -0
- package/dist/components/st-radio.js +6 -0
- package/dist/components/st-select/index.d.ts +306 -0
- package/dist/components/st-select/st-select.vue.cjs +1 -0
- package/dist/components/st-select/st-select.vue.d.ts +47 -0
- package/dist/components/st-select/st-select.vue.js +5 -0
- package/dist/components/st-select/st-select.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-select/st-select.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/st-select/types.d.ts +85 -0
- package/dist/components/st-select.cjs +1 -0
- package/dist/components/st-select.js +6 -0
- package/dist/components/st-sidebar/index.d.ts +63 -0
- package/dist/components/st-sidebar/st-sidebar.vue.cjs +1 -0
- package/dist/components/st-sidebar/st-sidebar.vue.d.ts +11 -0
- package/dist/components/st-sidebar/st-sidebar.vue.js +5 -0
- package/dist/components/st-sidebar/st-sidebar.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-sidebar/st-sidebar.vue_vue_type_script_setup_true_lang.js +108 -0
- package/dist/components/st-sidebar/types.d.ts +56 -0
- package/dist/components/st-sidebar-item/index.d.ts +63 -0
- package/dist/components/st-sidebar-item/st-sidebar-item.vue.cjs +1 -0
- package/dist/components/st-sidebar-item/st-sidebar-item.vue.d.ts +11 -0
- package/dist/components/st-sidebar-item/st-sidebar-item.vue.js +5 -0
- package/dist/components/st-sidebar-item/st-sidebar-item.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-sidebar-item/st-sidebar-item.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/components/st-sidebar-item/types.d.ts +19 -0
- package/dist/components/st-sidebar-item.cjs +1 -0
- package/dist/components/st-sidebar-item.js +6 -0
- package/dist/components/st-sidebar.cjs +1 -0
- package/dist/components/st-sidebar.js +6 -0
- package/dist/components/st-splitter/index.d.ts +88 -0
- package/dist/components/st-splitter/st-splitter.vue.cjs +1 -0
- package/dist/components/st-splitter/st-splitter.vue.d.ts +16 -0
- package/dist/components/st-splitter/st-splitter.vue.js +5 -0
- package/dist/components/st-splitter/st-splitter.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-splitter/st-splitter.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/components/st-splitter/types.d.ts +192 -0
- package/dist/components/st-splitter/useSplitter.cjs +1 -0
- package/dist/components/st-splitter/useSplitter.d.ts +24 -0
- package/dist/components/st-splitter/useSplitter.js +129 -0
- package/dist/components/st-splitter-panel/index.d.ts +180 -0
- package/dist/components/st-splitter-panel/st-splitter-panel.vue.cjs +1 -0
- package/dist/components/st-splitter-panel/st-splitter-panel.vue.d.ts +33 -0
- package/dist/components/st-splitter-panel/st-splitter-panel.vue.js +5 -0
- package/dist/components/st-splitter-panel/st-splitter-panel.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-splitter-panel/st-splitter-panel.vue_vue_type_script_setup_true_lang.js +164 -0
- package/dist/components/st-splitter-panel/types.d.ts +27 -0
- package/dist/components/st-splitter-panel.cjs +1 -0
- package/dist/components/st-splitter-panel.js +6 -0
- package/dist/components/st-splitter.cjs +1 -0
- package/dist/components/st-splitter.js +7 -0
- package/dist/components/st-toggle/index.d.ts +159 -0
- package/dist/components/st-toggle/st-toggle.vue.cjs +1 -0
- package/dist/components/st-toggle/st-toggle.vue.d.ts +25 -0
- package/dist/components/st-toggle/st-toggle.vue.js +5 -0
- package/dist/components/st-toggle/st-toggle.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-toggle/st-toggle.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/components/st-toggle/types.d.ts +38 -0
- package/dist/components/st-toggle.cjs +1 -0
- package/dist/components/st-toggle.js +6 -0
- package/dist/components/st-tooltip/index.d.ts +183 -0
- package/dist/components/st-tooltip/st-tooltip.vue.cjs +1 -0
- package/dist/components/st-tooltip/st-tooltip.vue.d.ts +29 -0
- package/dist/components/st-tooltip/st-tooltip.vue.js +5 -0
- package/dist/components/st-tooltip/st-tooltip.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-tooltip/st-tooltip.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/components/st-tooltip/types.d.ts +79 -0
- package/dist/components/st-tooltip.cjs +1 -0
- package/dist/components/st-tooltip.js +6 -0
- package/dist/components/st-tree/index.d.ts +114 -0
- package/dist/components/st-tree/st-tree-node.vue.cjs +1 -0
- package/dist/components/st-tree/st-tree-node.vue.d.ts +4 -0
- package/dist/components/st-tree/st-tree-node.vue.js +5 -0
- package/dist/components/st-tree/st-tree-node.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-tree/st-tree-node.vue_vue_type_script_setup_true_lang.js +87 -0
- package/dist/components/st-tree/st-tree.vue.cjs +1 -0
- package/dist/components/st-tree/st-tree.vue.d.ts +50 -0
- package/dist/components/st-tree/st-tree.vue.js +5 -0
- package/dist/components/st-tree/st-tree.vue_vue_type_script_setup_true_lang.cjs +1 -0
- package/dist/components/st-tree/st-tree.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/st-tree/types.d.ts +87 -0
- package/dist/components/st-tree.cjs +1 -0
- package/dist/components/st-tree.js +6 -0
- package/dist/components/types.d.ts +41 -0
- package/dist/index.cjs +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +3005 -0
- package/dist/index.js +47 -0
- package/dist/utils/cn.cjs +1 -0
- package/dist/utils/cn.d.ts +11 -0
- package/dist/utils/cn.js +8 -0
- package/dist/utils/cva/index.cjs +1 -0
- package/dist/utils/cva/index.d.ts +9 -0
- package/dist/utils/cva/index.js +25 -0
- package/dist/utils/cva/types.d.ts +45 -0
- package/dist/utils/directive/index.cjs +1 -0
- package/dist/utils/directive/index.d.ts +4 -0
- package/dist/utils/directive/index.js +10 -0
- package/dist/utils/directive/intersection.cjs +1 -0
- package/dist/utils/directive/intersection.d.ts +6 -0
- package/dist/utils/directive/intersection.js +20 -0
- package/dist/utils/directive/interval.cjs +1 -0
- package/dist/utils/directive/interval.d.ts +6 -0
- package/dist/utils/directive/interval.js +14 -0
- package/dist/utils/directive/move.cjs +1 -0
- package/dist/utils/directive/move.d.ts +6 -0
- package/dist/utils/directive/move.js +42 -0
- package/dist/utils/directive/resize.cjs +1 -0
- package/dist/utils/directive/resize.d.ts +6 -0
- package/dist/utils/directive/resize.js +17 -0
- package/dist/utils/with-install.cjs +1 -0
- package/dist/utils/with-install.d.ts +4 -0
- package/dist/utils/with-install.js +10 -0
- package/package.json +87 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover 触发方式类型
|
|
3
|
+
* click: 点击触发
|
|
4
|
+
* focus: 聚焦触发
|
|
5
|
+
* hover: 悬停触发
|
|
6
|
+
* contextmenu: 右键菜单触发
|
|
7
|
+
*/
|
|
8
|
+
export type PopoverTrigger = 'click' | 'focus' | 'hover' | 'contextmenu';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Popover 弹出方向类型
|
|
12
|
+
* top-left: 上方左侧对齐
|
|
13
|
+
* top-center: 上方居中对齐
|
|
14
|
+
* top-right: 上方右侧对齐
|
|
15
|
+
* bottom-left: 下方左侧对齐
|
|
16
|
+
* bottom-center: 下方居中对齐
|
|
17
|
+
* bottom-right: 下方右侧对齐
|
|
18
|
+
* left-top: 左侧顶部对齐
|
|
19
|
+
* left-center: 左侧居中对齐
|
|
20
|
+
* left-bottom: 左侧底部对齐
|
|
21
|
+
* right-top: 右侧顶部对齐
|
|
22
|
+
* right-center: 右侧居中对齐
|
|
23
|
+
* right-bottom: 右侧底部对齐
|
|
24
|
+
*/
|
|
25
|
+
export type PopoverPlacement =
|
|
26
|
+
| 'top-left'
|
|
27
|
+
| 'top-center'
|
|
28
|
+
| 'top-right'
|
|
29
|
+
| 'bottom-left'
|
|
30
|
+
| 'bottom-center'
|
|
31
|
+
| 'bottom-right'
|
|
32
|
+
| 'left-top'
|
|
33
|
+
| 'left-center'
|
|
34
|
+
| 'left-bottom'
|
|
35
|
+
| 'right-top'
|
|
36
|
+
| 'right-center'
|
|
37
|
+
| 'right-bottom';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Popover 组件属性接口
|
|
41
|
+
*/
|
|
42
|
+
export interface PopoverProps {
|
|
43
|
+
/** 触发方式 */
|
|
44
|
+
trigger?: PopoverTrigger;
|
|
45
|
+
/** 弹出方向 */
|
|
46
|
+
placement?: PopoverPlacement;
|
|
47
|
+
/** 是否禁用 */
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/** 是否可见 */
|
|
50
|
+
visible?: boolean;
|
|
51
|
+
/** 偏移距离 */
|
|
52
|
+
offset?: number;
|
|
53
|
+
/** 弹出层与触发元素之间的间距 */
|
|
54
|
+
gap?: number;
|
|
55
|
+
/** 是否显示箭头 */
|
|
56
|
+
showArrow?: boolean;
|
|
57
|
+
/** 点击外部是否关闭 */
|
|
58
|
+
closeOnClickOutside?: boolean;
|
|
59
|
+
/** 按ESC键是否关闭 */
|
|
60
|
+
closeOnEsc?: boolean;
|
|
61
|
+
/** hover 触发时显示的延迟时间(毫秒) */
|
|
62
|
+
openDelay?: number;
|
|
63
|
+
/** hover 触发时隐藏的延迟时间(毫秒) */
|
|
64
|
+
closeDelay?: number;
|
|
65
|
+
/** 触发元素的类名 */
|
|
66
|
+
triggerClass?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Popover 组件事件接口
|
|
71
|
+
*/
|
|
72
|
+
export interface PopoverEmits {
|
|
73
|
+
/** 更新可见状态事件 */
|
|
74
|
+
'update:visible': [value: boolean];
|
|
75
|
+
/** 可见状态改变事件 */
|
|
76
|
+
visibleChange: [value: boolean];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Popover 组件插槽接口
|
|
81
|
+
*/
|
|
82
|
+
export interface PopoverSlots {
|
|
83
|
+
/** 默认插槽 */
|
|
84
|
+
default?: () => any;
|
|
85
|
+
/** 弹出内容插槽 */
|
|
86
|
+
content?: () => any;
|
|
87
|
+
/** 触发元素插槽 */
|
|
88
|
+
trigger?: () => any;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Popover 暴露的方法接口
|
|
93
|
+
*/
|
|
94
|
+
export interface PopoverExpose {
|
|
95
|
+
/** 显示弹出层 */
|
|
96
|
+
show: (e?: MouseEvent, immediate?: boolean) => void;
|
|
97
|
+
/** 隐藏弹出层 */
|
|
98
|
+
hide: (immediate?: boolean) => void;
|
|
99
|
+
/** 切换显示状态 */
|
|
100
|
+
toggle: () => void;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../utils/with-install.cjs"),t=require("./st-popover/st-popover.vue.cjs");var n=e.withInstall(t.default);exports.StPopover=n,exports.default=n;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export declare const StRadio: {
|
|
2
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
3
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types.d.ts").RadioProps & {
|
|
4
|
+
modelValue?: string | number | boolean | undefined;
|
|
5
|
+
}> & Readonly<{
|
|
6
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
7
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
9
|
+
}, import("vue").PublicProps, {
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
12
|
+
P: {};
|
|
13
|
+
B: {};
|
|
14
|
+
D: {};
|
|
15
|
+
C: {};
|
|
16
|
+
M: {};
|
|
17
|
+
Defaults: {};
|
|
18
|
+
}, Readonly<import("./types.d.ts").RadioProps & {
|
|
19
|
+
modelValue?: string | number | boolean | undefined;
|
|
20
|
+
}> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
22
|
+
}>, {}, {}, {}, {}, {
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
__isFragment?: never;
|
|
26
|
+
__isTeleport?: never;
|
|
27
|
+
__isSuspense?: never;
|
|
28
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types.d.ts").RadioProps & {
|
|
29
|
+
modelValue?: string | number | boolean | undefined;
|
|
30
|
+
}> & Readonly<{
|
|
31
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
32
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
34
|
+
}, string, {
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
37
|
+
$slots: {
|
|
38
|
+
default?: (props: {}) => any;
|
|
39
|
+
};
|
|
40
|
+
})>>, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
43
|
+
P: {};
|
|
44
|
+
B: {};
|
|
45
|
+
D: {};
|
|
46
|
+
C: {};
|
|
47
|
+
M: {};
|
|
48
|
+
Defaults: {};
|
|
49
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
50
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types.d.ts").RadioProps & {
|
|
51
|
+
modelValue?: string | number | boolean | undefined;
|
|
52
|
+
}> & Readonly<{
|
|
53
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
54
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
55
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
56
|
+
}, import("vue").PublicProps, {
|
|
57
|
+
disabled: boolean;
|
|
58
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
59
|
+
P: {};
|
|
60
|
+
B: {};
|
|
61
|
+
D: {};
|
|
62
|
+
C: {};
|
|
63
|
+
M: {};
|
|
64
|
+
Defaults: {};
|
|
65
|
+
}, Readonly<import("./types.d.ts").RadioProps & {
|
|
66
|
+
modelValue?: string | number | boolean | undefined;
|
|
67
|
+
}> & Readonly<{
|
|
68
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
69
|
+
}>, {}, {}, {}, {}, {
|
|
70
|
+
disabled: boolean;
|
|
71
|
+
}>;
|
|
72
|
+
__isFragment?: never;
|
|
73
|
+
__isTeleport?: never;
|
|
74
|
+
__isSuspense?: never;
|
|
75
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types.d.ts").RadioProps & {
|
|
76
|
+
modelValue?: string | number | boolean | undefined;
|
|
77
|
+
}> & Readonly<{
|
|
78
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
79
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
80
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
81
|
+
}, string, {
|
|
82
|
+
disabled: boolean;
|
|
83
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
84
|
+
$slots: {
|
|
85
|
+
default?: (props: {}) => any;
|
|
86
|
+
};
|
|
87
|
+
})>>, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, {
|
|
88
|
+
[x: string]: any;
|
|
89
|
+
}>;
|
|
90
|
+
__isFragment?: never;
|
|
91
|
+
__isTeleport?: never;
|
|
92
|
+
__isSuspense?: never;
|
|
93
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
94
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types.d.ts").RadioProps & {
|
|
95
|
+
modelValue?: string | number | boolean | undefined;
|
|
96
|
+
}> & Readonly<{
|
|
97
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
98
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
99
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
100
|
+
}, import("vue").PublicProps, {
|
|
101
|
+
disabled: boolean;
|
|
102
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
103
|
+
P: {};
|
|
104
|
+
B: {};
|
|
105
|
+
D: {};
|
|
106
|
+
C: {};
|
|
107
|
+
M: {};
|
|
108
|
+
Defaults: {};
|
|
109
|
+
}, Readonly<import("./types.d.ts").RadioProps & {
|
|
110
|
+
modelValue?: string | number | boolean | undefined;
|
|
111
|
+
}> & Readonly<{
|
|
112
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
113
|
+
}>, {}, {}, {}, {}, {
|
|
114
|
+
disabled: boolean;
|
|
115
|
+
}>;
|
|
116
|
+
__isFragment?: never;
|
|
117
|
+
__isTeleport?: never;
|
|
118
|
+
__isSuspense?: never;
|
|
119
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types.d.ts").RadioProps & {
|
|
120
|
+
modelValue?: string | number | boolean | undefined;
|
|
121
|
+
}> & Readonly<{
|
|
122
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
123
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
124
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
125
|
+
}, string, {
|
|
126
|
+
disabled: boolean;
|
|
127
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
128
|
+
$slots: {
|
|
129
|
+
default?: (props: {}) => any;
|
|
130
|
+
};
|
|
131
|
+
})>>, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
132
|
+
[x: string]: any;
|
|
133
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & (import("vue").VNodeProps & (import("vue").AllowedComponentProps & (import("vue").ComponentCustomProps & import("vue").Plugin)));
|
|
134
|
+
export default StRadio;
|
|
135
|
+
export type * from './types.d.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=require("./st-radio.vue_vue_type_script_setup_true_lang.cjs").default;exports.default=e;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RadioProps } from './types.d.ts';
|
|
2
|
+
type __VLS_Props = RadioProps;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 双向绑定值
|
|
6
|
+
* */
|
|
7
|
+
modelValue?: string | number | boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare var __VLS_1: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
18
|
+
}>, {
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../utils/cn.cjs"),t=require("../../utils/cva/index.cjs");let n=require("vue");var r=[`checked`,`disabled`],i=(0,n.defineComponent)({inheritAttrs:!1,__name:`st-radio`,props:(0,n.mergeModels)({value:{type:[String,Number,Boolean]},disabled:{type:Boolean,default:!1}},{modelValue:{type:[String,Number,Boolean]},modelModifiers:{}}),emits:[`update:modelValue`],setup(i){let a=(0,n.useAttrs)(),o=i,s=(0,n.useModel)(i,`modelValue`),c=(0,n.useSlots)(),l=(0,n.computed)(()=>!!c.default),u=(0,n.computed)(()=>s.value===o.value),d=t.cva({base:`inline-flex items-center cursor-pointer select-none gap-2`,variants:{disabled:{true:`cursor-not-allowed opacity-50`,false:``}}}),f=(0,n.computed)(()=>e.cn(d({disabled:o.disabled}),a.class)),p=(0,n.computed)(()=>e.cn(`sr-only`)),m=t.cva({base:`flex items-center justify-center border-2 rounded-full transition-all duration-200 p-0.5 w-5 h-5`,variants:{checked:{true:`border-primary`,false:`border-input hover:border-ring`},disabled:{true:`cursor-not-allowed`,false:`cursor-pointer`}}}),h=(0,n.computed)(()=>m({checked:u.value,disabled:o.disabled})),g=t.cva({base:`w-full h-full rounded-full bg-primary transition-transform duration-200`,variants:{checked:{true:`scale-100`,false:`scale-0`}}}),_=(0,n.computed)(()=>g({checked:u.value})),v=t.cva({base:`text-foreground text-sm`,variants:{disabled:{true:`text-muted-foreground`,false:``}}}),y=(0,n.computed)(()=>v({disabled:o.disabled})),b=e=>{o.disabled&&e.preventDefault()};function x(){o.disabled||(s.value=o.value)}return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`label`,{class:(0,n.normalizeClass)(f.value),style:(0,n.normalizeStyle)((0,n.unref)(a).style),onClick:b},[(0,n.createElementVNode)(`input`,{checked:u.value,class:(0,n.normalizeClass)(p.value),disabled:i.disabled,type:`radio`,onChange:x},null,42,r),(0,n.createElementVNode)(`span`,{class:(0,n.normalizeClass)(h.value)},[(0,n.createElementVNode)(`span`,{class:(0,n.normalizeClass)(_.value)},null,2)],2),l.value?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:0,class:(0,n.normalizeClass)(y.value)},[(0,n.renderSlot)(e.$slots,`default`)],2)):(0,n.createCommentVNode)(``,!0)],6))}});exports.default=i;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { cva as t } from "../../utils/cva/index.js";
|
|
3
|
+
import { computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, mergeModels as s, normalizeClass as c, normalizeStyle as l, openBlock as u, renderSlot as d, unref as f, useAttrs as p, useModel as m, useSlots as h } from "vue";
|
|
4
|
+
//#region src/components/st-radio/st-radio.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var g = ["checked", "disabled"], _ = /*@__PURE__*/ o({
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "st-radio",
|
|
8
|
+
props: /*@__PURE__*/ s({
|
|
9
|
+
value: { type: [
|
|
10
|
+
String,
|
|
11
|
+
Number,
|
|
12
|
+
Boolean
|
|
13
|
+
] },
|
|
14
|
+
disabled: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
}
|
|
18
|
+
}, {
|
|
19
|
+
modelValue: { type: [
|
|
20
|
+
String,
|
|
21
|
+
Number,
|
|
22
|
+
Boolean
|
|
23
|
+
] },
|
|
24
|
+
modelModifiers: {}
|
|
25
|
+
}),
|
|
26
|
+
emits: ["update:modelValue"],
|
|
27
|
+
setup(o) {
|
|
28
|
+
let s = p(), _ = o, v = m(o, "modelValue"), y = h(), b = n(() => !!y.default), x = n(() => v.value === _.value), S = t({
|
|
29
|
+
base: "inline-flex items-center cursor-pointer select-none gap-2",
|
|
30
|
+
variants: { disabled: {
|
|
31
|
+
true: "cursor-not-allowed opacity-50",
|
|
32
|
+
false: ""
|
|
33
|
+
} }
|
|
34
|
+
}), C = n(() => e(S({ disabled: _.disabled }), s.class)), w = n(() => e("sr-only")), T = t({
|
|
35
|
+
base: "flex items-center justify-center border-2 rounded-full transition-all duration-200 p-0.5 w-5 h-5",
|
|
36
|
+
variants: {
|
|
37
|
+
checked: {
|
|
38
|
+
true: "border-primary",
|
|
39
|
+
false: "border-input hover:border-ring"
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
true: "cursor-not-allowed",
|
|
43
|
+
false: "cursor-pointer"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}), E = n(() => T({
|
|
47
|
+
checked: x.value,
|
|
48
|
+
disabled: _.disabled
|
|
49
|
+
})), D = t({
|
|
50
|
+
base: "w-full h-full rounded-full bg-primary transition-transform duration-200",
|
|
51
|
+
variants: { checked: {
|
|
52
|
+
true: "scale-100",
|
|
53
|
+
false: "scale-0"
|
|
54
|
+
} }
|
|
55
|
+
}), O = n(() => D({ checked: x.value })), k = t({
|
|
56
|
+
base: "text-foreground text-sm",
|
|
57
|
+
variants: { disabled: {
|
|
58
|
+
true: "text-muted-foreground",
|
|
59
|
+
false: ""
|
|
60
|
+
} }
|
|
61
|
+
}), A = n(() => k({ disabled: _.disabled })), j = (e) => {
|
|
62
|
+
_.disabled && e.preventDefault();
|
|
63
|
+
};
|
|
64
|
+
function M() {
|
|
65
|
+
_.disabled || (v.value = _.value);
|
|
66
|
+
}
|
|
67
|
+
return (e, t) => (u(), i("label", {
|
|
68
|
+
class: c(C.value),
|
|
69
|
+
style: l(f(s).style),
|
|
70
|
+
onClick: j
|
|
71
|
+
}, [
|
|
72
|
+
a("input", {
|
|
73
|
+
checked: x.value,
|
|
74
|
+
class: c(w.value),
|
|
75
|
+
disabled: o.disabled,
|
|
76
|
+
type: "radio",
|
|
77
|
+
onChange: M
|
|
78
|
+
}, null, 42, g),
|
|
79
|
+
a("span", { class: c(E.value) }, [a("span", { class: c(O.value) }, null, 2)], 2),
|
|
80
|
+
b.value ? (u(), i("span", {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: c(A.value)
|
|
83
|
+
}, [d(e.$slots, "default")], 2)) : r("", !0)
|
|
84
|
+
], 6));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//#endregion
|
|
88
|
+
export { _ as default };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export declare const StRadioGroup: {
|
|
2
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
3
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types.d.ts").RadioGroupProps & {
|
|
4
|
+
modelValue?: string | number | boolean | undefined;
|
|
5
|
+
}> & Readonly<{
|
|
6
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
7
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
9
|
+
}, import("vue").PublicProps, {
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
list: import("./types.d.ts").RadioGroupItem[];
|
|
12
|
+
labelKey: string;
|
|
13
|
+
valueKey: string;
|
|
14
|
+
direction: import("./types.d.ts").RadioGroupDirection;
|
|
15
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
16
|
+
P: {};
|
|
17
|
+
B: {};
|
|
18
|
+
D: {};
|
|
19
|
+
C: {};
|
|
20
|
+
M: {};
|
|
21
|
+
Defaults: {};
|
|
22
|
+
}, Readonly<import("./types.d.ts").RadioGroupProps & {
|
|
23
|
+
modelValue?: string | number | boolean | undefined;
|
|
24
|
+
}> & Readonly<{
|
|
25
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
26
|
+
}>, {}, {}, {}, {}, {
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
list: import("./types.d.ts").RadioGroupItem[];
|
|
29
|
+
labelKey: string;
|
|
30
|
+
valueKey: string;
|
|
31
|
+
direction: import("./types.d.ts").RadioGroupDirection;
|
|
32
|
+
}>;
|
|
33
|
+
__isFragment?: never;
|
|
34
|
+
__isTeleport?: never;
|
|
35
|
+
__isSuspense?: never;
|
|
36
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types.d.ts").RadioGroupProps & {
|
|
37
|
+
modelValue?: string | number | boolean | undefined;
|
|
38
|
+
}> & Readonly<{
|
|
39
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
40
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
42
|
+
}, string, {
|
|
43
|
+
disabled: boolean;
|
|
44
|
+
list: import("./types.d.ts").RadioGroupItem[];
|
|
45
|
+
labelKey: string;
|
|
46
|
+
valueKey: string;
|
|
47
|
+
direction: import("./types.d.ts").RadioGroupDirection;
|
|
48
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
49
|
+
$slots: {
|
|
50
|
+
default?: (props: {
|
|
51
|
+
modelValue: string | number | boolean;
|
|
52
|
+
disabled: boolean;
|
|
53
|
+
}) => any;
|
|
54
|
+
};
|
|
55
|
+
})>>, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
56
|
+
[x: string]: any;
|
|
57
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
58
|
+
P: {};
|
|
59
|
+
B: {};
|
|
60
|
+
D: {};
|
|
61
|
+
C: {};
|
|
62
|
+
M: {};
|
|
63
|
+
Defaults: {};
|
|
64
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
65
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types.d.ts").RadioGroupProps & {
|
|
66
|
+
modelValue?: string | number | boolean | undefined;
|
|
67
|
+
}> & Readonly<{
|
|
68
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
69
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
70
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
71
|
+
}, import("vue").PublicProps, {
|
|
72
|
+
disabled: boolean;
|
|
73
|
+
list: import("./types.d.ts").RadioGroupItem[];
|
|
74
|
+
labelKey: string;
|
|
75
|
+
valueKey: string;
|
|
76
|
+
direction: import("./types.d.ts").RadioGroupDirection;
|
|
77
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
78
|
+
P: {};
|
|
79
|
+
B: {};
|
|
80
|
+
D: {};
|
|
81
|
+
C: {};
|
|
82
|
+
M: {};
|
|
83
|
+
Defaults: {};
|
|
84
|
+
}, Readonly<import("./types.d.ts").RadioGroupProps & {
|
|
85
|
+
modelValue?: string | number | boolean | undefined;
|
|
86
|
+
}> & Readonly<{
|
|
87
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
88
|
+
}>, {}, {}, {}, {}, {
|
|
89
|
+
disabled: boolean;
|
|
90
|
+
list: import("./types.d.ts").RadioGroupItem[];
|
|
91
|
+
labelKey: string;
|
|
92
|
+
valueKey: string;
|
|
93
|
+
direction: import("./types.d.ts").RadioGroupDirection;
|
|
94
|
+
}>;
|
|
95
|
+
__isFragment?: never;
|
|
96
|
+
__isTeleport?: never;
|
|
97
|
+
__isSuspense?: never;
|
|
98
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types.d.ts").RadioGroupProps & {
|
|
99
|
+
modelValue?: string | number | boolean | undefined;
|
|
100
|
+
}> & Readonly<{
|
|
101
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
102
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
103
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
104
|
+
}, string, {
|
|
105
|
+
disabled: boolean;
|
|
106
|
+
list: import("./types.d.ts").RadioGroupItem[];
|
|
107
|
+
labelKey: string;
|
|
108
|
+
valueKey: string;
|
|
109
|
+
direction: import("./types.d.ts").RadioGroupDirection;
|
|
110
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
111
|
+
$slots: {
|
|
112
|
+
default?: (props: {
|
|
113
|
+
modelValue: string | number | boolean;
|
|
114
|
+
disabled: boolean;
|
|
115
|
+
}) => any;
|
|
116
|
+
};
|
|
117
|
+
})>>, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, {
|
|
118
|
+
[x: string]: any;
|
|
119
|
+
}>;
|
|
120
|
+
__isFragment?: never;
|
|
121
|
+
__isTeleport?: never;
|
|
122
|
+
__isSuspense?: never;
|
|
123
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
124
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types.d.ts").RadioGroupProps & {
|
|
125
|
+
modelValue?: string | number | boolean | undefined;
|
|
126
|
+
}> & Readonly<{
|
|
127
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
128
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
129
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
130
|
+
}, import("vue").PublicProps, {
|
|
131
|
+
disabled: boolean;
|
|
132
|
+
list: import("./types.d.ts").RadioGroupItem[];
|
|
133
|
+
labelKey: string;
|
|
134
|
+
valueKey: string;
|
|
135
|
+
direction: import("./types.d.ts").RadioGroupDirection;
|
|
136
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
137
|
+
P: {};
|
|
138
|
+
B: {};
|
|
139
|
+
D: {};
|
|
140
|
+
C: {};
|
|
141
|
+
M: {};
|
|
142
|
+
Defaults: {};
|
|
143
|
+
}, Readonly<import("./types.d.ts").RadioGroupProps & {
|
|
144
|
+
modelValue?: string | number | boolean | undefined;
|
|
145
|
+
}> & Readonly<{
|
|
146
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
147
|
+
}>, {}, {}, {}, {}, {
|
|
148
|
+
disabled: boolean;
|
|
149
|
+
list: import("./types.d.ts").RadioGroupItem[];
|
|
150
|
+
labelKey: string;
|
|
151
|
+
valueKey: string;
|
|
152
|
+
direction: import("./types.d.ts").RadioGroupDirection;
|
|
153
|
+
}>;
|
|
154
|
+
__isFragment?: never;
|
|
155
|
+
__isTeleport?: never;
|
|
156
|
+
__isSuspense?: never;
|
|
157
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types.d.ts").RadioGroupProps & {
|
|
158
|
+
modelValue?: string | number | boolean | undefined;
|
|
159
|
+
}> & Readonly<{
|
|
160
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
161
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
162
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
163
|
+
}, string, {
|
|
164
|
+
disabled: boolean;
|
|
165
|
+
list: import("./types.d.ts").RadioGroupItem[];
|
|
166
|
+
labelKey: string;
|
|
167
|
+
valueKey: string;
|
|
168
|
+
direction: import("./types.d.ts").RadioGroupDirection;
|
|
169
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
170
|
+
$slots: {
|
|
171
|
+
default?: (props: {
|
|
172
|
+
modelValue: string | number | boolean;
|
|
173
|
+
disabled: boolean;
|
|
174
|
+
}) => any;
|
|
175
|
+
};
|
|
176
|
+
})>>, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
177
|
+
[x: string]: any;
|
|
178
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & (import("vue").VNodeProps & (import("vue").AllowedComponentProps & (import("vue").ComponentCustomProps & import("vue").Plugin)));
|
|
179
|
+
export default StRadioGroup;
|
|
180
|
+
export type * from './types.d.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=require("./st-radio-group.vue_vue_type_script_setup_true_lang.cjs").default;exports.default=e;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { RadioGroupItem, RadioGroupProps, RadioGroupDirection } from './types.d.ts';
|
|
2
|
+
type __VLS_Props = RadioGroupProps;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 双向绑定值
|
|
6
|
+
* */
|
|
7
|
+
modelValue?: string | number | boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare var __VLS_7: {
|
|
11
|
+
modelValue: string | number | boolean;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
default?: (props: typeof __VLS_7) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:modelValue": (value: string | number | boolean) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: (value: string | number | boolean) => any;
|
|
21
|
+
}>, {
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
list: RadioGroupItem[];
|
|
24
|
+
labelKey: string;
|
|
25
|
+
valueKey: string;
|
|
26
|
+
direction: RadioGroupDirection;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../utils/cn.cjs"),t=require("../../utils/cva/index.cjs"),n=require("../st-radio/st-radio.vue.cjs");let r=require("vue");var i=(0,r.defineComponent)({inheritAttrs:!1,__name:`st-radio-group`,props:(0,r.mergeModels)({list:{default:void 0},labelKey:{default:`label`},valueKey:{default:`value`},disabled:{type:Boolean,default:!1},direction:{default:`horizontal`}},{modelValue:{type:[String,Number,Boolean]},modelModifiers:{}}),emits:[`update:modelValue`],setup(i){let a=(0,r.useAttrs)(),o=i,s=(0,r.useModel)(i,`modelValue`),c=(0,r.computed)(()=>!!(o.list&&o.list.length>0)),l=t.cva({base:`flex`,variants:{direction:{horizontal:`flex-row gap-4`,vertical:`flex-col gap-2`}},defaultVariants:{direction:`horizontal`}}),u=(0,r.computed)(()=>e.cn(l({direction:o.direction}),a.class));function d(e){return String(e[o.labelKey]??``)}function f(e){let t=e[o.valueKey];return typeof t==`boolean`?String(t):t}return(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)(u.value),style:(0,r.normalizeStyle)((0,r.unref)(a).style)},[c.value?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:0},(0,r.renderList)(o.list,e=>((0,r.openBlock)(),(0,r.createBlock)(n.default,{key:f(e),modelValue:s.value,"onUpdate:modelValue":t[0]||=e=>s.value=e,disabled:o.disabled,value:f(e)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(d(e)),1)]),_:2},1032,[`modelValue`,`disabled`,`value`]))),128)):(0,r.renderSlot)(e.$slots,`default`,(0,r.normalizeProps)((0,r.mergeProps)({key:1},{modelValue:s.value,disabled:o.disabled})))],6))}});exports.default=i;
|