@cyberpunk-vue/components 1.12.6 → 1.12.7
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/dist/image-preview/src/image-preview.d.ts +25 -3
- package/dist/image-preview/src/image-preview.vue.d.ts +53 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2512 -2402
- package/dist/segmented/index.d.ts +191 -44
- package/dist/segmented/src/segmented.d.ts +32 -0
- package/dist/segmented/src/segmented.vue.d.ts +51 -1
- package/package.json +4 -4
- package/dist/image-preview/index.d.ts +0 -115
|
@@ -2,15 +2,37 @@ import { ExtractPropTypes, PropType } from 'vue';
|
|
|
2
2
|
/**
|
|
3
3
|
* CpImagePreview 组件 Props 定义
|
|
4
4
|
*
|
|
5
|
-
* @description
|
|
5
|
+
* @description 赛博朋克风格全屏大图预览组件,支持缩放、旋转、多图切换,工具栏支持插槽自定义。
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```vue
|
|
9
|
+
* <!-- 基础用法 -->
|
|
9
10
|
* <CpImagePreview v-model="visible" :url-list="urls" />
|
|
11
|
+
*
|
|
12
|
+
* <!-- 在内置工具栏末尾追加按钮 -->
|
|
13
|
+
* <CpImagePreview v-model="visible" :url-list="urls">
|
|
14
|
+
* <template #toolbar-append="{ currentUrl, close }">
|
|
15
|
+
* <CpButton variant="ghost" dimmed square @click="share(currentUrl)">分享</CpButton>
|
|
16
|
+
* </template>
|
|
17
|
+
* </CpImagePreview>
|
|
18
|
+
*
|
|
19
|
+
* <!-- 完全替换工具栏 -->
|
|
20
|
+
* <CpImagePreview v-model="visible" :url-list="urls">
|
|
21
|
+
* <template #toolbar="{ zoomIn, zoomOut, resetTransform }">
|
|
22
|
+
* <CpButton @click="zoomOut">-</CpButton>
|
|
23
|
+
* <CpButton @click="zoomIn">+</CpButton>
|
|
24
|
+
* <CpButton @click="resetTransform">重置</CpButton>
|
|
25
|
+
* </template>
|
|
26
|
+
* </CpImagePreview>
|
|
10
27
|
* ```
|
|
11
|
-
|
|
28
|
+
*
|
|
29
|
+
* @slots
|
|
30
|
+
* - `toolbar` - 完全替换底部工具栏(覆盖内置按钮)。作用域 props: `{ scale, rotate, currentIndex, currentUrl, urlList, isSingle, canPrev, canNext, zoomMin, zoomMax, zoomIn(), zoomOut(), rotateLeft(), rotateRight(), resetTransform(), prev(), next(), close(), download() }`
|
|
31
|
+
* - `toolbar-append` - 在内置工具栏末尾追加自定义按钮。作用域 props 与 `toolbar` 一致
|
|
32
|
+
*
|
|
33
|
+
* @category 展示组件
|
|
12
34
|
* @displayName CpImagePreview 图片预览
|
|
13
|
-
|
|
35
|
+
* @exposes close() - 关闭预览
|
|
14
36
|
* @exposes prev() - 上一张
|
|
15
37
|
* @exposes next() - 下一张
|
|
16
38
|
* @exposes zoomIn() - 放大
|
|
@@ -1,4 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
interface ToolbarSlotProps {
|
|
2
|
+
scale: number;
|
|
3
|
+
rotate: number;
|
|
4
|
+
currentIndex: number;
|
|
5
|
+
currentUrl: string;
|
|
6
|
+
urlList: string[];
|
|
7
|
+
isSingle: boolean;
|
|
8
|
+
canPrev: boolean;
|
|
9
|
+
canNext: boolean;
|
|
10
|
+
zoomMin: number;
|
|
11
|
+
zoomMax: number;
|
|
12
|
+
zoomIn: () => void;
|
|
13
|
+
zoomOut: () => void;
|
|
14
|
+
rotateLeft: () => void;
|
|
15
|
+
rotateRight: () => void;
|
|
16
|
+
resetTransform: () => void;
|
|
17
|
+
prev: () => void;
|
|
18
|
+
next: () => void;
|
|
19
|
+
close: () => void;
|
|
20
|
+
download: () => void;
|
|
21
|
+
}
|
|
22
|
+
declare function __VLS_template(): {
|
|
23
|
+
attrs: Partial<{}>;
|
|
24
|
+
slots: Readonly<{
|
|
25
|
+
/**
|
|
26
|
+
* 完全替换底部工具栏(覆盖内置按钮)
|
|
27
|
+
*/
|
|
28
|
+
toolbar?: (props: ToolbarSlotProps) => unknown;
|
|
29
|
+
/**
|
|
30
|
+
* 在内置工具栏末尾追加自定义按钮
|
|
31
|
+
*/
|
|
32
|
+
'toolbar-append'?: (props: ToolbarSlotProps) => unknown;
|
|
33
|
+
}> & {
|
|
34
|
+
/**
|
|
35
|
+
* 完全替换底部工具栏(覆盖内置按钮)
|
|
36
|
+
*/
|
|
37
|
+
toolbar?: (props: ToolbarSlotProps) => unknown;
|
|
38
|
+
/**
|
|
39
|
+
* 在内置工具栏末尾追加自定义按钮
|
|
40
|
+
*/
|
|
41
|
+
'toolbar-append'?: (props: ToolbarSlotProps) => unknown;
|
|
42
|
+
};
|
|
43
|
+
refs: {};
|
|
44
|
+
rootEl: any;
|
|
45
|
+
};
|
|
46
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
47
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
48
|
readonly modelValue: {
|
|
3
49
|
readonly type: BooleanConstructor;
|
|
4
50
|
readonly default: false;
|
|
@@ -108,4 +154,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
108
154
|
readonly urlList: string[];
|
|
109
155
|
readonly teleportTo: string | HTMLElement;
|
|
110
156
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
157
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
111
158
|
export default _default;
|
|
159
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
160
|
+
new (): {
|
|
161
|
+
$slots: S;
|
|
162
|
+
};
|
|
163
|
+
};
|