@v-c/image 0.0.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.
Files changed (105) hide show
  1. package/LICENSE +21 -0
  2. package/dist/Image.cjs +228 -0
  3. package/dist/Image.d.ts +46 -0
  4. package/dist/Image.js +226 -0
  5. package/dist/Preview/CloseBtn.cjs +41 -0
  6. package/dist/Preview/CloseBtn.d.ts +8 -0
  7. package/dist/Preview/CloseBtn.js +39 -0
  8. package/dist/Preview/Footer.cjs +231 -0
  9. package/dist/Preview/Footer.d.ts +24 -0
  10. package/dist/Preview/Footer.js +229 -0
  11. package/dist/Preview/PrevNext.cjs +56 -0
  12. package/dist/Preview/PrevNext.d.ts +10 -0
  13. package/dist/Preview/PrevNext.js +54 -0
  14. package/dist/Preview/index.cjs +399 -0
  15. package/dist/Preview/index.d.ts +101 -0
  16. package/dist/Preview/index.js +397 -0
  17. package/dist/PreviewGroup.cjs +135 -0
  18. package/dist/PreviewGroup.d.ts +34 -0
  19. package/dist/PreviewGroup.js +133 -0
  20. package/dist/common.cjs +12 -0
  21. package/dist/common.d.ts +2 -0
  22. package/dist/common.js +12 -0
  23. package/dist/context.cjs +10 -0
  24. package/dist/context.d.ts +7 -0
  25. package/dist/context.js +9 -0
  26. package/dist/getFixScaleEleTransPosition.cjs +25 -0
  27. package/dist/getFixScaleEleTransPosition.d.ts +16 -0
  28. package/dist/getFixScaleEleTransPosition.js +24 -0
  29. package/dist/hooks/useImageTransform.cjs +96 -0
  30. package/dist/hooks/useImageTransform.d.ts +21 -0
  31. package/dist/hooks/useImageTransform.js +95 -0
  32. package/dist/hooks/useMouseEvent.cjs +93 -0
  33. package/dist/hooks/useMouseEvent.d.ts +9 -0
  34. package/dist/hooks/useMouseEvent.js +92 -0
  35. package/dist/hooks/usePreviewItems.cjs +45 -0
  36. package/dist/hooks/usePreviewItems.d.ts +10 -0
  37. package/dist/hooks/usePreviewItems.js +44 -0
  38. package/dist/hooks/useRegisterImage.cjs +25 -0
  39. package/dist/hooks/useRegisterImage.d.ts +3 -0
  40. package/dist/hooks/useRegisterImage.js +24 -0
  41. package/dist/hooks/useStatus.cjs +46 -0
  42. package/dist/hooks/useStatus.d.ts +13 -0
  43. package/dist/hooks/useStatus.js +45 -0
  44. package/dist/hooks/useTouchEvent.cjs +120 -0
  45. package/dist/hooks/useTouchEvent.d.ts +8 -0
  46. package/dist/hooks/useTouchEvent.js +119 -0
  47. package/dist/index.cjs +8 -0
  48. package/dist/index.d.ts +11 -0
  49. package/dist/index.js +6 -0
  50. package/dist/interface.cjs +0 -0
  51. package/dist/interface.d.ts +13 -0
  52. package/dist/interface.js +0 -0
  53. package/dist/portal/dist/Context.cjs +12 -0
  54. package/dist/portal/dist/Context.js +11 -0
  55. package/dist/portal/dist/Portal.cjs +91 -0
  56. package/dist/portal/dist/Portal.js +91 -0
  57. package/dist/portal/dist/index.cjs +3 -0
  58. package/dist/portal/dist/index.js +3 -0
  59. package/dist/portal/dist/useDom.cjs +47 -0
  60. package/dist/portal/dist/useDom.js +47 -0
  61. package/dist/portal/dist/useScrollLocker.cjs +26 -0
  62. package/dist/portal/dist/useScrollLocker.js +26 -0
  63. package/dist/portal/dist/util.cjs +4 -0
  64. package/dist/portal/dist/util.js +4 -0
  65. package/dist/previewConfig.cjs +4 -0
  66. package/dist/previewConfig.d.ts +4 -0
  67. package/dist/previewConfig.js +3 -0
  68. package/dist/util/dist/Dom/canUseDom.cjs +4 -0
  69. package/dist/util/dist/Dom/canUseDom.js +4 -0
  70. package/dist/util/dist/Dom/contains.cjs +11 -0
  71. package/dist/util/dist/Dom/contains.js +11 -0
  72. package/dist/util/dist/Dom/dynamicCSS.cjs +78 -0
  73. package/dist/util/dist/Dom/dynamicCSS.js +77 -0
  74. package/dist/util/dist/KeyCode.cjs +81 -0
  75. package/dist/util/dist/KeyCode.js +81 -0
  76. package/dist/util/dist/RenderComponent.cjs +29 -0
  77. package/dist/util/dist/RenderComponent.js +29 -0
  78. package/dist/util/dist/classnames.cjs +36 -0
  79. package/dist/util/dist/classnames.js +35 -0
  80. package/dist/util/dist/getScrollBarSize.cjs +45 -0
  81. package/dist/util/dist/getScrollBarSize.js +45 -0
  82. package/dist/util/dist/hooks/useMergedState.cjs +24 -0
  83. package/dist/util/dist/hooks/useMergedState.js +24 -0
  84. package/dist/util/dist/index.cjs +3 -0
  85. package/dist/util/dist/index.js +3 -0
  86. package/dist/util/dist/isEqual.cjs +27 -0
  87. package/dist/util/dist/isEqual.js +27 -0
  88. package/dist/util/dist/omit.cjs +8 -0
  89. package/dist/util/dist/omit.js +8 -0
  90. package/dist/util/dist/pickAttrs.cjs +39 -0
  91. package/dist/util/dist/pickAttrs.js +39 -0
  92. package/dist/util/dist/props-util/index.cjs +47 -0
  93. package/dist/util/dist/props-util/index.js +44 -0
  94. package/dist/util/dist/raf.cjs +36 -0
  95. package/dist/util/dist/raf.js +36 -0
  96. package/dist/util/dist/type.cjs +2 -0
  97. package/dist/util/dist/type.js +2 -0
  98. package/dist/util/dist/utils/transition.cjs +21 -0
  99. package/dist/util/dist/utils/transition.js +21 -0
  100. package/dist/util/dist/warning.cjs +37 -0
  101. package/dist/util/dist/warning.js +37 -0
  102. package/dist/util.cjs +26 -0
  103. package/dist/util.d.ts +5 -0
  104. package/dist/util.js +25 -0
  105. package/package.json +48 -0
