@cyberpunk-vue/components 1.12.6 → 1.13.1

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.
@@ -290,7 +290,7 @@ export declare const CpPagination: import('../utils').SFCWithInstall<{
290
290
  sizes?(_: {
291
291
  pageSize: number;
292
292
  pageSizes: number[];
293
- options: import('..').DropdownOption[];
293
+ options: import('..').SelectOption[];
294
294
  onChange: (val: string | number) => void;
295
295
  disabled: boolean;
296
296
  type: import('.').PaginationType;
@@ -1,11 +1,11 @@
1
- import { DropdownOption } from '../../dropdown/src/dropdown';
1
+ import { SelectOption } from '../../select/src/select';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  sizes?(_: {
6
6
  pageSize: number;
7
7
  pageSizes: number[];
8
- options: DropdownOption[];
8
+ options: SelectOption[];
9
9
  onChange: (val: string | number) => void;
10
10
  disabled: boolean;
11
11
  type: import('./pagination').PaginationType;
@@ -10,7 +10,173 @@
10
10
  *
11
11
  * @see {@link SegmentedProps} 查看所有可用属性
12
12
  */
13
- export declare const CpSegmented: import('../utils').SFCWithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
13
+ export declare const CpSegmented: import('../utils').SFCWithInstall<{
14
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
15
+ readonly modelValue: {
16
+ readonly type: import('vue').PropType<import('.').SegmentedValueType>;
17
+ readonly default: undefined;
18
+ };
19
+ readonly options: {
20
+ readonly type: import('vue').PropType<(string | number | import('.').SegmentedOption)[]>;
21
+ readonly default: () => never[];
22
+ };
23
+ readonly type: {
24
+ readonly type: import('vue').PropType<import('.').SegmentedType>;
25
+ readonly default: "default";
26
+ };
27
+ readonly variant: {
28
+ readonly type: import('vue').PropType<import('.').SegmentedVariant>;
29
+ readonly default: "solid";
30
+ };
31
+ readonly size: {
32
+ readonly type: import('vue').PropType<import('.').SegmentedSize>;
33
+ readonly default: "md";
34
+ };
35
+ readonly shape: {
36
+ readonly type: import('vue').PropType<import('.').SegmentedShape>;
37
+ readonly default: "clip";
38
+ };
39
+ readonly color: {
40
+ readonly type: StringConstructor;
41
+ readonly default: "";
42
+ };
43
+ readonly disabled: {
44
+ readonly type: BooleanConstructor;
45
+ readonly default: false;
46
+ };
47
+ readonly block: {
48
+ readonly type: BooleanConstructor;
49
+ readonly default: false;
50
+ };
51
+ readonly clearable: {
52
+ readonly type: BooleanConstructor;
53
+ readonly default: false;
54
+ };
55
+ readonly vertical: {
56
+ readonly type: BooleanConstructor;
57
+ readonly default: false;
58
+ };
59
+ readonly wrap: {
60
+ readonly type: BooleanConstructor;
61
+ readonly default: false;
62
+ };
63
+ readonly beforeChange: {
64
+ readonly type: import('vue').PropType<(next: import('.').SegmentedValueType | undefined, current: import('.').SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void>;
65
+ readonly default: undefined;
66
+ };
67
+ }>> & Readonly<{
68
+ onClear?: (() => any) | undefined;
69
+ onChange?: ((value: import('.').SegmentedValueType | undefined) => any) | undefined;
70
+ "onUpdate:modelValue"?: ((value: import('.').SegmentedValueType | undefined) => any) | undefined;
71
+ }>, {
72
+ updateIndicator: () => void;
73
+ focus: () => void;
74
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
75
+ clear: () => void;
76
+ change: (value: import('.').SegmentedValueType | undefined) => void;
77
+ "update:modelValue": (value: import('.').SegmentedValueType | undefined) => void;
78
+ }, import('vue').PublicProps, {
79
+ readonly size: import('@cyberpunk-vue/hooks').Size;
80
+ readonly type: import('.').SegmentedType;
81
+ readonly color: string;
82
+ readonly variant: import('.').SegmentedVariant;
83
+ readonly disabled: boolean;
84
+ readonly block: boolean;
85
+ readonly shape: import('.').SegmentedShape;
86
+ readonly modelValue: import('.').SegmentedValueType;
87
+ readonly clearable: boolean;
88
+ readonly vertical: boolean;
89
+ readonly wrap: boolean;
90
+ readonly beforeChange: (next: import('.').SegmentedValueType | undefined, current: import('.').SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void;
91
+ readonly options: (string | number | import('.').SegmentedOption)[];
92
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
93
+ trackRef: HTMLDivElement;
94
+ }, HTMLDivElement, import('vue').ComponentProvideOptions, {
95
+ P: {};
96
+ B: {};
97
+ D: {};
98
+ C: {};
99
+ M: {};
100
+ Defaults: {};
101
+ }, Readonly<import('vue').ExtractPropTypes<{
102
+ readonly modelValue: {
103
+ readonly type: import('vue').PropType<import('.').SegmentedValueType>;
104
+ readonly default: undefined;
105
+ };
106
+ readonly options: {
107
+ readonly type: import('vue').PropType<(string | number | import('.').SegmentedOption)[]>;
108
+ readonly default: () => never[];
109
+ };
110
+ readonly type: {
111
+ readonly type: import('vue').PropType<import('.').SegmentedType>;
112
+ readonly default: "default";
113
+ };
114
+ readonly variant: {
115
+ readonly type: import('vue').PropType<import('.').SegmentedVariant>;
116
+ readonly default: "solid";
117
+ };
118
+ readonly size: {
119
+ readonly type: import('vue').PropType<import('.').SegmentedSize>;
120
+ readonly default: "md";
121
+ };
122
+ readonly shape: {
123
+ readonly type: import('vue').PropType<import('.').SegmentedShape>;
124
+ readonly default: "clip";
125
+ };
126
+ readonly color: {
127
+ readonly type: StringConstructor;
128
+ readonly default: "";
129
+ };
130
+ readonly disabled: {
131
+ readonly type: BooleanConstructor;
132
+ readonly default: false;
133
+ };
134
+ readonly block: {
135
+ readonly type: BooleanConstructor;
136
+ readonly default: false;
137
+ };
138
+ readonly clearable: {
139
+ readonly type: BooleanConstructor;
140
+ readonly default: false;
141
+ };
142
+ readonly vertical: {
143
+ readonly type: BooleanConstructor;
144
+ readonly default: false;
145
+ };
146
+ readonly wrap: {
147
+ readonly type: BooleanConstructor;
148
+ readonly default: false;
149
+ };
150
+ readonly beforeChange: {
151
+ readonly type: import('vue').PropType<(next: import('.').SegmentedValueType | undefined, current: import('.').SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void>;
152
+ readonly default: undefined;
153
+ };
154
+ }>> & Readonly<{
155
+ onClear?: (() => any) | undefined;
156
+ onChange?: ((value: import('.').SegmentedValueType | undefined) => any) | undefined;
157
+ "onUpdate:modelValue"?: ((value: import('.').SegmentedValueType | undefined) => any) | undefined;
158
+ }>, {
159
+ updateIndicator: () => void;
160
+ focus: () => void;
161
+ }, {}, {}, {}, {
162
+ readonly size: import('@cyberpunk-vue/hooks').Size;
163
+ readonly type: import('.').SegmentedType;
164
+ readonly color: string;
165
+ readonly variant: import('.').SegmentedVariant;
166
+ readonly disabled: boolean;
167
+ readonly block: boolean;
168
+ readonly shape: import('.').SegmentedShape;
169
+ readonly modelValue: import('.').SegmentedValueType;
170
+ readonly clearable: boolean;
171
+ readonly vertical: boolean;
172
+ readonly wrap: boolean;
173
+ readonly beforeChange: (next: import('.').SegmentedValueType | undefined, current: import('.').SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void;
174
+ readonly options: (string | number | import('.').SegmentedOption)[];
175
+ }>;
176
+ __isFragment?: never;
177
+ __isTeleport?: never;
178
+ __isSuspense?: never;
179
+ } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
14
180
  readonly modelValue: {
15
181
  readonly type: import('vue').PropType<import('.').SegmentedValueType>;
16
182
  readonly default: undefined;
@@ -51,58 +217,30 @@ export declare const CpSegmented: import('../utils').SFCWithInstall<import('vue'
51
217
  readonly type: BooleanConstructor;
52
218
  readonly default: false;
53
219
  };
54
- }>, {
55
- updateIndicator: () => void;
56
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
57
- clear: () => void;
58
- change: (value: import('.').SegmentedValueType | undefined) => void;
59
- "update:modelValue": (value: import('.').SegmentedValueType | undefined) => void;
60
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
61
- readonly modelValue: {
62
- readonly type: import('vue').PropType<import('.').SegmentedValueType>;
63
- readonly default: undefined;
64
- };
65
- readonly options: {
66
- readonly type: import('vue').PropType<(string | number | import('.').SegmentedOption)[]>;
67
- readonly default: () => never[];
68
- };
69
- readonly type: {
70
- readonly type: import('vue').PropType<import('.').SegmentedType>;
71
- readonly default: "default";
72
- };
73
- readonly variant: {
74
- readonly type: import('vue').PropType<import('.').SegmentedVariant>;
75
- readonly default: "solid";
76
- };
77
- readonly size: {
78
- readonly type: import('vue').PropType<import('.').SegmentedSize>;
79
- readonly default: "md";
80
- };
81
- readonly shape: {
82
- readonly type: import('vue').PropType<import('.').SegmentedShape>;
83
- readonly default: "clip";
84
- };
85
- readonly color: {
86
- readonly type: StringConstructor;
87
- readonly default: "";
88
- };
89
- readonly disabled: {
220
+ readonly vertical: {
90
221
  readonly type: BooleanConstructor;
91
222
  readonly default: false;
92
223
  };
93
- readonly block: {
224
+ readonly wrap: {
94
225
  readonly type: BooleanConstructor;
95
226
  readonly default: false;
96
227
  };
97
- readonly clearable: {
98
- readonly type: BooleanConstructor;
99
- readonly default: false;
228
+ readonly beforeChange: {
229
+ readonly type: import('vue').PropType<(next: import('.').SegmentedValueType | undefined, current: import('.').SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void>;
230
+ readonly default: undefined;
100
231
  };
101
232
  }>> & Readonly<{
102
233
  onClear?: (() => any) | undefined;
103
234
  onChange?: ((value: import('.').SegmentedValueType | undefined) => any) | undefined;
104
235
  "onUpdate:modelValue"?: ((value: import('.').SegmentedValueType | undefined) => any) | undefined;
105
236
  }>, {
237
+ updateIndicator: () => void;
238
+ focus: () => void;
239
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
240
+ clear: () => void;
241
+ change: (value: import('.').SegmentedValueType | undefined) => void;
242
+ "update:modelValue": (value: import('.').SegmentedValueType | undefined) => void;
243
+ }, string, {
106
244
  readonly size: import('@cyberpunk-vue/hooks').Size;
107
245
  readonly type: import('.').SegmentedType;
108
246
  readonly color: string;
@@ -112,10 +250,19 @@ export declare const CpSegmented: import('../utils').SFCWithInstall<import('vue'
112
250
  readonly shape: import('.').SegmentedShape;
113
251
  readonly modelValue: import('.').SegmentedValueType;
114
252
  readonly clearable: boolean;
253
+ readonly vertical: boolean;
254
+ readonly wrap: boolean;
255
+ readonly beforeChange: (next: import('.').SegmentedValueType | undefined, current: import('.').SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void;
115
256
  readonly options: (string | number | import('.').SegmentedOption)[];
116
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
117
- trackRef: HTMLDivElement;
118
- }, HTMLDivElement>>;
257
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
258
+ $slots: {
259
+ option?(_: {
260
+ option: import('.').SegmentedOption;
261
+ index: number;
262
+ active: boolean;
263
+ }): any;
264
+ };
265
+ })>;
119
266
  export default CpSegmented;
120
267
  export * from './src/segmented';
121
268
  export type { SegmentedInstance } from './src/instance';
@@ -152,6 +152,38 @@ export declare const segmentedProps: {
152
152
  readonly type: BooleanConstructor;
153
153
  readonly default: false;
154
154
  };
155
+ /**
156
+ * 是否纵向排列选项
157
+ * 启用后选项按列堆叠,键盘导航使用 ↑/↓
158
+ * @default false
159
+ */
160
+ readonly vertical: {
161
+ readonly type: BooleanConstructor;
162
+ readonly default: false;
163
+ };
164
+ /**
165
+ * 是否允许选项换行(仅横向布局生效)
166
+ * 启用后空间不足时选项会自动换到下一行,指示器跟随激活项所在行
167
+ * @default false
168
+ */
169
+ readonly wrap: {
170
+ readonly type: BooleanConstructor;
171
+ readonly default: false;
172
+ };
173
+ /**
174
+ * 切换前钩子
175
+ *
176
+ * 返回 `false` 或 reject 的 Promise 会取消本次切换;
177
+ * 返回 `true`、其他值或 resolve 的 Promise 会执行切换。
178
+ * 适合在切换前做权限校验、未保存提示等。
179
+ *
180
+ * @param next - 即将切换到的目标值(清空时为 `undefined`)
181
+ * @param current - 当前值
182
+ */
183
+ readonly beforeChange: {
184
+ readonly type: PropType<(next: SegmentedValueType | undefined, current: SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void>;
185
+ readonly default: undefined;
186
+ };
155
187
  };
156
188
  export type SegmentedProps = ExtractPropTypes<typeof segmentedProps>;
157
189
  /**
@@ -1,5 +1,20 @@
1
1
  import { SegmentedOption, SegmentedValueType } from './segmented';
2
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ option?(_: {
6
+ option: SegmentedOption;
7
+ index: number;
8
+ active: boolean;
9
+ }): any;
10
+ };
11
+ refs: {
12
+ trackRef: HTMLDivElement;
13
+ };
14
+ rootEl: HTMLDivElement;
15
+ };
16
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
3
18
  readonly modelValue: {
4
19
  readonly type: import('vue').PropType<SegmentedValueType>;
5
20
  readonly default: undefined;
@@ -40,9 +55,23 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
40
55
  readonly type: BooleanConstructor;
41
56
  readonly default: false;
42
57
  };
58
+ readonly vertical: {
59
+ readonly type: BooleanConstructor;
60
+ readonly default: false;
61
+ };
62
+ readonly wrap: {
63
+ readonly type: BooleanConstructor;
64
+ readonly default: false;
65
+ };
66
+ readonly beforeChange: {
67
+ readonly type: import('vue').PropType<(next: SegmentedValueType | undefined, current: SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void>;
68
+ readonly default: undefined;
69
+ };
43
70
  }>, {
44
71
  /** @description 更新滑块位置 */
45
72
  updateIndicator: () => void;
73
+ /** @description 聚焦当前激活项(无激活项则聚焦第一个可用项) */
74
+ focus: () => void;
46
75
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
47
76
  clear: () => void;
48
77
  change: (value: SegmentedValueType | undefined) => void;
@@ -88,6 +117,18 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
88
117
  readonly type: BooleanConstructor;
89
118
  readonly default: false;
90
119
  };
120
+ readonly vertical: {
121
+ readonly type: BooleanConstructor;
122
+ readonly default: false;
123
+ };
124
+ readonly wrap: {
125
+ readonly type: BooleanConstructor;
126
+ readonly default: false;
127
+ };
128
+ readonly beforeChange: {
129
+ readonly type: import('vue').PropType<(next: SegmentedValueType | undefined, current: SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void>;
130
+ readonly default: undefined;
131
+ };
91
132
  }>> & Readonly<{
92
133
  onClear?: (() => any) | undefined;
93
134
  onChange?: ((value: SegmentedValueType | undefined) => any) | undefined;
@@ -102,8 +143,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
102
143
  readonly shape: import('./segmented').SegmentedShape;
103
144
  readonly modelValue: SegmentedValueType;
104
145
  readonly clearable: boolean;
146
+ readonly vertical: boolean;
147
+ readonly wrap: boolean;
148
+ readonly beforeChange: (next: SegmentedValueType | undefined, current: SegmentedValueType | undefined) => boolean | Promise<boolean | void> | void;
105
149
  readonly options: (string | number | SegmentedOption)[];
106
150
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
107
151
  trackRef: HTMLDivElement;
108
152
  }, HTMLDivElement>;
153
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
109
154
  export default _default;
155
+ type __VLS_WithTemplateSlots<T, S> = T & {
156
+ new (): {
157
+ $slots: S;
158
+ };
159
+ };