geekin-devtoys 0.3.11 → 0.4.2

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.
Files changed (94) hide show
  1. package/lib/{GBubble → GBranched}/index.js +1 -1
  2. package/lib/GBranched/index.mjs +5 -0
  3. package/lib/GBranched/style.css +1 -0
  4. package/lib/GBranched-BtF7heMk.js +1 -0
  5. package/lib/GBranched-vnLlYOl9.mjs +197 -0
  6. package/lib/GButton/index.js +1 -1
  7. package/lib/GButton/index.mjs +10 -10
  8. package/lib/GButton/style.css +1 -1
  9. package/lib/GCard/index.js +1 -1
  10. package/lib/GCard/index.mjs +1 -1
  11. package/lib/GDialog/index.js +1 -1
  12. package/lib/GDialog/index.mjs +29 -29
  13. package/lib/GDialog/style.css +1 -1
  14. package/lib/GDropdown/index.js +1 -0
  15. package/lib/GDropdown/index.mjs +278 -0
  16. package/lib/GDropdown/style.css +1 -0
  17. package/lib/GInput/index.js +1 -1
  18. package/lib/GInput/index.mjs +2 -2
  19. package/lib/GInput/style.css +1 -1
  20. package/lib/GPicker/index.js +1 -0
  21. package/lib/{GInputTreeTag → GPicker}/index.mjs +111 -111
  22. package/lib/GPicker/style.css +1 -0
  23. package/lib/GPicker.d.ts +1 -0
  24. package/lib/GPie3D/index.js +1 -1
  25. package/lib/GPie3D/index.mjs +1 -1
  26. package/lib/GPluginVideo/index.js +1 -1
  27. package/lib/GPluginVideo/index.mjs +59 -58
  28. package/lib/GProgress/index.js +1 -1
  29. package/lib/GProgress/index.mjs +1 -1
  30. package/lib/GRadio/index.js +1 -0
  31. package/lib/GRadio/index.mjs +198 -0
  32. package/lib/GRadio/style.css +1 -0
  33. package/lib/GRadio.d.ts +1 -0
  34. package/lib/GRing/index.js +1 -1
  35. package/lib/GRing/index.mjs +1 -1
  36. package/lib/GScroller/index.js +1 -1
  37. package/lib/GScroller/index.mjs +1 -1
  38. package/lib/GSegment/index.js +1 -0
  39. package/lib/GSegment/index.mjs +364 -0
  40. package/lib/GSegment/style.css +1 -0
  41. package/lib/GSegment.d.ts +1 -0
  42. package/lib/GSlider/index.js +1 -0
  43. package/lib/GSlider/index.mjs +184 -0
  44. package/lib/GSlider/style.css +1 -0
  45. package/lib/GSlider.d.ts +1 -0
  46. package/lib/GSteps/index.js +1 -1
  47. package/lib/GSteps/index.mjs +1 -1
  48. package/lib/GTable/index.js +1 -1
  49. package/lib/GTable/index.mjs +1 -1
  50. package/lib/GTag/index.js +1 -1
  51. package/lib/GTag/index.mjs +7 -5
  52. package/lib/GTag/style.css +1 -0
  53. package/lib/GToast/index.js +1 -0
  54. package/lib/GToast/index.mjs +292 -0
  55. package/lib/GToast/style.css +1 -0
  56. package/lib/GToast.d.ts +1 -0
  57. package/lib/GTree/index.js +1 -1
  58. package/lib/GTree/index.mjs +1 -1
  59. package/lib/GVideo/index.js +2 -2
  60. package/lib/GVideo/index.mjs +1 -1
  61. package/lib/components/GBranched/index.d.ts +29 -0
  62. package/lib/components/GBranched/types.d.ts +139 -0
  63. package/lib/components/GDialog/index.d.ts +3 -90
  64. package/lib/components/GDialog/types.d.ts +89 -0
  65. package/lib/components/GDropdown/index.d.ts +59 -0
  66. package/lib/components/GRadio/index.d.ts +45 -0
  67. package/lib/components/GRadio/types.d.ts +94 -0
  68. package/lib/components/GScroller/index.d.ts +1 -1
  69. package/lib/components/GSegment/index.d.ts +30 -0
  70. package/lib/components/GSegment/types.d.ts +125 -0
  71. package/lib/components/GShinyText/index.d.ts +1 -1
  72. package/lib/components/GSlider/index.d.ts +27 -0
  73. package/lib/components/GSlider/types.d.ts +88 -0
  74. package/lib/components/GTag/index.d.ts +3 -0
  75. package/lib/components/GToast/ToastCard.d.ts +9 -0
  76. package/lib/components/GToast/index.d.ts +7 -0
  77. package/lib/components/GToast/store.d.ts +46 -0
  78. package/lib/components/GToast/types.d.ts +121 -0
  79. package/lib/index/index.js +1 -1
  80. package/lib/index/index.mjs +70 -53
  81. package/lib/index/style.css +17 -5
  82. package/lib/index.d.ts +16 -5
  83. package/package.json +58 -13
  84. package/lib/GBubble/index.mjs +0 -5
  85. package/lib/GBubble/style.css +0 -1
  86. package/lib/GBubble-C3cM9Put.mjs +0 -216
  87. package/lib/GBubble-Dph0YDkU.js +0 -2
  88. package/lib/GInputTreeTag/index.js +0 -1
  89. package/lib/GInputTreeTag/style.css +0 -1
  90. package/lib/assets/GTag.css +0 -1
  91. package/lib/components/GBubble/index.d.ts +0 -61
  92. /package/lib/{GBubble.d.ts → GBranched.d.ts} +0 -0
  93. /package/lib/{GInputTreeTag.d.ts → GDropdown.d.ts} +0 -0
  94. /package/lib/components/{GInputTreeTag → GPicker}/index.d.ts +0 -0
