16
16
:attach =" attach ? '#attach' : false"
17
17
:focus-retain =" focusRetain"
18
18
:focus-trap =" focusTrap"
19
+ :drag =" drag"
20
+ :fit-parent =" fitParent"
21
+ :keep-changed-style =" keepChangedStyle"
22
+ :resize =" resize"
23
+ :resize-directions =" resizeDirections"
24
+ :drag-selector =" allowDragSelector ? dragSelector : ''"
25
+ :min-width =" minWidth"
26
+ :max-width =" maxWidth"
27
+ :min-height =" minHeight"
28
+ :max-height =" maxHeight"
19
29
@confirm =" showModal = false"
20
30
@cancel =" showModal = false"
21
31
>
22
32
<template v-slot :title ># Hello, world!</template >
23
- <p >
24
- Lorem Ipsum is simply dummy text of the printing and typesetting industry.
25
- </p >
33
+ <p >Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p >
26
34
</v-modal >
27
35
28
- <button class =" vfm-btn" @click =" showModal = true" >Open Modal</button >
36
+ <div class =" flex space-x-2" >
37
+ <v-button highlight @click =" showModal = true" >Open Modal</v-button >
38
+ <v-button @click =" reset" >reset</v-button >
39
+ </div >
29
40
30
- <h3 >Prop Options :</h3 >
41
+ <h3 class = " py-2 " >Basic :</h3 >
31
42
32
- <div class =" grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 p-4 border rounded" >
43
+ <div class =" grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-y- 4 p-4 border rounded select-none " >
33
44
<label class =" flex items-center space-x-2" >
34
45
<span >value:</span >
35
46
<input v-model =" showModal" type =" checkbox" />
38
49
<span >ssr:</span >
39
50
<input v-model =" ssr" type =" checkbox" />
40
51
</label >
41
-
42
52
<label class =" flex items-center space-x-2" >
43
53
<span >lockScroll:</span >
44
54
<input v-model =" lockScroll" type =" checkbox" />
101
111
<span >focusTrap:</span >
102
112
<input v-model =" focusTrap" type =" checkbox" />
103
113
</label >
104
- <button class =" vfm-btn" @click =" reset" >reset</button >
105
114
</div >
106
- <h4 >Attach area:</h4 >
107
- <div id =" attach" class =" relative w-full h-64 mt-8 p-4 border rounded dark:bg-gray-700" >
108
- <button class =" vfm-btn" @click =" openAttach" >
109
- Attach to here and open modal
110
- </button >
115
+ <h3 class =" py-2" >Drag & Resize:</h3 >
116
+ <div class =" grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 p-4 border rounded select-none" >
117
+ <label class =" flex items-center space-x-2" >
118
+ <span >drag:</span >
119
+ <input v-model =" drag" type =" checkbox" />
120
+ </label >
121
+ <div class =" flex flex-col" >
122
+ <label class =" flex items-center space-x-2" >
123
+ <input v-model =" allowDragSelector" type =" checkbox" />
124
+ <span >dragSelector:</span >
125
+ </label >
126
+ <label >
127
+ <input
128
+ v-model =" dragSelector"
129
+ :disabled =" !allowDragSelector"
130
+ class =" pl-2 dark:text-black rounded focus:outline-none"
131
+ />
132
+ </label >
133
+ </div >
134
+ <label class =" flex items-center space-x-2" >
135
+ <span >fitParent:</span >
136
+ <input v-model =" fitParent" type =" checkbox" />
137
+ </label >
138
+ <label class =" flex items-center space-x-2" >
139
+ <span >keepChangedStyle:</span >
140
+ <input v-model =" keepChangedStyle" type =" checkbox" />
141
+ </label >
142
+ <label class =" flex items-center space-x-2" >
143
+ <span >resize:</span >
144
+ <input v-model =" resize" type =" checkbox" />
145
+ </label >
146
+ <div class =" flex flex-col" >
147
+ <span >resizeDirections:</span >
148
+ <div class =" flex space-x-1" >
149
+ <div v-for =" direction in ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']" :key =" direction" >
150
+ <label >
151
+ {{ direction }}:
152
+ <input type =" checkbox" v-model =" resizeDirections" :value =" direction" />
153
+ </label >
154
+ </div >
155
+ </div >
156
+ </div >
157
+ <label class =" flex items-center space-x-2" >
158
+ <span >minWidth:</span >
159
+ <input v-model.number =" minWidth" type =" number" class =" w-20 pl-2 dark:text-black rounded focus:outline-none" />
160
+ </label >
161
+ <label class =" flex items-center space-x-2" >
162
+ <span >maxWidth:</span >
163
+ <input v-model.number =" maxWidth" type =" number" class =" w-20 pl-2 dark:text-black rounded focus:outline-none" />
164
+ </label >
165
+ <label class =" flex items-center space-x-2" >
166
+ <span >minHeight:</span >
167
+ <input v-model.number =" minHeight" type =" number" class =" w-20 pl-2 dark:text-black rounded focus:outline-none" />
168
+ </label >
169
+ <label class =" flex items-center space-x-2" >
170
+ <span >maxHeight:</span >
171
+ <input v-model.number =" maxHeight" type =" number" class =" w-20 pl-2 dark:text-black rounded focus:outline-none" />
172
+ </label >
173
+ </div >
174
+ <h3 class =" py-2" >Attach:</h3 >
175
+ <div id =" attach" class =" relative w-full h-64 p-4 border rounded dark:bg-gray-900 overflow-hidden" >
176
+ <v-button highlight @click =" openAttach" >Attach to here and open modal</v-button >
111
177
<p >click will:</p >
112
178
<ul >
113
179
<li >set "attach" to "true"</li >
@@ -134,7 +200,18 @@ const initData = () => ({
134
200
zIndex: 0 ,
135
201
attach: false ,
136
202
focusRetain: true ,
137
- focusTrap: false
203
+ focusTrap: false ,
204
+ drag: false ,
205
+ fitParent: true ,
206
+ keepChangedStyle: false ,
207
+ resize: false ,
208
+ resizeDirections: [' t' , ' tr' , ' r' , ' br' , ' b' , ' bl' , ' l' , ' tl' ],
209
+ allowDragSelector: false ,
210
+ dragSelector: ' .modal__title' ,
211
+ minWidth: 0 ,
212
+ maxWidth: 2000 ,
213
+ minHeight: 0 ,
214
+ maxHeight: 2000
138
215
})
139
216
140
217
export default {
0 commit comments