2023-06-01 06:58:30 +00:00
|
|
|
import PreviewGroup, { imageGroupProps } from '../vc-image/src/PreviewGroup';
|
|
|
|
import type { ExtractPropTypes } from 'vue';
|
2022-03-12 01:56:32 +00:00
|
|
|
import { computed, defineComponent } from 'vue';
|
|
|
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
2020-12-18 10:02:51 +00:00
|
|
|
|
2022-04-14 01:54:45 +00:00
|
|
|
import RotateLeftOutlined from '@ant-design/icons-vue/RotateLeftOutlined';
|
|
|
|
import RotateRightOutlined from '@ant-design/icons-vue/RotateRightOutlined';
|
|
|
|
import ZoomInOutlined from '@ant-design/icons-vue/ZoomInOutlined';
|
|
|
|
import ZoomOutOutlined from '@ant-design/icons-vue/ZoomOutOutlined';
|
|
|
|
import CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
|
|
|
|
import LeftOutlined from '@ant-design/icons-vue/LeftOutlined';
|
|
|
|
import RightOutlined from '@ant-design/icons-vue/RightOutlined';
|
|
|
|
|
|
|
|
export const icons = {
|
|
|
|
rotateLeft: <RotateLeftOutlined />,
|
|
|
|
rotateRight: <RotateRightOutlined />,
|
|
|
|
zoomIn: <ZoomInOutlined />,
|
|
|
|
zoomOut: <ZoomOutOutlined />,
|
|
|
|
close: <CloseOutlined />,
|
|
|
|
left: <LeftOutlined />,
|
|
|
|
right: <RightOutlined />,
|
|
|
|
};
|
|
|
|
|
2023-06-01 06:58:30 +00:00
|
|
|
export type ImageGroupProps = Partial<ExtractPropTypes<ReturnType<typeof imageGroupProps>>>;
|
|
|
|
|
2020-12-18 10:02:51 +00:00
|
|
|
const InternalPreviewGroup = defineComponent({
|
2022-09-26 13:33:41 +00:00
|
|
|
compatConfig: { MODE: 3 },
|
2020-12-18 10:02:51 +00:00
|
|
|
name: 'AImagePreviewGroup',
|
|
|
|
inheritAttrs: false,
|
2023-06-01 06:58:30 +00:00
|
|
|
props: imageGroupProps(),
|
2020-12-18 10:02:51 +00:00
|
|
|
setup(props, { attrs, slots }) {
|
2022-03-12 01:56:32 +00:00
|
|
|
const { getPrefixCls } = useConfigInject('image', props);
|
|
|
|
const prefixCls = computed(() => getPrefixCls('image-preview', props.previewPrefixCls));
|
2020-12-18 10:02:51 +00:00
|
|
|
return () => {
|
|
|
|
return (
|
|
|
|
<PreviewGroup
|
|
|
|
{...{ ...attrs, ...props }}
|
2022-04-14 01:54:45 +00:00
|
|
|
icons={icons}
|
2021-06-19 14:13:13 +00:00
|
|
|
previewPrefixCls={prefixCls.value}
|
2020-12-18 10:02:51 +00:00
|
|
|
v-slots={slots}
|
|
|
|
></PreviewGroup>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
|
|
|
export default InternalPreviewGroup;
|