@@ -0,0 +1,231 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ const require_classnames = require("../util/dist/classnames.cjs");
3
+ require("../util/dist/index.cjs");
4
+ let vue = require("vue");
5
+ var Footer = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
6
+ const renderOperation = ({ type, disabled, onClick, icon }) => {
7
+ const actionCls = `${props.prefixCls}-actions-action`;
8
+ return (0, vue.createVNode)("div", {
9
+ "key": type,
10
+ "class": require_classnames.clsx(actionCls, `${actionCls}-${type}`, { [`${actionCls}-disabled`]: !!disabled }),
11
+ "onClick": () => {
12
+ if (!disabled) onClick();
13
+ }
14
+ }, [icon]);
15
+ };
16
+ return () => {
17
+ const { prefixCls, showProgress, current, count, showSwitch, classNames, styles, icons, image, transform, countRender, actionsRender, scale, minScale, maxScale, onActive, onFlipY, onFlipX, onRotateLeft, onRotateRight, onZoomOut, onZoomIn, onClose, onReset } = props;
18
+ const progressNode = showProgress && (0, vue.createVNode)("div", { "class": `${prefixCls}-progress` }, [countRender ? countRender(current + 1, count) : (0, vue.createVNode)("bdi", null, [`${current + 1} / ${count}`])]);
19
+ const switchPrevNode = showSwitch ? renderOperation({
20
+ icon: icons?.prev ?? icons?.left,
21
+ onClick: () => onActive(-1),
22
+ type: "prev",
23
+ disabled: current === 0
24
+ }) : void 0;
25
+ const switchNextNode = showSwitch ? renderOperation({
26
+ icon: icons?.next ?? icons?.right,
27
+ onClick: () => onActive(1),
28
+ type: "next",
29
+ disabled: current === count - 1
30
+ }) : void 0;
31
+ const flipYNode = renderOperation({
32
+ icon: icons?.flipY,
33
+ onClick: onFlipY,
34
+ type: "flipY"
35
+ });
36
+ const flipXNode = renderOperation({
37
+ icon: icons?.flipX,
38
+ onClick: onFlipX,
39
+ type: "flipX"
40
+ });
41
+ const rotateLeftNode = renderOperation({
42
+ icon: icons?.rotateLeft,
43
+ onClick: onRotateLeft,
44
+ type: "rotateLeft"
45
+ });
46
+ const rotateRightNode = renderOperation({
47
+ icon: icons?.rotateRight,
48
+ onClick: onRotateRight,
49
+ type: "rotateRight"
50
+ });
51
+ const zoomOutNode = renderOperation({
52
+ icon: icons?.zoomOut,
53
+ onClick: onZoomOut,
54
+ type: "zoomOut",
55
+ disabled: scale <= minScale
56
+ });
57
+ const zoomInNode = renderOperation({
58
+ icon: icons?.zoomIn,
59
+ onClick: onZoomIn,
60
+ type: "zoomIn",
61
+ disabled: scale === maxScale
62
+ });
63
+ const actionsNode = (0, vue.createVNode)("div", {
64
+ "class": require_classnames.clsx(`${prefixCls}-actions`, classNames.actions),
65
+ "style": styles.actions
66
+ }, [
67
+ flipYNode,
68
+ flipXNode,
69
+ rotateLeftNode,
70
+ rotateRightNode,
71
+ zoomOutNode,
72
+ zoomInNode
73
+ ]);
74
+ const renderNode = actionsRender ? actionsRender(actionsNode, {
75
+ icons: {
76
+ prevIcon: switchPrevNode,
77
+ nextIcon: switchNextNode,
78
+ flipYIcon: flipYNode,
79
+ flipXIcon: flipXNode,
80
+ rotateLeftIcon: rotateLeftNode,
81
+ rotateRightIcon: rotateRightNode,
82
+ zoomOutIcon: zoomOutNode,
83
+ zoomInIcon: zoomInNode
84
+ },
85
+ actions: {
86
+ onActive,
87
+ onFlipY,
88
+ onFlipX,
89
+ onRotateLeft,
90
+ onRotateRight,
91
+ onZoomOut,
92
+ onZoomIn,
93
+ onReset,
94
+ onClose
95
+ },
96
+ transform,
97
+ current,
98
+ total: count,
99
+ image
100
+ }) : actionsNode;
101
+ return (0, vue.createVNode)("div", {
102
+ "class": require_classnames.clsx(`${prefixCls}-footer`, classNames.footer),
103
+ "style": styles.footer
104
+ }, [progressNode, renderNode]);
105
+ };
106
+ }, {
107
+ props: {
108
+ prefixCls: {
109
+ type: String,
110
+ required: true,
111
+ default: void 0
112
+ },
113
+ showProgress: {
114
+ type: Boolean,
115
+ required: true,
116
+ default: void 0
117
+ },
118
+ countRender: {
119
+ type: Function,
120
+ required: false,
121
+ default: void 0
122
+ },
123
+ actionsRender: {
124
+ type: Function,
125
+ required: false,
126
+ default: void 0
127
+ },
128
+ current: {
129
+ type: Number,
130
+ required: true,
131
+ default: void 0
132
+ },
133
+ count: {
134
+ type: Number,
135
+ required: true,
136
+ default: void 0
137
+ },
138
+ showSwitch: {
139
+ type: Boolean,
140
+ required: true,
141
+ default: void 0
142
+ },
143
+ icons: {
144
+ required: true,
145
+ default: void 0
146
+ },
147
+ scale: {
148
+ type: Number,
149
+ required: true,
150
+ default: void 0
151
+ },
152
+ minScale: {
153
+ type: Number,
154
+ required: true,
155
+ default: void 0
156
+ },
157
+ maxScale: {
158
+ type: Number,
159
+ required: true,
160
+ default: void 0
161
+ },
162
+ image: {
163
+ type: Object,
164
+ required: true,
165
+ default: void 0
166
+ },
167
+ transform: {
168
+ type: Object,
169
+ required: true,
170
+ default: void 0
171
+ },
172
+ classNames: {
173
+ type: Object,
174
+ required: true,
175
+ default: void 0
176
+ },
177
+ styles: {
178
+ type: Object,
179
+ required: true,
180
+ default: void 0
181
+ },
182
+ onActive: {
183
+ type: Function,
184
+ required: true,
185
+ default: void 0
186
+ },
187
+ onFlipY: {
188
+ type: Function,
189
+ required: true,
190
+ default: void 0
191
+ },
192
+ onFlipX: {
193
+ type: Function,
194
+ required: true,
195
+ default: void 0
196
+ },
197
+ onRotateLeft: {
198
+ type: Function,
199
+ required: true,
200
+ default: void 0
201
+ },
202
+ onRotateRight: {
203
+ type: Function,
204
+ required: true,
205
+ default: void 0
206
+ },
207
+ onZoomOut: {
208
+ type: Function,
209
+ required: true,
210
+ default: void 0
211
+ },
212
+ onZoomIn: {
213
+ type: Function,
214
+ required: true,
215
+ default: void 0
216
+ },
217
+ onClose: {
218
+ type: Function,
219
+ required: true,
220
+ default: void 0
221
+ },
222
+ onReset: {
223
+ type: Function,
224
+ required: true,
225
+ default: void 0
226
+ }
227
+ },
228
+ name: "ImagePreviewFooter"
229
+ });
230
+ var Footer_default = Footer;
231
+ exports.default = Footer_default;
@@ -0,0 +1,24 @@
1
+ import { CSSProperties } from 'vue';
2
+ import { TransformType } from '../hooks/useImageTransform.ts';
3
+ import { ImgInfo } from '../Image.tsx';
4
+ import { Actions, PreviewProps } from './index.tsx';
5
+ export type FooterSemanticName = 'footer' | 'actions';
6
+ export interface FooterProps extends Actions {
7
+ prefixCls: string;
8
+ showProgress: boolean;
9
+ countRender?: PreviewProps['countRender'];
10
+ actionsRender?: PreviewProps['actionsRender'];
11
+ current: number;
12
+ count: number;
13
+ showSwitch: boolean;
14
+ icons: PreviewProps['icons'];
15
+ scale: number;
16
+ minScale: number;
17
+ maxScale: number;
18
+ image: ImgInfo;
19
+ transform: TransformType;
20
+ classNames: Record<string, string | undefined>;
21
+ styles: Record<string, CSSProperties | undefined>;
22
+ }
23
+ declare const Footer: import('vue').DefineSetupFnComponent<FooterProps, {}, {}, FooterProps & {}, import('vue').PublicProps>;
24
+ export default Footer;
@@ -0,0 +1,229 @@
1
+ import { clsx } from "../util/dist/classnames.js";
2
+ import "../util/dist/index.js";
3
+ import { createVNode, defineComponent } from "vue";
4
+ var Footer_default = /* @__PURE__ */ defineComponent((props) => {
5
+ const renderOperation = ({ type, disabled, onClick, icon }) => {
6
+ const actionCls = `${props.prefixCls}-actions-action`;
7
+ return createVNode("div", {
8
+ "key": type,
9
+ "class": clsx(actionCls, `${actionCls}-${type}`, { [`${actionCls}-disabled`]: !!disabled }),
10
+ "onClick": () => {
11
+ if (!disabled) onClick();
12
+ }
13
+ }, [icon]);
14
+ };
15
+ return () => {
16
+ const { prefixCls, showProgress, current, count, showSwitch, classNames, styles, icons, image, transform, countRender, actionsRender, scale, minScale, maxScale, onActive, onFlipY, onFlipX, onRotateLeft, onRotateRight, onZoomOut, onZoomIn, onClose, onReset } = props;
17
+ const progressNode = showProgress && createVNode("div", { "class": `${prefixCls}-progress` }, [countRender ? countRender(current + 1, count) : createVNode("bdi", null, [`${current + 1} / ${count}`])]);
18
+ const switchPrevNode = showSwitch ? renderOperation({
19
+ icon: icons?.prev ?? icons?.left,
20
+ onClick: () => onActive(-1),
21
+ type: "prev",
22
+ disabled: current === 0
23
+ }) : void 0;
24
+ const switchNextNode = showSwitch ? renderOperation({
25
+ icon: icons?.next ?? icons?.right,
26
+ onClick: () => onActive(1),
27
+ type: "next",
28
+ disabled: current === count - 1
29
+ }) : void 0;
30
+ const flipYNode = renderOperation({
31
+ icon: icons?.flipY,
32
+ onClick: onFlipY,
33
+ type: "flipY"
34
+ });
35
+ const flipXNode = renderOperation({
36
+ icon: icons?.flipX,
37
+ onClick: onFlipX,
38
+ type: "flipX"
39
+ });
40
+ const rotateLeftNode = renderOperation({
41
+ icon: icons?.rotateLeft,
42
+ onClick: onRotateLeft,
43
+ type: "rotateLeft"
44
+ });
45
+ const rotateRightNode = renderOperation({
46
+ icon: icons?.rotateRight,
47
+ onClick: onRotateRight,
48
+ type: "rotateRight"
49
+ });
50
+ const zoomOutNode = renderOperation({
51
+ icon: icons?.zoomOut,
52
+ onClick: onZoomOut,
53
+ type: "zoomOut",
54
+ disabled: scale <= minScale
55
+ });
56
+ const zoomInNode = renderOperation({
57
+ icon: icons?.zoomIn,
58
+ onClick: onZoomIn,
59
+ type: "zoomIn",
60
+ disabled: scale === maxScale
61
+ });
62
+ const actionsNode = createVNode("div", {
63
+ "class": clsx(`${prefixCls}-actions`, classNames.actions),
64
+ "style": styles.actions
65
+ }, [
66
+ flipYNode,
67
+ flipXNode,
68
+ rotateLeftNode,
69
+ rotateRightNode,
70
+ zoomOutNode,
71
+ zoomInNode
72
+ ]);
73
+ const renderNode = actionsRender ? actionsRender(actionsNode, {
74
+ icons: {
75
+ prevIcon: switchPrevNode,
76
+ nextIcon: switchNextNode,
77
+ flipYIcon: flipYNode,
78
+ flipXIcon: flipXNode,
79
+ rotateLeftIcon: rotateLeftNode,
80
+ rotateRightIcon: rotateRightNode,
81
+ zoomOutIcon: zoomOutNode,
82
+ zoomInIcon: zoomInNode
83
+ },
84
+ actions: {
85
+ onActive,
86
+ onFlipY,
87
+ onFlipX,
88
+ onRotateLeft,
89
+ onRotateRight,
90
+ onZoomOut,
91
+ onZoomIn,
92
+ onReset,
93
+ onClose
94
+ },
95
+ transform,
96
+ current,
97
+ total: count,
98
+ image
99
+ }) : actionsNode;
100
+ return createVNode("div", {
101
+ "class": clsx(`${prefixCls}-footer`, classNames.footer),
102
+ "style": styles.footer
103
+ }, [progressNode, renderNode]);
104
+ };
105
+ }, {
106
+ props: {
107
+ prefixCls: {
108
+ type: String,
109
+ required: true,
110
+ default: void 0
111
+ },
112
+ showProgress: {
113
+ type: Boolean,
114
+ required: true,
115
+ default: void 0
116
+ },
117
+ countRender: {
118
+ type: Function,
119
+ required: false,
120
+ default: void 0
121
+ },
122
+ actionsRender: {
123
+ type: Function,
124
+ required: false,
125
+ default: void 0
126
+ },
127
+ current: {
128
+ type: Number,
129
+ required: true,
130
+ default: void 0
131
+ },
132
+ count: {
133
+ type: Number,
134
+ required: true,
135
+ default: void 0
136
+ },
137
+ showSwitch: {
138
+ type: Boolean,
139
+ required: true,
140
+ default: void 0
141
+ },
142
+ icons: {
143
+ required: true,
144
+ default: void 0
145
+ },
146
+ scale: {
147
+ type: Number,
148
+ required: true,
149
+ default: void 0
150
+ },
151
+ minScale: {
152
+ type: Number,
153
+ required: true,
154
+ default: void 0
155
+ },
156
+ maxScale: {
157
+ type: Number,
158
+ required: true,
159
+ default: void 0
160
+ },
161
+ image: {
162
+ type: Object,
163
+ required: true,
164
+ default: void 0
165
+ },
166
+ transform: {
167
+ type: Object,
168
+ required: true,
169
+ default: void 0
170
+ },
171
+ classNames: {
172
+ type: Object,
173
+ required: true,
174
+ default: void 0
175
+ },
176
+ styles: {
177
+ type: Object,
178
+ required: true,
179
+ default: void 0
180
+ },
181
+ onActive: {
182
+ type: Function,
183
+ required: true,
184
+ default: void 0
185
+ },
186
+ onFlipY: {
187
+ type: Function,
188
+ required: true,
189
+ default: void 0
190
+ },
191
+ onFlipX: {
192
+ type: Function,
193
+ required: true,
194
+ default: void 0
195
+ },
196
+ onRotateLeft: {
197
+ type: Function,
198
+ required: true,
199
+ default: void 0
200
+ },
201
+ onRotateRight: {
202
+ type: Function,
203
+ required: true,
204
+ default: void 0
205
+ },
206
+ onZoomOut: {
207
+ type: Function,
208
+ required: true,
209
+ default: void 0
210
+ },
211
+ onZoomIn: {
212
+ type: Function,
213
+ required: true,
214
+ default: void 0
215
+ },
216
+ onClose: {
217
+ type: Function,
218
+ required: true,
219
+ default: void 0
220
+ },
221
+ onReset: {
222
+ type: Function,
223
+ required: true,
224
+ default: void 0
225
+ }
226
+ },
227
+ name: "ImagePreviewFooter"
228
+ });
229
+ export { Footer_default as default };
@@ -0,0 +1,56 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ const require_classnames = require("../util/dist/classnames.cjs");
3
+ require("../util/dist/index.cjs");
4
+ let vue = require("vue");
5
+ var PrevNext = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
6
+ return () => {
7
+ const { prefixCls, onActive, current, count, icons } = props;
8
+ const switchCls = `${prefixCls}-switch`;
9
+ const prevIcon = icons.prev ?? icons.left;
10
+ const nextIcon = icons.next ?? icons.right;
11
+ const isPrevDisabled = current === 0;
12
+ const isNextDisabled = current === count - 1;
13
+ return (0, vue.createVNode)(vue.Fragment, null, [(0, vue.createVNode)("div", {
14
+ "class": require_classnames.clsx(switchCls, `${switchCls}-prev`, { [`${switchCls}-disabled`]: isPrevDisabled }),
15
+ "onClick": () => {
16
+ if (!isPrevDisabled) onActive(-1);
17
+ }
18
+ }, [prevIcon]), (0, vue.createVNode)("div", {
19
+ "class": require_classnames.clsx(switchCls, `${switchCls}-next`, { [`${switchCls}-disabled`]: isNextDisabled }),
20
+ "onClick": () => {
21
+ if (!isNextDisabled) onActive(1);
22
+ }
23
+ }, [nextIcon])]);
24
+ };
25
+ }, {
26
+ props: {
27
+ prefixCls: {
28
+ type: String,
29
+ required: true,
30
+ default: void 0
31
+ },
32
+ onActive: {
33
+ type: Function,
34
+ required: true,
35
+ default: void 0
36
+ },
37
+ current: {
38
+ type: Number,
39
+ required: true,
40
+ default: void 0
41
+ },
42
+ count: {
43
+ type: Number,
44
+ required: true,
45
+ default: void 0
46
+ },
47
+ icons: {
48
+ type: Object,
49
+ required: true,
50
+ default: void 0
51
+ }
52
+ },
53
+ name: "ImagePreviewPrevNext"
54
+ });
55
+ var PrevNext_default = PrevNext;
56
+ exports.default = PrevNext_default;
@@ -0,0 +1,10 @@
1
+ import { OperationIcons } from './index';
2
+ export interface PrevNextProps {
3
+ prefixCls: string;
4
+ onActive: (offset: number) => void;
5
+ current: number;
6
+ count: number;
7
+ icons: OperationIcons;
8
+ }
9
+ declare const PrevNext: import('vue').DefineSetupFnComponent<PrevNextProps, {}, {}, PrevNextProps & {}, import('vue').PublicProps>;
10
+ export default PrevNext;
@@ -0,0 +1,54 @@
1
+ import { clsx } from "../util/dist/classnames.js";
2
+ import "../util/dist/index.js";
3
+ import { Fragment, createVNode, defineComponent } from "vue";
4
+ var PrevNext_default = /* @__PURE__ */ defineComponent((props) => {
5
+ return () => {
6
+ const { prefixCls, onActive, current, count, icons } = props;
7
+ const switchCls = `${prefixCls}-switch`;
8
+ const prevIcon = icons.prev ?? icons.left;
9
+ const nextIcon = icons.next ?? icons.right;
10
+ const isPrevDisabled = current === 0;
11
+ const isNextDisabled = current === count - 1;
12
+ return createVNode(Fragment, null, [createVNode("div", {
13
+ "class": clsx(switchCls, `${switchCls}-prev`, { [`${switchCls}-disabled`]: isPrevDisabled }),
14
+ "onClick": () => {
15
+ if (!isPrevDisabled) onActive(-1);
16
+ }
17
+ }, [prevIcon]), createVNode("div", {
18
+ "class": clsx(switchCls, `${switchCls}-next`, { [`${switchCls}-disabled`]: isNextDisabled }),
19
+ "onClick": () => {
20
+ if (!isNextDisabled) onActive(1);
21
+ }
22
+ }, [nextIcon])]);
23
+ };
24
+ }, {
25
+ props: {
26
+ prefixCls: {
27
+ type: String,
28
+ required: true,
29
+ default: void 0
30
+ },
31
+ onActive: {
32
+ type: Function,
33
+ required: true,
34
+ default: void 0
35
+ },
36
+ current: {
37
+ type: Number,
38
+ required: true,
39
+ default: void 0
40
+ },
41
+ count: {
42
+ type: Number,
43
+ required: true,
44
+ default: void 0
45
+ },
46
+ icons: {
47
+ type: Object,
48
+ required: true,
49
+ default: void 0
50
+ }
51
+ },
52
+ name: "ImagePreviewPrevNext"
53
+ });
54
+ export { PrevNext_default as default };