Toast and InlineMessage unstyled demo updates
parent
ea94a658b3
commit
ac11444e3c
|
@ -0,0 +1,29 @@
|
||||||
|
<template>
|
||||||
|
<DocSectionText v-bind="$attrs">
|
||||||
|
<p>Theming is implemented with the pass through properties in unstyled mode. Example below demonstrates the built-in Tailwind theme.</p>
|
||||||
|
</DocSectionText>
|
||||||
|
<DocSectionCode :code="code" embedded />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
code: {
|
||||||
|
composition: `
|
||||||
|
<template>
|
||||||
|
<div class="card flex flex-wrap align-center justify-center gap-3">
|
||||||
|
<InlineMessage severity="success">Success Content</InlineMessage>
|
||||||
|
<InlineMessage severity="info">Info Content</InlineMessage>
|
||||||
|
<InlineMessage severity="warn">Warning Content</InlineMessage>
|
||||||
|
<InlineMessage severity="error">Error Content</InlineMessage>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
<\/script>`
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,33 @@
|
||||||
|
<template>
|
||||||
|
<div class="doc-main">
|
||||||
|
<div class="doc-intro">
|
||||||
|
<h1>InlineMessage Theming</h1>
|
||||||
|
</div>
|
||||||
|
<DocSections :docs="docs" />
|
||||||
|
</div>
|
||||||
|
<DocSectionNav :docs="docs" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import StyledDoc from './StyledDoc.vue';
|
||||||
|
import UnstyledDoc from './UnstyledDoc.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
docs: [
|
||||||
|
{
|
||||||
|
id: 'styled',
|
||||||
|
label: 'Styled',
|
||||||
|
component: StyledDoc
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'unstyled',
|
||||||
|
label: 'Unstyled',
|
||||||
|
component: UnstyledDoc
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,50 @@
|
||||||
|
<template>
|
||||||
|
<DocSectionText v-bind="$attrs">
|
||||||
|
<p>Theming is implemented with the pass through properties in unstyled mode. Example below demonstrates the built-in Tailwind theme.</p>
|
||||||
|
</DocSectionText>
|
||||||
|
<DocSectionCode :code="code" embedded />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
code: {
|
||||||
|
composition: `
|
||||||
|
<template>
|
||||||
|
<div class="card flex justify-center">
|
||||||
|
<Toast />
|
||||||
|
<div class="flex flex-wrap gap-2">
|
||||||
|
<Button label="Success" severity="success" @click="showSuccess" />
|
||||||
|
<Button label="Info" severity="info" @click="showInfo" />
|
||||||
|
<Button label="Warn" severity="warning" @click="showWarn" />
|
||||||
|
<Button label="Error" severity="danger" @click="showError" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { useToast } from "primevue/usetoast";
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
|
const showSuccess = () => {
|
||||||
|
toast.add({ severity: 'success', summary: 'Success Message', detail: 'Message Content', life: 3000 });
|
||||||
|
};
|
||||||
|
|
||||||
|
const showInfo = () => {
|
||||||
|
toast.add({ severity: 'info', summary: 'Info Message', detail: 'Message Content', life: 3000 });
|
||||||
|
};
|
||||||
|
|
||||||
|
const showWarn = () => {
|
||||||
|
toast.add({ severity: 'warn', summary: 'Warn Message', detail: 'Message Content', life: 3000 });
|
||||||
|
};
|
||||||
|
|
||||||
|
const showError = () => {
|
||||||
|
toast.add({ severity: 'error', summary: 'Error Message', detail: 'Message Content', life: 3000 });
|
||||||
|
};
|
||||||
|
<\/script>`
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,33 @@
|
||||||
|
<template>
|
||||||
|
<div class="doc-main">
|
||||||
|
<div class="doc-intro">
|
||||||
|
<h1>Toast Theming</h1>
|
||||||
|
</div>
|
||||||
|
<DocSections :docs="docs" />
|
||||||
|
</div>
|
||||||
|
<DocSectionNav :docs="docs" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import StyledDoc from './StyledDoc.vue';
|
||||||
|
import UnstyledDoc from './UnstyledDoc.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
docs: [
|
||||||
|
{
|
||||||
|
id: 'styled',
|
||||||
|
label: 'Styled',
|
||||||
|
component: StyledDoc
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'unstyled',
|
||||||
|
label: 'Unstyled',
|
||||||
|
component: UnstyledDoc
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -6,6 +6,7 @@
|
||||||
:componentDocs="docs"
|
:componentDocs="docs"
|
||||||
:apiDocs="['InlineMessage']"
|
:apiDocs="['InlineMessage']"
|
||||||
:ptTabComponent="ptComponent"
|
:ptTabComponent="ptComponent"
|
||||||
|
:themingDocs="themingDoc"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -15,9 +16,9 @@ import BasicDoc from '@/doc/inlinemessage/BasicDoc.vue';
|
||||||
import FormDoc from '@/doc/inlinemessage/FormDoc.vue';
|
import FormDoc from '@/doc/inlinemessage/FormDoc.vue';
|
||||||
import ImportDoc from '@/doc/inlinemessage/ImportDoc.vue';
|
import ImportDoc from '@/doc/inlinemessage/ImportDoc.vue';
|
||||||
import SeverityDoc from '@/doc/inlinemessage/SeverityDoc.vue';
|
import SeverityDoc from '@/doc/inlinemessage/SeverityDoc.vue';
|
||||||
import StyleDoc from '@/doc/inlinemessage/StyleDoc.vue';
|
|
||||||
import TemplateDoc from '@/doc/inlinemessage/TemplateDoc.vue';
|
import TemplateDoc from '@/doc/inlinemessage/TemplateDoc.vue';
|
||||||
import PTComponent from '@/doc/inlinemessage/pt/index.vue';
|
import PTComponent from '@/doc/inlinemessage/pt/index.vue';
|
||||||
|
import ThemingDoc from '@/doc/inlinemessage/theming/index.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
@ -48,18 +49,14 @@ export default {
|
||||||
label: 'Template',
|
label: 'Template',
|
||||||
component: TemplateDoc
|
component: TemplateDoc
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: 'style',
|
|
||||||
label: 'Style',
|
|
||||||
component: StyleDoc
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 'accessibility',
|
id: 'accessibility',
|
||||||
label: 'Accessibility',
|
label: 'Accessibility',
|
||||||
component: AccessibilityDoc
|
component: AccessibilityDoc
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
ptComponent: PTComponent
|
ptComponent: PTComponent,
|
||||||
|
themingDoc: ThemingDoc
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<DocComponent title="Vue Toast Component" header="Toast" description="Toast is used to display messages in an overlay." :componentDocs="docs" :apiDocs="['Toast', 'ToastService-UseToast']" :ptTabComponent="ptComponent" />
|
<DocComponent title="Vue Toast Component" header="Toast" description="Toast is used to display messages in an overlay." :componentDocs="docs" :apiDocs="['Toast', 'ToastService-UseToast']" :ptTabComponent="ptComponent" :themingDocs="themingDoc" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -10,10 +10,10 @@ import MultipleDoc from '@/doc/toast/MultipleDoc.vue';
|
||||||
import PositionDoc from '@/doc/toast/PositionDoc.vue';
|
import PositionDoc from '@/doc/toast/PositionDoc.vue';
|
||||||
import SeverityDoc from '@/doc/toast/SeverityDoc.vue';
|
import SeverityDoc from '@/doc/toast/SeverityDoc.vue';
|
||||||
import StickyDoc from '@/doc/toast/StickyDoc.vue';
|
import StickyDoc from '@/doc/toast/StickyDoc.vue';
|
||||||
import StyleDoc from '@/doc/toast/StyleDoc.vue';
|
|
||||||
import TemplateDoc from '@/doc/toast/TemplateDoc.vue';
|
import TemplateDoc from '@/doc/toast/TemplateDoc.vue';
|
||||||
import ToastServiceDoc from '@/doc/toast/ToastServiceDoc.vue';
|
import ToastServiceDoc from '@/doc/toast/ToastServiceDoc.vue';
|
||||||
import PTComponent from '@/doc/toast/pt/index.vue';
|
import PTComponent from '@/doc/toast/pt/index.vue';
|
||||||
|
import ThemingDoc from '@/doc/toast/theming/index.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
@ -59,18 +59,14 @@ export default {
|
||||||
label: 'Template',
|
label: 'Template',
|
||||||
component: TemplateDoc
|
component: TemplateDoc
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: 'style',
|
|
||||||
label: 'Style',
|
|
||||||
component: StyleDoc
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 'accessibility',
|
id: 'accessibility',
|
||||||
label: 'Accessibility',
|
label: 'Accessibility',
|
||||||
component: AccessibilityDoc
|
component: AccessibilityDoc
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
ptComponent: PTComponent
|
ptComponent: PTComponent,
|
||||||
|
themingDoc: ThemingDoc
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue