forked from epicmaxco/vuestic-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes epicmaxco#426 Co-authored-by: Damir Sadykov <damir.sadykov@fastdev.se> Co-authored-by: Dmitry Kushnerevich <kushich.dmitry@gmail.com>
- Loading branch information
1 parent
a9ec3ed
commit 8fd799d
Showing
18 changed files
with
406 additions
and
96 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
packages/docs/src/components/page-configs/ui-elements/va-toast/api-options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ManualApiOptions } from 'vuestic-ui/src/services/api-docs/ManualApiOptions' | ||
|
||
export default { | ||
props: { | ||
title: { local: true }, | ||
offsetY: { local: true }, | ||
offsetX: { local: true }, | ||
message: { local: true }, | ||
icon: { local: true }, | ||
customClass: { local: true }, | ||
duration: { local: true }, | ||
closeable: { local: true }, | ||
onClose: { local: true }, | ||
onClick: { local: true }, | ||
position: { local: true }, | ||
render: { local: true }, | ||
multiLine: { local: true }, | ||
}, | ||
events: { | ||
}, | ||
methods: { | ||
}, | ||
slots: { | ||
}, | ||
} as ManualApiOptions |
111 changes: 111 additions & 0 deletions
111
packages/docs/src/components/page-configs/ui-elements/va-toast/page-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import VaToast from 'vuestic-ui/src/components/vuestic-components/va-toast/VaToast.vue' | ||
import apiOptions from './api-options' | ||
import { BlockType, ApiDocsBlock } from '../../../../types/configTypes' | ||
|
||
export default [ | ||
{ | ||
type: BlockType.TITLE, | ||
translationString: 'toast.title', | ||
}, | ||
{ | ||
type: BlockType.PARAGRAPH, | ||
translationString: 'toast.summaryText', | ||
}, | ||
{ | ||
type: BlockType.SUBTITLE, | ||
translationString: 'all.examples', | ||
}, | ||
{ | ||
type: BlockType.HEADLINE, | ||
translationString: 'toast.examples.default.title', | ||
}, | ||
{ | ||
type: BlockType.PARAGRAPH, | ||
translationString: 'toast.examples.default.text', | ||
}, | ||
{ | ||
type: BlockType.EXAMPLE, | ||
component: 'va-toast/Default', | ||
}, | ||
{ | ||
type: BlockType.HEADLINE, | ||
translationString: 'toast.examples.color.title', | ||
}, | ||
{ | ||
type: BlockType.PARAGRAPH, | ||
translationString: 'toast.examples.color.text', | ||
}, | ||
{ | ||
type: BlockType.EXAMPLE, | ||
component: 'va-toast/Color', | ||
}, | ||
{ | ||
type: BlockType.HEADLINE, | ||
translationString: 'toast.examples.offset.title', | ||
}, | ||
{ | ||
type: BlockType.PARAGRAPH, | ||
translationString: 'toast.examples.offset.text', | ||
}, | ||
{ | ||
type: BlockType.EXAMPLE, | ||
component: 'va-toast/Offset', | ||
}, | ||
{ | ||
type: BlockType.HEADLINE, | ||
translationString: 'toast.examples.position.title', | ||
}, | ||
{ | ||
type: BlockType.PARAGRAPH, | ||
translationString: 'toast.examples.position.text', | ||
}, | ||
{ | ||
type: BlockType.EXAMPLE, | ||
component: 'va-toast/Position', | ||
}, | ||
{ | ||
type: BlockType.HEADLINE, | ||
translationString: 'toast.examples.close.title', | ||
}, | ||
{ | ||
type: BlockType.PARAGRAPH, | ||
translationString: 'toast.examples.close.text', | ||
}, | ||
{ | ||
type: BlockType.EXAMPLE, | ||
component: 'va-toast/Close', | ||
}, | ||
{ | ||
type: BlockType.HEADLINE, | ||
translationString: 'toast.examples.click.title', | ||
}, | ||
{ | ||
type: BlockType.PARAGRAPH, | ||
translationString: 'toast.examples.click.text', | ||
}, | ||
{ | ||
type: BlockType.EXAMPLE, | ||
component: 'va-toast/Click', | ||
}, | ||
{ | ||
type: BlockType.SUBTITLE, | ||
translationString: 'all.api', | ||
}, | ||
{ | ||
type: BlockType.API, | ||
componentOptions: VaToast, | ||
apiOptions, | ||
}, | ||
{ | ||
type: BlockType.SUBTITLE, | ||
translationString: 'all.faq', | ||
}, | ||
{ | ||
type: BlockType.HEADLINE, | ||
translationString: 'toast.faq.questions[0].question', | ||
}, | ||
{ | ||
type: BlockType.PARAGRAPH, | ||
translationString: 'toast.faq.questions[0].answer', | ||
}, | ||
] as ApiDocsBlock[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<va-button @click="$vaToast.init({ | ||
message: 'Notification with onClick handler', | ||
onClick: clickHandler | ||
})">notification with custom onClick handler</va-button> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
methods: { | ||
clickHandler () { | ||
alert('clicked') | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init({ | ||
message: 'Notification with onClose handler', | ||
onClose: closeHandler | ||
})">notification with custom onClose handler</va-button> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.close('notification_4')">Close #4 toast</va-button> | ||
<va-button @click="$vaToast.closeAll()">Close all toasts</va-button> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
methods: { | ||
closeHandler () { | ||
alert('Toast closed') | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init({ message: 'primary color', color: 'primary' })">primary</va-button> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init({ message: 'success color', color: 'success' })">success</va-button> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init({ message: 'danger color', color: 'danger' })">danger</va-button> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init({ message: 'warning color', color: 'warning' })">warning</va-button> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init({ message: '#5d0cf8 color', color: '#5d0cf8' })">#5d0cf8</va-button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<template> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init('Hello')">Basic notification</va-button> | ||
<va-button @click="$vaToast.init('\<span style=\'font-weight: bold\'>Bold message</span>')">HTML code inside</va-button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<va-button @click="$vaToast.init({message: 'Custom offsets, (Y: 100, X: 100)', offsetX: 100, offsetY: 100})">Y: 100, X: 100</va-button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init({message: 'Top-right', position: 'top-right'})">top-right</va-button> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init({message: 'Top-left', position: 'top-left'})">top-left</va-button> | ||
<va-button class="mr-2 mb-2" @click="$vaToast.init({message: 'Bottom-right', position: 'bottom-right'})">bottom-right</va-button> | ||
<va-button @click="$vaToast.init({message: 'Bottom-left', position: 'bottom-left'})">bottom-left</va-button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<docs-content :config="configComputed" /> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Vue, Options } from 'vue-class-component' | ||
import DocsContent from '../../components/DocsContent.vue' | ||
import toastConfig from '../../components/page-configs/ui-elements/va-toast/page-config' | ||
@Options({ | ||
components: { | ||
DocsContent, | ||
}, | ||
}) | ||
export default class Toast extends Vue { | ||
get configComputed () { | ||
return toastConfig | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.