Initiated ImageCompare component
parent
5889548cae
commit
6980c24703
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
|
@ -416,8 +416,8 @@
|
||||||
"to": "/image"
|
"to": "/image"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ImageDiff",
|
"name": "ImageCompare",
|
||||||
"to": "/imagediff",
|
"to": "/imagecompare",
|
||||||
"badge": "NEW"
|
"badge": "NEW"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
<template>
|
||||||
|
<DocSectionText v-bind="$attrs">
|
||||||
|
<p>Images are defined using templating with <i>left</i> and <i>right</i> slots. Use the <i>style</i> or <i>class</i> properties to define the size of the container.</p>
|
||||||
|
</DocSectionText>
|
||||||
|
<div class="card flex justify-center">
|
||||||
|
<ImageCompare class="shadow-lg rounded-2xl">
|
||||||
|
<template #left>
|
||||||
|
<img src="~/assets/images/island1.jpg" />
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<img src="~/assets/images/island2.jpg" />
|
||||||
|
</template>
|
||||||
|
</ImageCompare>
|
||||||
|
</div>
|
||||||
|
<DocSectionCode :code="code" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
code: {
|
||||||
|
basic: `
|
||||||
|
<ImageCompare class="shadow-lg rounded-2xl">
|
||||||
|
<template #left>
|
||||||
|
<img src="~/assets/images/island1.jpg" />
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<img src="~/assets/images/island2.jpg" />
|
||||||
|
</template>
|
||||||
|
</ImageCompare>
|
||||||
|
`,
|
||||||
|
options: `
|
||||||
|
<template>
|
||||||
|
<div class="card flex justify-center">
|
||||||
|
<ImageCompare class="shadow-lg rounded-2xl">
|
||||||
|
<template #left>
|
||||||
|
<img src="~/assets/images/island1.jpg" />
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<img src="~/assets/images/island2.jpg" />
|
||||||
|
</template>
|
||||||
|
</ImageCompare>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
`,
|
||||||
|
composition: `
|
||||||
|
<template>
|
||||||
|
<div class="card flex justify-center">
|
||||||
|
<ImageCompare class="shadow-lg rounded-2xl">
|
||||||
|
<template #left>
|
||||||
|
<img src="~/assets/images/island1.jpg" />
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<img src="~/assets/images/island2.jpg" />
|
||||||
|
</template>
|
||||||
|
</ImageCompare>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -9,7 +9,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
code: {
|
code: {
|
||||||
basic: `
|
basic: `
|
||||||
import ImageDiff from 'primevue/imagediff';
|
import ImageCompare from 'primevue/imagecompare';
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -0,0 +1,65 @@
|
||||||
|
<template>
|
||||||
|
<DocSectionText v-bind="$attrs">
|
||||||
|
<p>Apply responsive styles to the container element to optimize display per screen size.</p>
|
||||||
|
</DocSectionText>
|
||||||
|
<div class="card flex justify-center">
|
||||||
|
<ImageCompare class="w-full sm:w-96 shadow-lg rounded-2xl">
|
||||||
|
<template #left>
|
||||||
|
<img src="~/assets/images/island1.jpg" />
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<img src="~/assets/images/island2.jpg" />
|
||||||
|
</template>
|
||||||
|
</ImageCompare>
|
||||||
|
</div>
|
||||||
|
<DocSectionCode :code="code" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
code: {
|
||||||
|
basic: `
|
||||||
|
<ImageCompare class="w-full sm:w-96 shadow-lg rounded-2xl">
|
||||||
|
<template #left>
|
||||||
|
<img src="~/assets/images/island1.jpg" />
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<img src="~/assets/images/island2.jpg" />
|
||||||
|
</template>
|
||||||
|
</ImageCompare>
|
||||||
|
`,
|
||||||
|
options: `
|
||||||
|
<template>
|
||||||
|
<div class="card flex justify-center">
|
||||||
|
<ImageCompare class="w-full sm:w-96 shadow-lg rounde-2xl">
|
||||||
|
<template #left>
|
||||||
|
<img src="~/assets/images/island1.jpg" />
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<img src="~/assets/images/island2.jpg" />
|
||||||
|
</template>
|
||||||
|
</ImageCompare>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
`,
|
||||||
|
composition: `
|
||||||
|
<template>
|
||||||
|
<div class="card flex justify-center">
|
||||||
|
<ImageCompare class="w-full sm:w-96 shadow-lg">
|
||||||
|
<template #left>
|
||||||
|
<img src="~/assets/images/island1.jpg" />
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<img src="~/assets/images/island2.jpg" />
|
||||||
|
</template>
|
||||||
|
</ImageCompare>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,29 @@
|
||||||
|
<template>
|
||||||
|
<DocPTViewer :docs="docs">
|
||||||
|
<ImageCompare style="width: 728px; height: 410px">
|
||||||
|
<template #left>
|
||||||
|
<img src="~/assets/images/island1.jpg" />
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<img src="~/assets/images/island2.jpg" />
|
||||||
|
</template>
|
||||||
|
</ImageCompare>
|
||||||
|
</DocPTViewer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getPTOptions } from '@/components/doc/helpers';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
docs: [
|
||||||
|
{
|
||||||
|
data: getPTOptions('ImageCompare'),
|
||||||
|
key: 'ImageCompare'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="doc-main">
|
<div class="doc-main">
|
||||||
<div class="doc-intro">
|
<div class="doc-intro">
|
||||||
<h1>ImageDiff Pass Through</h1>
|
<h1>ImageCompare Pass Through</h1>
|
||||||
</div>
|
</div>
|
||||||
<DocSections :docs="docs" />
|
<DocSections :docs="docs" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,10 +23,10 @@ export default {
|
||||||
component: PTViewer
|
component: PTViewer
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'pt.doc.image',
|
id: 'pt.doc.imagecompare',
|
||||||
label: 'ImageDiff PT Options',
|
label: 'ImageCompare PT Options',
|
||||||
component: DocApiTable,
|
component: DocApiTable,
|
||||||
data: getPTOptions('ImageDiff')
|
data: getPTOptions('ImageCompare')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="doc-main">
|
<div class="doc-main">
|
||||||
<div class="doc-intro">
|
<div class="doc-intro">
|
||||||
<h1>ImageDiff Theming</h1>
|
<h1>ImageCompare Theming</h1>
|
||||||
</div>
|
</div>
|
||||||
<DocSections :docs="docs" />
|
<DocSections :docs="docs" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,14 +26,14 @@ export default {
|
||||||
label: 'CSS Classes',
|
label: 'CSS Classes',
|
||||||
description: 'List of class names used in the styled mode.',
|
description: 'List of class names used in the styled mode.',
|
||||||
component: DocApiTable,
|
component: DocApiTable,
|
||||||
data: getStyleOptions('ImageDiff')
|
data: getStyleOptions('ImageCompare')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'theming.tokens',
|
id: 'theming.tokens',
|
||||||
label: 'Design Tokens',
|
label: 'Design Tokens',
|
||||||
description: 'List of design tokens used in a preset.',
|
description: 'List of design tokens used in a preset.',
|
||||||
component: DocApiTable,
|
component: DocApiTable,
|
||||||
data: getTokenOptions('ImageDiff')
|
data: getTokenOptions('ImageCompare')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
|
@ -1,37 +0,0 @@
|
||||||
<template>
|
|
||||||
<DocSectionText v-bind="$attrs">
|
|
||||||
<p>ImageDiff</p>
|
|
||||||
</DocSectionText>
|
|
||||||
<div class="card flex justify-center">
|
|
||||||
<ImageDiff />
|
|
||||||
</div>
|
|
||||||
<DocSectionCode :code="code" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
code: {
|
|
||||||
basic: `
|
|
||||||
<ImageDiff />
|
|
||||||
`,
|
|
||||||
options: `
|
|
||||||
<template>
|
|
||||||
<div class="card flex justify-center">
|
|
||||||
<Image src="https://primefaces.org/cdn/primevue/images/galleria/galleria10.jpg" alt="Image" width="250" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
`,
|
|
||||||
composition: `
|
|
||||||
<template>
|
|
||||||
<div class="card flex justify-center">
|
|
||||||
<Image src="https://primefaces.org/cdn/primevue/images/galleria/galleria10.jpg" alt="Image" width="250" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
`
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
|
@ -1,22 +0,0 @@
|
||||||
<template>
|
|
||||||
<DocPTViewer :docs="docs">
|
|
||||||
<Image src="https://primefaces.org/cdn/primevue/images/galleria/galleria10.jpg" alt="Image" width="250" preview />
|
|
||||||
</DocPTViewer>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getPTOptions } from '@/components/doc/helpers';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
docs: [
|
|
||||||
{
|
|
||||||
data: getPTOptions('ImageDiff'),
|
|
||||||
key: 'ImageDiff'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
<template>
|
||||||
|
<DocComponent title="Vue ImageCompare Component" header="ImageCompare" description="Compare two images side by side with a slider." :componentDocs="docs" :apiDocs="['ImageCompare']" :ptTabComponent="ptComponent" :themingDocs="themingDoc" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AccessibilityDoc from '@/doc/imagecompare/AccessibilityDoc.vue';
|
||||||
|
import BasicDoc from '@/doc/imagecompare/BasicDoc.vue';
|
||||||
|
import ImportDoc from '@/doc/imagecompare/ImportDoc.vue';
|
||||||
|
import ResponsiveDoc from '@/doc/imagecompare/ResponsiveDoc.vue';
|
||||||
|
import PTComponent from '@/doc/imagecompare/pt/index.vue';
|
||||||
|
import ThemingDoc from '@/doc/imagecompare/theming/index.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
docs: [
|
||||||
|
{
|
||||||
|
id: 'import',
|
||||||
|
label: 'Import',
|
||||||
|
component: ImportDoc
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'basic',
|
||||||
|
label: 'Basic',
|
||||||
|
component: BasicDoc
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'responsive',
|
||||||
|
label: 'Responsive',
|
||||||
|
component: ResponsiveDoc
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'accessibility',
|
||||||
|
label: 'Accessibility',
|
||||||
|
component: AccessibilityDoc
|
||||||
|
}
|
||||||
|
],
|
||||||
|
ptComponent: PTComponent,
|
||||||
|
themingDoc: ThemingDoc
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -1,39 +0,0 @@
|
||||||
<template>
|
|
||||||
<DocComponent title="Vue ImageDiff Component" header="ImageDiff" description="ImageDiff" :componentDocs="docs" :apiDocs="['ImageDiff']" />
|
|
||||||
</template>
|
|
||||||
<!-- :ptTabComponent="ptComponent"
|
|
||||||
:themingDocs="themingDoc" -->
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import AccessibilityDoc from '@/doc/imagediff/AccessibilityDoc.vue';
|
|
||||||
import BasicDoc from '@/doc/imagediff/BasicDoc.vue';
|
|
||||||
import ImportDoc from '@/doc/imagediff/ImportDoc.vue';
|
|
||||||
// import PTComponent from '@/doc/imagediff/pt/index.vue';
|
|
||||||
// import ThemingDoc from '@/doc/imagediff/theming/index.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
docs: [
|
|
||||||
{
|
|
||||||
id: 'import',
|
|
||||||
label: 'Import',
|
|
||||||
component: ImportDoc
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'basic',
|
|
||||||
label: 'Basic',
|
|
||||||
component: BasicDoc
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'accessibility',
|
|
||||||
label: 'Accessibility',
|
|
||||||
component: AccessibilityDoc
|
|
||||||
}
|
|
||||||
]
|
|
||||||
// ptComponent: PTComponent,
|
|
||||||
// themingDoc: ThemingDoc
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
|
@ -90,7 +90,7 @@ export const chart: MetaType[] = toMeta(['Chart']);
|
||||||
|
|
||||||
export const messages: MetaType[] = toMeta(['Message', 'InlineMessage', { name: 'Toast', use: { as: 'ToastService' } }]);
|
export const messages: MetaType[] = toMeta(['Message', 'InlineMessage', { name: 'Toast', use: { as: 'ToastService' } }]);
|
||||||
|
|
||||||
export const media: MetaType[] = toMeta(['Carousel', 'Galleria', 'Image', 'ImageDiff']);
|
export const media: MetaType[] = toMeta(['Carousel', 'Galleria', 'Image', 'ImageCompare']);
|
||||||
|
|
||||||
export const misc: MetaType[] = toMeta(['Avatar', 'AvatarGroup', 'Badge', 'BlockUI', 'Chip', 'Inplace', 'MeterGroup', 'OverlayBadge', 'ScrollTop', 'Skeleton', 'ProgressBar', 'ProgressSpinner', 'Tag', 'Terminal']);
|
export const misc: MetaType[] = toMeta(['Avatar', 'AvatarGroup', 'Badge', 'BlockUI', 'Chip', 'Inplace', 'MeterGroup', 'OverlayBadge', 'ScrollTop', 'Skeleton', 'ProgressBar', 'ProgressSpinner', 'Tag', 'Terminal']);
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ import type { GalleriaPassThroughOptions } from 'primevue/galleria';
|
||||||
import type { IconFieldPassThroughOptions } from 'primevue/iconfield';
|
import type { IconFieldPassThroughOptions } from 'primevue/iconfield';
|
||||||
import type { IftaLabelPassThroughOptions } from 'primevue/iftalabel';
|
import type { IftaLabelPassThroughOptions } from 'primevue/iftalabel';
|
||||||
import type { ImagePassThroughOptions } from 'primevue/image';
|
import type { ImagePassThroughOptions } from 'primevue/image';
|
||||||
import type { ImageDiffPassThroughOptions } from 'primevue/imagediff';
|
import type { ImageComparePassThroughOptions } from 'primevue/imagecompare';
|
||||||
import type { InlineMessagePassThroughOptions } from 'primevue/inlinemessage';
|
import type { InlineMessagePassThroughOptions } from 'primevue/inlinemessage';
|
||||||
import type { InplacePassThroughOptions } from 'primevue/inplace';
|
import type { InplacePassThroughOptions } from 'primevue/inplace';
|
||||||
import type { InputChipsPassThroughOptions } from 'primevue/inputchips';
|
import type { InputChipsPassThroughOptions } from 'primevue/inputchips';
|
||||||
|
@ -206,7 +206,7 @@ export interface PrimeVuePTOptions {
|
||||||
iconfield?: DefaultPassThrough<IconFieldPassThroughOptions>;
|
iconfield?: DefaultPassThrough<IconFieldPassThroughOptions>;
|
||||||
iftalabel?: DefaultPassThrough<IftaLabelPassThroughOptions>;
|
iftalabel?: DefaultPassThrough<IftaLabelPassThroughOptions>;
|
||||||
image?: DefaultPassThrough<ImagePassThroughOptions>;
|
image?: DefaultPassThrough<ImagePassThroughOptions>;
|
||||||
imagediff?: DefaultPassThrough<ImageDiffPassThroughOptions>;
|
imagecompare?: DefaultPassThrough<ImageComparePassThroughOptions>;
|
||||||
inlinemessage?: DefaultPassThrough<InlineMessagePassThroughOptions>;
|
inlinemessage?: DefaultPassThrough<InlineMessagePassThroughOptions>;
|
||||||
inplace?: DefaultPassThrough<InplacePassThroughOptions>;
|
inplace?: DefaultPassThrough<InplacePassThroughOptions>;
|
||||||
inputchips?: DefaultPassThrough<InputChipsPassThroughOptions>;
|
inputchips?: DefaultPassThrough<InputChipsPassThroughOptions>;
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<script>
|
<script>
|
||||||
import BaseComponent from '@primevue/core/basecomponent';
|
import BaseComponent from '@primevue/core/basecomponent';
|
||||||
import ImageDiffStyle from 'primevue/imagediff/style';
|
import ImageCompareStyle from 'primevue/imagecompare/style';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BaseImageDiff',
|
name: 'BaseImageCompare',
|
||||||
extends: BaseComponent,
|
extends: BaseComponent,
|
||||||
props: {},
|
props: {},
|
||||||
style: ImageDiffStyle,
|
style: ImageCompareStyle,
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
$pcImageDiff: this,
|
$pcImageCompare: this,
|
||||||
$parentInstance: this
|
$parentInstance: this
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -1,24 +1,24 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* ImageDiff
|
* ImageCompare
|
||||||
*
|
*
|
||||||
* [Live Demo](https://www.primevue.org/imagediff/)
|
* [Live Demo](https://www.primevue.org/ImageCompare/)
|
||||||
*
|
*
|
||||||
* @module imagediff
|
* @module ImageCompare
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
|
import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, PassThrough } from '@primevue/core';
|
||||||
import type { PassThroughOptions } from 'primevue/passthrough';
|
import type { PassThroughOptions } from 'primevue/passthrough';
|
||||||
import { TransitionProps } from 'vue';
|
import { TransitionProps } from 'vue';
|
||||||
|
|
||||||
export declare type ImageDiffPassThroughOptionType = ImageDiffPassThroughAttributes | ((options: ImageDiffPassThroughMethodOptions) => ImageDiffPassThroughAttributes | string) | string | null | undefined;
|
export declare type ImageComparePassThroughOptionType = ImageComparePassThroughAttributes | ((options: ImageComparePassThroughMethodOptions) => ImageComparePassThroughAttributes | string) | string | null | undefined;
|
||||||
|
|
||||||
export declare type ImageDiffPassThroughTransitionType = TransitionProps | ((options: ImageDiffPassThroughMethodOptions) => TransitionProps) | undefined;
|
export declare type ImageComparePassThroughTransitionType = TransitionProps | ((options: ImageComparePassThroughMethodOptions) => TransitionProps) | undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom passthrough(pt) option method.
|
* Custom passthrough(pt) option method.
|
||||||
*/
|
*/
|
||||||
export interface ImageDiffPassThroughMethodOptions {
|
export interface ImageComparePassThroughMethodOptions {
|
||||||
/**
|
/**
|
||||||
* Defines instance.
|
* Defines instance.
|
||||||
*/
|
*/
|
||||||
|
@ -26,7 +26,7 @@ export interface ImageDiffPassThroughMethodOptions {
|
||||||
/**
|
/**
|
||||||
* Defines valid properties.
|
* Defines valid properties.
|
||||||
*/
|
*/
|
||||||
props: ImageDiffProps;
|
props: ImageCompareProps;
|
||||||
/**
|
/**
|
||||||
* Defines valid attributes.
|
* Defines valid attributes.
|
||||||
*/
|
*/
|
||||||
|
@ -43,35 +43,35 @@ export interface ImageDiffPassThroughMethodOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom passthrough(pt) options.
|
* Custom passthrough(pt) options.
|
||||||
* @see {@link ImageDiffProps.pt}
|
* @see {@link ImageCompareProps.pt}
|
||||||
*/
|
*/
|
||||||
export interface ImageDiffPassThroughOptions {
|
export interface ImageComparePassThroughOptions {
|
||||||
/**
|
/**
|
||||||
* Used to pass attributes to the root's DOM element.
|
* Used to pass attributes to the root's DOM element.
|
||||||
*/
|
*/
|
||||||
root?: ImageDiffPassThroughOptionType;
|
root?: ImageComparePassThroughOptionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom passthrough attributes for each DOM elements
|
* Custom passthrough attributes for each DOM elements
|
||||||
*/
|
*/
|
||||||
export interface ImageDiffPassThroughAttributes {
|
export interface ImageComparePassThroughAttributes {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines valid properties in ImageDiff component.
|
* Defines valid properties in ImageCompare component.
|
||||||
*/
|
*/
|
||||||
export interface ImageDiffProps {
|
export interface ImageCompareProps {
|
||||||
/**
|
/**
|
||||||
* It generates scoped CSS variables using design tokens for the component.
|
* It generates scoped CSS variables using design tokens for the component.
|
||||||
*/
|
*/
|
||||||
dt?: DesignToken<any>;
|
dt?: DesignToken<any>;
|
||||||
/**
|
/**
|
||||||
* Used to pass attributes to DOM elements inside the component.
|
* Used to pass attributes to DOM elements inside the component.
|
||||||
* @type {ImageDiffPassThroughOptions}
|
* @type {ImageComparePassThroughOptions}
|
||||||
*/
|
*/
|
||||||
pt?: PassThrough<ImageDiffPassThroughOptions>;
|
pt?: PassThrough<ImageComparePassThroughOptions>;
|
||||||
/**
|
/**
|
||||||
* Used to configure passthrough(pt) options of the component.
|
* Used to configure passthrough(pt) options of the component.
|
||||||
* @type {PassThroughOptions}
|
* @type {PassThroughOptions}
|
||||||
|
@ -85,32 +85,32 @@ export interface ImageDiffProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines valid slots in ImageDiff slots.
|
* Defines valid slots in ImageCompare slots.
|
||||||
*/
|
*/
|
||||||
export interface ImageDiffSlots {}
|
export interface ImageCompareSlots {}
|
||||||
|
|
||||||
export interface ImageDiffEmitsOptions {}
|
export interface ImageCompareEmitsOptions {}
|
||||||
|
|
||||||
export declare type ImageDiffEmits = EmitFn<ImageDiffEmitsOptions>;
|
export declare type ImageCompareEmits = EmitFn<ImageCompareEmitsOptions>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* **PrimeVue - ImageDiff**
|
* **PrimeVue - ImageCompare**
|
||||||
*
|
*
|
||||||
* _ImageDiff_
|
* _ImageCompare_
|
||||||
*
|
*
|
||||||
* [Live Demo](https://www.primevue.org/imagediff/)
|
* [Live Demo](https://www.primevue.org/ImageCompare/)
|
||||||
* --- ---
|
* --- ---
|
||||||
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
||||||
*
|
*
|
||||||
* @group Component
|
* @group Component
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
declare const ImageDiff: DefineComponent<ImageDiffProps, ImageDiffSlots, ImageDiffEmits>;
|
declare const ImageCompare: DefineComponent<ImageCompareProps, ImageCompareSlots, ImageCompareEmits>;
|
||||||
|
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
ImageDiff: GlobalComponentConstructor<ImageDiffProps, ImageDiffSlots, ImageDiffEmits>;
|
ImageCompare: GlobalComponentConstructor<ImageCompareProps, ImageCompareSlots, ImageCompareEmits>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ImageDiff;
|
export default ImageCompare;
|
|
@ -0,0 +1,26 @@
|
||||||
|
<template>
|
||||||
|
<div :class="cx('root')" :pt="ptmi('root')">
|
||||||
|
<slot name="left"></slot>
|
||||||
|
<slot name="right"></slot>
|
||||||
|
<input type="range" min="0" max="100" value="50" @input="onSlide" :class="cx('slider')" :pt="ptm('slider')" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseImageCompare from './BaseImageCompare.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ImageCompare',
|
||||||
|
extends: BaseImageCompare,
|
||||||
|
methods: {
|
||||||
|
onSlide(event) {
|
||||||
|
const value = event.target.value;
|
||||||
|
const image = event.target.previousElementSibling;
|
||||||
|
|
||||||
|
console.log(image);
|
||||||
|
|
||||||
|
image.style.clipPath = 'polygon(0 0,' + value + '% 0,' + value + '% 100%, 0 100%)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"main": "./ImageCompare.vue",
|
||||||
|
"module": "./ImageCompare.vue",
|
||||||
|
"types": "./ImageCompare.d.ts",
|
||||||
|
"browser": {
|
||||||
|
"./sfc": "./ImageCompare.vue"
|
||||||
|
},
|
||||||
|
"sideEffects": [
|
||||||
|
"*.vue"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
import BaseStyle from '@primevue/core/base/style';
|
||||||
|
|
||||||
|
const theme = ({ dt }) => `
|
||||||
|
.p-imagecompare {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-imagecompare img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-imagecompare img + img {
|
||||||
|
clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-imagecompare-slider {
|
||||||
|
position: relative;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
width: calc(100% + 40px);
|
||||||
|
height: 100%;
|
||||||
|
margin-left: -20px;
|
||||||
|
background-color: transparent;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-imagecompare-slider::-webkit-slider-thumb {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
height: 45px;
|
||||||
|
width: 45px;
|
||||||
|
background: #ffffff33;
|
||||||
|
border: 3px solid #ffffff99;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-size: contain;
|
||||||
|
cursor: ew-resize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-imagecompare-slider::-moz-range-thumb {
|
||||||
|
height: 45px;
|
||||||
|
width: 45px;
|
||||||
|
background: #ffffff33;
|
||||||
|
border: 3px solid #ffffff99;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-size: contain;
|
||||||
|
cursor: ew-resize;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const classes = {
|
||||||
|
root: 'p-imagecompare',
|
||||||
|
slider: 'p-imagecompare-slider'
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BaseStyle.extend({
|
||||||
|
name: 'imagecompare',
|
||||||
|
theme,
|
||||||
|
classes
|
||||||
|
});
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"main": "./ImageCompareStyle.js",
|
||||||
|
"module": "./ImageCompareStyle.js",
|
||||||
|
"types": "./ImageCompareStyle.d.ts",
|
||||||
|
"sideEffects": false
|
||||||
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
<template>
|
|
||||||
<div :class="cx('root')" :pt="ptmi('root')">
|
|
||||||
<p :pt="ptm('container')">This feature is planned for the next phase.</p>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import BaseImageDiff from './BaseImageDiff.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ImageDiff',
|
|
||||||
extends: BaseImageDiff
|
|
||||||
};
|
|
||||||
</script>
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"main": "./ImageDiff.vue",
|
|
||||||
"module": "./ImageDiff.vue",
|
|
||||||
"types": "./ImageDiff.d.ts",
|
|
||||||
"browser": {
|
|
||||||
"./sfc": "./ImageDiff.vue"
|
|
||||||
},
|
|
||||||
"sideEffects": [
|
|
||||||
"*.vue"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
import BaseStyle from '@primevue/core/base/style';
|
|
||||||
|
|
||||||
const theme = ({ dt }) => `
|
|
||||||
.
|
|
||||||
`;
|
|
||||||
|
|
||||||
const classes = {
|
|
||||||
root: 'p-imagediff'
|
|
||||||
};
|
|
||||||
|
|
||||||
export default BaseStyle.extend({
|
|
||||||
name: 'imagediff',
|
|
||||||
theme,
|
|
||||||
classes
|
|
||||||
});
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"main": "./ImageDiffStyle.js",
|
|
||||||
"module": "./ImageDiffStyle.js",
|
|
||||||
"types": "./ImageDiffStyle.d.ts",
|
|
||||||
"sideEffects": false
|
|
||||||
}
|
|
|
@ -34,7 +34,7 @@ const THEME_COMPONENTS = [
|
||||||
'IconField',
|
'IconField',
|
||||||
'IftaLabel',
|
'IftaLabel',
|
||||||
'Image',
|
'Image',
|
||||||
'ImageDiff',
|
'ImageCompare',
|
||||||
'InlineMessage',
|
'InlineMessage',
|
||||||
'Inplace',
|
'Inplace',
|
||||||
'InputChips',
|
'InputChips',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"module": "./index.js",
|
"module": "./index.js",
|
||||||
"types": "../types/imagediff/index.d.ts"
|
"types": "../types/imagecompare/index.d.ts"
|
||||||
}
|
}
|
|
@ -30,6 +30,7 @@ import galleria from '@primevue/themes/aura/galleria';
|
||||||
import iconfield from '@primevue/themes/aura/iconfield';
|
import iconfield from '@primevue/themes/aura/iconfield';
|
||||||
import iftalabel from '@primevue/themes/aura/iftalabel';
|
import iftalabel from '@primevue/themes/aura/iftalabel';
|
||||||
import image from '@primevue/themes/aura/image';
|
import image from '@primevue/themes/aura/image';
|
||||||
|
import imagecompare from '@primevue/themes/aura/imagecompare';
|
||||||
import inlinemessage from '@primevue/themes/aura/inlinemessage';
|
import inlinemessage from '@primevue/themes/aura/inlinemessage';
|
||||||
import inplace from '@primevue/themes/aura/inplace';
|
import inplace from '@primevue/themes/aura/inplace';
|
||||||
import inputchips from '@primevue/themes/aura/inputchips';
|
import inputchips from '@primevue/themes/aura/inputchips';
|
||||||
|
@ -120,6 +121,7 @@ export default {
|
||||||
galleria,
|
galleria,
|
||||||
iconfield,
|
iconfield,
|
||||||
image,
|
image,
|
||||||
|
imagecompare,
|
||||||
inlinemessage,
|
inlinemessage,
|
||||||
inplace,
|
inplace,
|
||||||
inputchips,
|
inputchips,
|
||||||
|
|
Loading…
Reference in New Issue