@@ -0,0 +1,139 @@
1
+ import { Component } from 'vue';
2
+ /** GBranched 组件 Props */
3
+ /** 子项(叶子节点) */
4
+ export interface GBranchedChild {
5
+ /**
6
+ * @description 选中值,同级内需唯一
7
+ * @version 0.3.13
8
+ */
9
+ value: string;
10
+ /**
11
+ * @description 显示文本
12
+ * @version 0.3.13
13
+ */
14
+ label: string;
15
+ /**
16
+ * @description 图标,传任意 Vue 组件
17
+ * @version 0.3.13
18
+ * @default undefined
19
+ */
20
+ icon?: Component;
21
+ }
22
+ /** 顶层条目,带 children 时为可折叠分组,否则为叶子项 */
23
+ export interface GBranchedItem {
24
+ /**
25
+ * @description 分组标题(无 children 时兼作选中值)
26
+ * @version 0.3.13
27
+ */
28
+ label: string;
29
+ /**
30
+ * @description 叶子项的选中值,无 children 时使用
31
+ * @version 0.3.13
32
+ * @default undefined
33
+ */
34
+ value?: string;
35
+ /**
36
+ * @description 子项列表,传入后该条目渲染为可折叠分组
37
+ * @version 0.3.13
38
+ * @default undefined
39
+ */
40
+ children?: GBranchedChild[];
41
+ }
42
+ export interface GBranchedProps {
43
+ /**
44
+ * @description 菜单数据,不传时使用内置示例数据
45
+ * @version 0.3.13
46
+ * @default undefined
47
+ */
48
+ items?: GBranchedItem[];
49
+ /**
50
+ * @description 初始展开的分组序号(可传数组展开多个)
51
+ * @version 0.3.13
52
+ * @default 0
53
+ */
54
+ defaultOpen?: number | number[];
55
+ /**
56
+ * @description 初始选中的子项 value,未传时默认选中第一个展开分组的第一个子项
57
+ * @version 0.3.13
58
+ * @default ''
59
+ */
60
+ defaultActive?: string;
61
+ /**
62
+ * @description 文字颜色,不传时随明暗模式自适应(浅色下近黑、暗色下近白)
63
+ * @version 0.3.13
64
+ * @default undefined
65
+ */
66
+ color?: string;
67
+ /**
68
+ * @description 强调色(选中项文字与进度描边),不传时随明暗模式自适应
69
+ * @version 0.3.13
70
+ * @default undefined
71
+ */
72
+ accentColor?: string;
73
+ /**
74
+ * @description 连接线颜色(左侧树干与分支路径),不传时随明暗模式自适应
75
+ * @version 0.3.13
76
+ * @default undefined
77
+ */
78
+ lineColor?: string;
79
+ /**
80
+ * @description 菜单最大宽度(px),内容超出时按容器宽度收缩
81
+ * @version 0.3.13
82
+ * @default 240
83
+ */
84
+ width?: number;
85
+ /**
86
+ * @description 子项行高(px)
87
+ * @version 0.3.13
88
+ * @default 36
89
+ */
90
+ rowHeight?: number;
91
+ /**
92
+ * @description 子项文字缩进(px),同时决定分支横线的终点位置
93
+ * @version 0.3.13
94
+ * @default 40
95
+ */
96
+ indent?: number;
97
+ /**
98
+ * @description 树干(左侧垂直线)距左边缘的距离(px)
99
+ * @version 0.3.13
100
+ * @default 14
101
+ */
102
+ trunk?: number;
103
+ /**
104
+ * @description 分支拐角的圆角半径(px),自动钳制到行高允许的最大值
105
+ * @version 0.3.13
106
+ * @default 10
107
+ */
108
+ radius?: number;
109
+ /**
110
+ * @description 连接线粗细(px)
111
+ * @version 0.3.13
112
+ * @default 1.5
113
+ */
114
+ lineWidth?: number;
115
+ /**
116
+ * @description 文字字号(px),分组标题在此基础上 +1
117
+ * @version 0.3.13
118
+ * @default 14
119
+ */
120
+ fontSize?: number;
121
+ /**
122
+ * @description 选中描边(进度线)的绘制时长(ms)
123
+ * @version 0.3.13
124
+ * @default 400
125
+ */
126
+ drawDuration?: number;
127
+ /**
128
+ * @description 分组折叠/展开的时长(ms)
129
+ * @version 0.3.13
130
+ * @default 300
131
+ */
132
+ foldDuration?: number;
133
+ /**
134
+ * @description 根元素附加 class
135
+ * @version 0.3.13
136
+ * @default ''
137
+ */
138
+ className?: string;
139
+ }
@@ -1,91 +1,4 @@
1
- import { DialogCloseAction, FooterAction } from './const';
2
- interface Props {
3
- /**
4
- * @description 标题名
5
- * @version 0.1.6
6
- * @default ''
7
- */
8
- title: string;
9
- /**
10
- * @description 对话框尺寸
11
- * @version 0.1.6
12
- * @default 'medium'
13
- */
14
- size?: 'small' | 'medium' | 'large' | string;
15
- /**
16
- * @description 是否显示对话框
17
- * @version 0.1.6
18
- * @default false
19
- */
20
- modelValue?: boolean;
21
- /**
22
- * @description 是否隐藏底部操作区(包含取消/重置/保存与自定义 actions)
23
- * @version 0.2.18
24
- * @default false
25
- */
26
- hideFooter?: boolean;
27
- /**
28
- * @description 自定义底部操作按钮组。配置后会替换默认的 取消/重置/保存
29
- * @version 0.2.18
30
- * @default undefined
31
- */
32
- actions?: FooterAction[];
33
- /**
34
- * @description 是否显示默认「取消」按钮(actions 模式下无效)
35
- * @version 0.2.18
36
- * @default true
37
- */
38
- showCancel?: boolean;
39
- /**
40
- * @description 是否显示默认「重置」按钮(actions 模式下无效)
41
- * @version 0.2.18
42
- * @default true
43
- */
44
- showReset?: boolean;
45
- /**
46
- * @description 是否显示默认「保存」按钮(actions 模式下无效)
47
- * @version 0.2.18
48
- * @default true
49
- */
50
- showSave?: boolean;
51
- /**
52
- * @description 默认「取消」按钮文案
53
- * @version 0.2.18
54
- * @default '取消'
55
- */
56
- cancelText?: string;
57
- /**
58
- * @description 默认「重置」按钮文案
59
- * @version 0.2.18
60
- * @default '重置'
61
- */
62
- resetText?: string;
63
- /**
64
- * @description 默认「保存」按钮文案
65
- * @version 0.2.18
66
- * @default '保存'
67
- */
68
- saveText?: string;
69
- /**
70
- * @description 保存按钮 loading 态(异步保存时使用)
71
- * @version 0.2.18
72
- * @default false
73
- */
74
- saveLoading?: boolean;
75
- /**
76
- * @description 保存按钮禁用态
77
- * @version 0.2.18
78
- * @default false
79
- */
80
- saveDisabled?: boolean;
81
- /**
82
- * @description 关闭前钩子。返回 false 或 Promise<false> 时取消关闭。
83
- * 触发时机:点击关闭/最小化/ESC/蒙层/取消/保存
84
- * @version 0.2.18
85
- * @default undefined
86
- */
87
- beforeClose?: (action: DialogCloseAction) => boolean | Promise<boolean>;
88
- }
1
+ import { GDialogProps } from './types';
89
2
  /** 标题栏关闭按钮 / ESC / 蒙层 / 作用域插槽 close 调用入口 */
