This repository was archived by the owner on Jan 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 17 files changed +259
-50
lines changed Expand file tree Collapse file tree 17 files changed +259
-50
lines changed Original file line number Diff line number Diff line change 8
8
"license" : " MIT" ,
9
9
"dependencies" : {
10
10
"@vueuse/core" : " ^5.2.0" ,
11
- "gitart-vue-dialog" : " 0.0.15 " ,
11
+ "gitart-vue-dialog" : " 0.2.0-alpha.1 " ,
12
12
"vue" : " 3.2.0-beta.7"
13
13
},
14
14
"devDependencies" : {
Original file line number Diff line number Diff line change 7
7
<div
8
8
class =" container"
9
9
bg =" white"
10
- p =" y-8 x-6"
10
+ p =" t-8 b-4 x-6"
11
11
m =" x-auto"
12
12
border =" rounded"
13
13
>
14
- <div
15
- class =" flex items-end"
16
- m =" b-8"
17
- >
18
- <h1
19
- m =" r-4"
20
- >
21
- Vue Dialog
22
- </h1 >
23
-
24
- <a
25
- m =" r-2"
26
- href =" https://www.npmjs.com/package/gitart-vue-dialog"
27
- target =" _blank"
28
- >
29
- npm
30
- </a >
31
-
32
- <a href =" https://github.com/MichaelGitArt/gitart-vue-dialog" target =" _blank" >
33
- github
34
- </a >
14
+ <TheHeader m =" b-4" />
15
+
16
+ <div p =" y-3" >
17
+ <DialogLayout />
18
+ </div >
19
+
20
+ <div p =" y-3" >
21
+ <ProgrammaticalDialogLayout />
35
22
</div >
36
23
37
- <DialogLayout />
24
+ <TheFooter m = " t-4 " />
38
25
</div >
39
26
</div >
27
+ <GDialogRoot />
40
28
</template >
41
29
42
30
<script lang="ts">
43
31
import { defineComponent } from ' vue'
44
- import DialogLayout from ' ./components/Layout/DialogLayout.vue'
32
+ import { GDialogRoot } from ' plugin'
33
+
34
+ import TheHeader from ' @/components/Layout/TheHeader.vue'
35
+ import TheFooter from ' @/components/Layout/TheFooter.vue'
36
+
37
+ import DialogLayout from ' @/components/Layout/DialogLayout.vue'
38
+ import ProgrammaticalDialogLayout from ' @/components/Layout/ProgrammaticalDialogLayout.vue'
45
39
46
40
export default defineComponent ({
47
41
name: ' App' ,
48
42
components: {
43
+ GDialogRoot ,
44
+ TheHeader ,
45
+ TheFooter ,
49
46
DialogLayout ,
47
+ ProgrammaticalDialogLayout ,
50
48
},
51
49
})
52
50
</script >
Original file line number Diff line number Diff line change 18
18
<script lang="ts">
19
19
import { ref , defineComponent } from ' vue'
20
20
import { useVModel } from ' @vueuse/core'
21
-
22
21
import { GDialog } from ' plugin'
23
22
24
23
import BooleanSwitch from ' @/components/PropControls/BooleanSwitch/BooleanSwitch.vue'
25
24
25
+ export interface IBaseDialogProps {
26
+ modelValue: boolean
27
+ lorem: boolean
28
+ }
29
+
26
30
export default defineComponent ({
27
31
name: ' BaseDialog' ,
28
32
components: {
@@ -35,9 +39,14 @@ export default defineComponent({
35
39
type: Boolean ,
36
40
default: false ,
37
41
},
42
+
43
+ lorem: {
44
+ type: Boolean ,
45
+ required: true ,
46
+ },
38
47
},
39
48
40
- setup(props , { emit }) {
49
+ setup(props : IBaseDialogProps , { emit }) {
41
50
const depressed = ref (false )
42
51
const value = useVModel (props , ' modelValue' , emit )
43
52
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <GDialog
3
+ v-model =" value"
4
+ content-class =" profile-dialog-wrapper"
5
+ width =" 300"
6
+ height =" 300"
7
+ >
8
+ <div class =" profile-dialog" >
9
+ <img src =" /assets/img/profile.jpg" alt =" Profile" >
10
+ </div >
11
+ </GDialog >
12
+ </template >
13
+
14
+ <script lang="ts">
15
+ import { defineComponent } from ' vue'
16
+ import { useVModel } from ' @vueuse/core'
17
+ import { GDialog } from ' plugin'
18
+
19
+ export default defineComponent ({
20
+ name: ' ProfilePhotoDialog' ,
21
+ components: {
22
+ GDialog ,
23
+ },
24
+
25
+ props: {
26
+ modelValue: {
27
+ type: Boolean ,
28
+ default: false ,
29
+ },
30
+ },
31
+
32
+ setup(props , { emit }) {
33
+ const value = useVModel (props , ' modelValue' , emit )
34
+
35
+ return {
36
+ value ,
37
+ }
38
+ },
39
+ })
40
+ </script >
41
+
42
+ <style lang="scss" scoped>
43
+ ::v-global(.profile-dialog-wrapper ) { /* stylelint-disable-line selector-pseudo-element-no-unknown */
44
+ border-radius : 50% ;
45
+ }
46
+
47
+ .profile-dialog {
48
+ height : 100% ;
49
+ display : flex ;
50
+ justify-content : center ;
51
+ align-items : center ;
52
+ // padding: 10px;
53
+ background-color : #fff ;
54
+ // overflow: auto;
55
+
56
+ img {
57
+ max-height : 100% ;
58
+ max-width : 100% ;
59
+ width : 100% ;
60
+ object-fit : cover ;
61
+ }
62
+ }
63
+ </style >
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ import { GDialog } from 'plugin'
38
38
import DialogToolbar from ' @/components/Dialog/DialogToolbar.vue'
39
39
40
40
export default defineComponent ({
41
- name: ' BaseDialog ' ,
41
+ name: ' ScrollDialogCompoenent ' ,
42
42
components: {
43
43
GDialog ,
44
44
DialogToolbar ,
Original file line number Diff line number Diff line change 25
25
<script lang="ts">
26
26
import { defineComponent } from ' vue'
27
27
import { useVModel } from ' @vueuse/core'
28
-
29
28
import { GDialog } from ' plugin'
30
29
31
30
import DialogToolbar from ' @/components/Dialog/DialogToolbar.vue'
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" button-grid" >
3
+ <slot />
4
+ </div >
5
+ </template >
6
+
7
+ <script lang="ts">
8
+ export default {
9
+ name: ' ButtonGrid' ,
10
+ }
11
+ </script >
12
+
13
+ <style lang="scss" scoped>
14
+ .button-grid {
15
+ display : flex ;
16
+ flex-wrap : wrap ;
17
+ gap : 0.6em ;
18
+ }
19
+ </style >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div
3
- grid =" inline gap-3 auto-cols-auto flow-col"
4
- >
2
+ <ButtonGrid >
5
3
<DialogStateWrapper
6
4
v-slot =" {model, input}"
7
5
label =" Base"
8
6
>
9
- <BaseDialog :model-value =" model" @update:model-value =" input" />
7
+ <BaseDialog
8
+ :model-value =" model"
9
+ lorem
10
+ @update:model-value =" input"
11
+ />
10
12
</DialogStateWrapper >
11
13
12
14
<DialogStateWrapper
13
15
v-slot =" {model, input}"
14
16
label =" Styled"
15
17
>
16
- <StyledDialog :model-value =" model" @update:model-value =" input" />
18
+ <StyledDialog
19
+ :model-value =" model"
20
+ @update:model-value =" input"
21
+ />
17
22
</DialogStateWrapper >
18
23
19
24
<DialogStateWrapper
20
25
v-slot =" {model, input}"
21
26
label =" Scroll"
22
27
>
23
- <ScrollDialog :model-value =" model" @update:model-value =" input" />
28
+ <ScrollDialog
29
+ :model-value =" model"
30
+ @update:model-value =" input"
31
+ />
24
32
</DialogStateWrapper >
25
- </div >
33
+ </ButtonGrid >
26
34
</template >
27
35
28
36
<script lang="ts">
37
+ import { defineAsyncComponent , defineComponent } from ' vue'
38
+
29
39
import DialogStateWrapper from ' @/components/Dialog/DialogStateWrapper.vue'
30
- import BaseDialog from ' @/components/Dialogs/BaseDialog/BaseDialog.vue'
31
- import StyledDialog from ' @/components/Dialogs/StyledDialog/StyledDialog.vue'
32
- import ScrollDialog from ' @/components/Dialogs/ScrollDialog/ScrollDialog.vue'
40
+ import ButtonGrid from ' @/components/Layout/ButtonGrid.vue'
41
+
42
+ const BaseDialog = defineAsyncComponent (() => import (' @/components/Dialogs/BaseDialog/BaseDialog.vue' ))
43
+ const StyledDialog = defineAsyncComponent (() => import (' @/components/Dialogs/StyledDialog/StyledDialog.vue' ))
44
+ const ScrollDialog = defineAsyncComponent (() => import (' @/components/Dialogs/ScrollDialog/ScrollDialog.vue' ))
33
45
34
- export default {
46
+ export default defineComponent ( {
35
47
name: ' DialogLayout' ,
36
48
components: {
37
49
DialogStateWrapper ,
50
+ ButtonGrid ,
38
51
BaseDialog ,
39
52
StyledDialog ,
40
53
ScrollDialog ,
41
54
},
42
55
43
56
setup() {},
44
- }
57
+ })
45
58
</script >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <ButtonGrid >
3
+ <Btn @click =" onOpenProfilePhotoDialog" >
4
+ Profile Photo (Programmatical, Async)
5
+ </Btn >
6
+
7
+ <Btn @click =" onOpenScrollDialog" >
8
+ Scroll Dialog (Programmatical)
9
+ </Btn >
10
+ </ButtonGrid >
11
+ </template >
12
+
13
+ <script lang="ts">
14
+ import { defineAsyncComponent , defineComponent , inject } from ' vue'
15
+ import { DialogMethodsKey } from ' plugin'
16
+
17
+ import Btn from ' @/components/UI/Btn/Btn.vue'
18
+ import ScrollDialog from ' @/components/Dialogs/ScrollDialog/ScrollDialog.vue'
19
+
20
+ import ButtonGrid from ' @/components/Layout/ButtonGrid.vue'
21
+
22
+ const ProfilePhotoDialog = defineAsyncComponent (() => import (' @/components/Dialogs/ProfilePhotoDialog/ProfilePhotoDialog.vue' ))
23
+
24
+ export default defineComponent ({
25
+ name: ' ProgrammaticalDialogLayout' ,
26
+ components: {
27
+ Btn ,
28
+ ButtonGrid ,
29
+ },
30
+
31
+ setup() {
32
+ const $dialog = inject (DialogMethodsKey )
33
+
34
+ const onOpenProfilePhotoDialog = () => {
35
+ $dialog ?.add ({
36
+ component: ProfilePhotoDialog ,
37
+ })
38
+ }
39
+
40
+ const onOpenScrollDialog = () => {
41
+ $dialog ?.add ({
42
+ component: ScrollDialog ,
43
+ })
44
+ }
45
+
46
+ return {
47
+ onOpenProfilePhotoDialog ,
48
+ onOpenScrollDialog ,
49
+ }
50
+ },
51
+ })
52
+ </script >
You can’t perform that action at this time.
0 commit comments