90
3
  declare function handleClose(): Promise<void>;
91
4
  /** 取消按钮 */
@@ -111,14 +24,14 @@ declare function __VLS_template(): {
111
24
  rootEl: any;
112
25
  };
113
26
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
114
- declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
27
+ declare const __VLS_component: import('vue').DefineComponent<GDialogProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
115
28
  reset: () => any;
116
29
  cancel: () => any;
117
30
  minimize: (data: any) => any;
118
31
  save: () => any;
119
32
  action: (key: string) => any;
120
33
  "update:modelValue": (value: boolean) => any;
121
- }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
34
+ }, string, import('vue').PublicProps, Readonly<GDialogProps> & Readonly<{
122
35
  onReset?: (() => any) | undefined;
123
36
  onCancel?: (() => any) | undefined;
124
37
  onMinimize?: ((data: any) => any) | undefined;
@@ -0,0 +1,89 @@
1
+ import { DialogCloseAction, FooterAction } from './const';
2
+ /** GDialog 组件 Props */
3
+ export interface GDialogProps {
4
+ /**
5
+ * @description 标题名
6
+ * @version 0.1.6
7
+ * @default ''
8
+ */
9
+ title: string;
10
+ /**
11
+ * @description 对话框尺寸
12
+ * @version 0.1.6
13
+ * @default 'medium'
14
+ */
15
+ size?: 'small' | 'medium' | 'large' | string;
16
+ /**
17
+ * @description 是否显示对话框
18
+ * @version 0.1.6
19
+ * @default false
20
+ */
21
+ modelValue?: boolean;
22
+ /**
23
+ * @description 是否隐藏底部操作区(包含取消/重置/保存与自定义 actions)
24
+ * @version 0.2.18
25
+ * @default false
26
+ */
27
+ hideFooter?: boolean;
28
+ /**
29
+ * @description 自定义底部操作按钮组。配置后会替换默认的 取消/重置/保存
30
+ * @version 0.2.18
31
+ * @default undefined
32
+ */
33
+ actions?: FooterAction[];
34
+ /**
35
+ * @description 是否显示默认「取消」按钮(actions 模式下无效)
36
+ * @version 0.2.18
37
+ * @default true
38
+ */
39
+ showCancel?: boolean;
40
+ /**
41
+ * @description 是否显示默认「重置」按钮(actions 模式下无效)
42
+ * @version 0.2.18
43
+ * @default true
44
+ */
45
+ showReset?: boolean;
46
+ /**
47
+ * @description 是否显示默认「保存」按钮(actions 模式下无效)
48
+ * @version 0.2.18
49
+ * @default true
50
+ */
51
+ showSave?: boolean;
52
+ /**
53
+ * @description 默认「取消」按钮文案
54
+ * @version 0.2.18
55
+ * @default '取消'
56
+ */
57
+ cancelText?: string;
58
+ /**
59
+ * @description 默认「重置」按钮文案
60
+ * @version 0.2.18
61
+ * @default '重置'
62
+ */
63
+ resetText?: string;
64
+ /**
65
+ * @description 默认「保存」按钮文案
66
+ * @version 0.2.18
67
+ * @default '保存'
68
+ */
69
+ saveText?: string;
70
+ /**
71
+ * @description 保存按钮 loading 态(异步保存时使用)
72
+ * @version 0.2.18
73
+ * @default false
74
+ */
75
+ saveLoading?: boolean;
76
+ /**
77
+ * @description 保存按钮禁用态
78
+ * @version 0.2.18
79
+ * @default false
80
+ */
81
+ saveDisabled?: boolean;
82
+ /**
83
+ * @description 关闭前钩子。返回 false 或 Promise<false> 时取消关闭。
84
+ * 触发时机:点击关闭/最小化/ESC/蒙层/取消/保存
85
+ * @version 0.2.18
86
+ * @default undefined
87
+ */
88
+ beforeClose?: (action: DialogCloseAction) => boolean | Promise<boolean>;
89
+ }
@@ -0,0 +1,59 @@
1
+ export interface GlideSelectOption {
2
+ value: string;
3
+ label: string;
4
+ tag?: string;
5
+ }
6
+ interface GlideSelectProps {
7
+ options?: (string | GlideSelectOption)[];
8
+ value?: string;
9
+ defaultValue?: string;
10
+ placeholder?: string;
11
+ showTags?: boolean;
12
+ accentColor?: string;
13
+ surfaceColor?: string;
14
+ highlightColor?: string;
15
+ textColor?: string;
16
+ size?: 'sm' | 'md' | 'lg';
17
+ radius?: number;
18
+ menuWidth?: number;
19
+ placement?: 'top' | 'bottom';
20
+ align?: 'left' | 'right';
21
+ popDuration?: number;
22
+ glideDuration?: number;
23
+ rememberPosition?: boolean;
24
+ disabled?: boolean;
25
+ ariaLabel?: string;
26
+ className?: string;
27
+ }
28
+ declare const _default: import('vue').DefineComponent<GlideSelectProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
29
+ change: (value: string, option: GlideSelectOption) => any;
30
+ }, string, import('vue').PublicProps, Readonly<GlideSelectProps> & Readonly<{
31
+ onChange?: ((value: string, option: GlideSelectOption) => any) | undefined;
32
+ }>, {
33
+ className: string;
34
+ value: string;
35
+ size: "sm" | "md" | "lg";
36
+ disabled: boolean;
37
+ placeholder: string;
38
+ accentColor: string;
39
+ radius: number;
40
+ textColor: string;
41
+ placement: "top" | "bottom";
42
+ align: "left" | "right";
43
+ defaultValue: string;
44
+ ariaLabel: string;
45
+ options: (string | GlideSelectOption)[];
46
+ showTags: boolean;
47
+ surfaceColor: string;
48
+ highlightColor: string;
49
+ menuWidth: number;
50
+ popDuration: number;
51
+ glideDuration: number;
52
+ rememberPosition: boolean;
53
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
54
+ rootRef: HTMLDivElement;
55
+ triggerRef: HTMLButtonElement;
56
+ menuRef: HTMLDivElement;
57
+ pillRef: HTMLSpanElement;
58
+ }, HTMLDivElement>;
59
+ export default _default;
@@ -0,0 +1,45 @@
1
+ import { GRadioProps, RadioSize } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ left?(_: {}): any;
6
+ right?(_: {}): any;
7
+ };
8
+ refs: {
9
+ trackRef: HTMLSpanElement;
10
+ };
11
+ rootEl: HTMLSpanElement;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: import('vue').DefineComponent<GRadioProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
+ change: (checked: boolean) => any;
16
+ "update:checked": (checked: boolean) => any;
17
+ }, string, import('vue').PublicProps, Readonly<GRadioProps> & Readonly<{
18
+ onChange?: ((checked: boolean) => any) | undefined;
19
+ "onUpdate:checked"?: ((checked: boolean) => any) | undefined;
20
+ }>, {
21
+ className: string;
22
+ label: string;
23
+ size: RadioSize;
24
+ id: string;
25
+ width: number;
26
+ height: number;
27
+ disabled: boolean;
28
+ radius: number;
29
+ checked: boolean;
30
+ trackColor: string;
31
+ ariaLabel: string;
32
+ defaultChecked: boolean;
33
+ trackOnColor: string;
34
+ thumbColor: string;
35
+ thumbOnColor: string;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
37
+ trackRef: HTMLSpanElement;
38
+ }, HTMLSpanElement>;
39
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
40
+ export default _default;
41
+ type __VLS_WithTemplateSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -0,0 +1,94 @@
1
+ /** GRadio 组件 Props */
2
+ export type RadioSize = 'large' | 'middle' | 'small';
3
+ export interface GRadioProps {
4
+ /**
5
+ * @description 选中状态,传入后变为受控模式,配合 v-model:checked 使用
6
+ * @version 0.3.12
7
+ * @default undefined
8
+ */
9
+ checked?: boolean;
10
+ /**
11
+ * @description 非受控模式下的初始选中状态
12
+ * @version 0.3.12
13
+ * @default false
14
+ */
15
+ defaultChecked?: boolean;
16
+ /**
17
+ * @description 开关尺寸,紧凑规格:large 高 24 / middle 高 20 / small 高 16(px),宽度按 2:1 推导(48 / 40 / 32)
18
+ * @version 0.3.12
19
+ * @default 'middle'
20
+ */
21
+ size?: RadioSize;
22
+ /**
23
+ * @description 开关右侧的文字标签,点击文字同样可切换;等价于 #right 插槽的简写,插槽内容优先
24
+ * @version 0.3.12
25
+ * @default ''
26
+ */
27
+ label?: string;
28
+ /**
29
+ * @description 禁用开关:不可点击、不可拖拽、不可键盘操作
30
+ * @version 0.3.12
31
+ * @default false
32
+ */
33
+ disabled?: boolean;
34
+ /**
35
+ * @description 轨道(关闭态)颜色;不传时随明暗模式自适应(浅色下浅灰、暗色下半透明白)
36
+ * @version 0.3.12
37
+ * @default undefined
38
+ */
39
+ trackColor?: string;
40
+ /**
41
+ * @description 轨道(开启态)颜色;不传时随明暗模式自适应(浅色下深色、暗色下浅色)
42
+ * @version 0.3.12
43
+ * @default undefined
44
+ */
45
+ trackOnColor?: string;
46
+ /**
47
+ * @description 滑块(关闭态)颜色;不传时随明暗模式自适应(浅色下白色、暗色下浅灰)
48
+ * @version 0.3.12
49
+ * @default undefined
50
+ */
51
+ thumbColor?: string;
52
+ /**
53
+ * @description 滑块(开启态)颜色;不传时随明暗模式自适应(浅色下白色、暗色下深色)
54
+ * @version 0.3.12
55
+ * @default undefined
56
+ */
57
+ thumbOnColor?: string;
58
+ /**
59
+ * @description 轨道宽度(px),不传时按 size 推导
60
+ * @version 0.3.12
61
+ * @default undefined
62
+ */
63
+ width?: number;
64
+ /**
65
+ * @description 轨道高度(px),不传时按 size 推导(large 40 / middle 32 / small 24)
66
+ * @version 0.3.12
67
+ * @default undefined
68
+ */
69
+ height?: number;
70
+ /**
71
+ * @description 轨道圆角(px),最大不超过高度的一半;不传时取高度的一半(全圆角)
72
+ * @version 0.3.12
73
+ * @default undefined
74
+ */
75
+ radius?: number;
76
+ /**
77
+ * @description 开关的 aria-label 无障碍描述;有 label 时可省略
78
+ * @version 0.3.12
79
+ * @default undefined
80
+ */
81
+ ariaLabel?: string;
82
+ /**
83
+ * @description 根元素附加 class
84
+ * @version 0.3.12
85
+ * @default ''
86
+ */
87
+ className?: string;
88
+ /**
89
+ * @description 根元素 id,未传时自动生成;label 的 for 关联此 id
90
+ * @version 0.3.12
91
+ * @default undefined
92
+ */
93
+ id?: string;
94
+ }
@@ -45,8 +45,8 @@ declare const __VLS_component: import('vue').DefineComponent<AnimatedListProps,
45
45
  }>, {
46
46
  className: string;
47
47
  loading: boolean;
48
- stagger: number;
49
48
  items: any[];
49
+ stagger: number;
50
50
  showGradients: boolean;
51
51
  itemClassName: string;
52
52
  displayScrollbar: boolean;
@@ -0,0 +1,30 @@
1
+ import { GSegmentProps, GSegmentSize } from './types';
2
+ declare const _default: import('vue').DefineComponent<GSegmentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
+ change: (value: string, index: number) => any;
4
+ "update:value": (value: string) => any;
5
+ }, string, import('vue').PublicProps, Readonly<GSegmentProps> & Readonly<{
6
+ onChange?: ((value: string, index: number) => any) | undefined;
7
+ "onUpdate:value"?: ((value: string) => any) | undefined;
8
+ }>, {
9
+ className: string;
10
+ value: string;
11
+ size: GSegmentSize;
12
+ disabled: boolean;
13
+ draggable: boolean;
14
+ inset: number;
15
+ radius: number;
16
+ speed: number;
17
+ textColor: string;
18
+ defaultValue: string;
19
+ trackColor: string;
20
+ ariaLabel: string;
21
+ thumbColor: string;
22
+ activeTextColor: string;
23
+ equalSlots: boolean;
24
+ stretch: number;
25
+ squash: number;
26
+ glide: number;
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
28
+ trackRef: HTMLDivElement;
29
+ }, HTMLDivElement>;
30
+ export default _default;
@@ -0,0 +1,125 @@
1
+ import { Component } from 'vue';
2
+ import { IconArray } from '@hugeicons/vue';
3
+ /** GSegment 组件 Props */
4
+ export type GSegmentSize = 'large' | 'middle' | 'small';
5
+ export type GSegmentItem = string | {
6
+ value: string;
7
+ label: string;
8
+ icon?: IconArray | Component;
9
+ };
10
+ export interface GSegmentProps {
11
+ /**
12
+ * @description 选项列表,项可以是字符串或 { value, label, icon } 对象
13
+ * @version 0.3.13
14
+ * @default []
15
+ */
16
+ items: GSegmentItem[];
17
+ /**
18
+ * @description 当前选中值,传入后变为受控模式,配合 v-model:value 使用
19
+ * @version 0.3.13
20
+ * @default undefined
21
+ */
22
+ value?: string;
23
+ /**
24
+ * @description 非受控模式下的初始选中值,未传时默认选中第一项
25
+ * @version 0.3.13
26
+ * @default undefined
27
+ */
28
+ defaultValue?: string;
29
+ /**
30
+ * @description 轨道(底座)颜色;不传时随明暗模式自适应(浅色下浅灰、暗色下深灰)
31
+ * @version 0.3.13
32
+ * @default undefined
33
+ */
34
+ trackColor?: string;
35
+ /**
36
+ * @description 滑块(选中高亮块)颜色;不传时随明暗模式自适应(浅色下白色、暗色下浅色)
37
+ * @version 0.3.13
38
+ * @default undefined
39
+ */
40
+ thumbColor?: string;
41
+ /**
42
+ * @description 未选中项文字颜色;不传时随明暗模式自适应
43
+ * @version 0.3.13
44
+ * @default undefined
45
+ */
46
+ textColor?: string;
47
+ /**
48
+ * @description 选中项文字颜色(显示在滑块上);不传时随明暗模式自适应
49
+ * @version 0.3.13
50
+ * @default undefined
51
+ */
52
+ activeTextColor?: string;
53
+ /**
54
+ * @description 尺寸,高度与字号遵循全库统一尺寸体系(styles/size.css):large 高 40 字号 16 / middle 高 32 字号 14 / small 高 24 字号 12
55
+ * @version 0.3.13
56
+ * @default 'middle'
57
+ */
58
+ size?: GSegmentSize;
59
+ /**
60
+ * @description 轨道圆角(px)
61
+ * @version 0.3.13
62
+ * @default 10
63
+ */
64
+ radius?: number;
65
+ /**
66
+ * @description 滑块与轨道边缘的内边距(px)
67
+ * @version 0.3.13
68
+ * @default 3
69
+ */
70
+ inset?: number;
71
+ /**
72
+ * @description 所有选项等宽平铺;为 false 时按内容自适应宽度
73
+ * @version 0.3.13
74
+ * @default true
75
+ */
76
+ equalSlots?: boolean;
77
+ /**
78
+ * @description 切换时滑块的拉伸幅度(百分比,0 为关闭)
79
+ * @version 0.3.13
80
+ * @default 100
81
+ */
82
+ stretch?: number;
83
+ /**
84
+ * @description 松手落位时滑块的挤压量(px,0 为关闭)
85
+ * @version 0.3.13
86
+ * @default 3
87
+ */
88
+ squash?: number;
89
+ /**
90
+ * @description 动画速度倍率,越大越快
91
+ * @version 0.3.13
92
+ * @default 1
93
+ */
94
+ speed?: number;
95
+ /**
96
+ * @description 甩动惯性强度(0-100),影响松手后的滑行预测距离
97
+ * @version 0.3.13
98
+ * @default 75
99
+ */
100
+ glide?: number;
101
+ /**
102
+ * @description 允许按住滑块左右拖拽换挡(拖动带橡皮筋阻尼)
103
+ * @version 0.3.13
104
+ * @default true
105
+ */
106
+ draggable?: boolean;
107
+ /**
108
+ * @description 禁用组件:不可点击、不可拖拽、不可键盘操作
109
+ * @version 0.3.13
110
+ * @default false
111
+ */
112
+ disabled?: boolean;
113
+ /**
114
+ * @description 根元素附加 class
115
+ * @version 0.3.13
116
+ * @default ''
117
+ */
118
+ className?: string;
119
+ /**
120
+ * @description 无障碍描述(aria-label)
121
+ * @version 0.3.13
122
+ * @default 'Segmented control'
123
+ */
124
+ ariaLabel?: string;
125
+ }