DemoFormLayoutCollapsible.vue
9.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<script lang="ts" setup>
const stateList = [
'Alabama',
'Alaska',
'Arizona',
'Arkansas',
'California',
'Colorado',
'Connecticut',
'Delaware',
'Florida',
'Georgia',
'Hawaii',
]
const radios = ref('home')
const deliveryOption = ref('standard')
const paymentMethod = ref('credit-debit-card')
const panel = ref(0)
const paymentMethods = [
{
radioValue: 'credit-debit-card',
radioLabel: 'Credit/Debit/ATM Card',
icon: 'ri-bank-card-line',
},
{
radioValue: 'cash-on-delivery',
radioLabel: 'Cash On Delivery',
icon: 'ri-question-line',
},
]
</script>
<template>
<VExpansionPanels v-model="panel">
<!-- SECTION Delivery Address -->
<VExpansionPanel>
<VExpansionPanelTitle>Delivery Address</VExpansionPanelTitle>
<VExpansionPanelText>
<VForm
class="pt-4 pb-2"
@submit.prevent="() => {}"
>
<VRow>
<!-- 👉 Full Name -->
<VCol
cols="12"
md="6"
>
<VTextField
label="Full Name"
placeholder="John Doe"
/>
</VCol>
<!-- 👉 Phone No -->
<VCol
cols="12"
md="6"
>
<VTextField
label="Phone No"
type="number"
placeholder="+1 123 456 7890"
/>
</VCol>
<!-- 👉 Address -->
<VCol cols="12">
<VTextarea
label="Address"
placeholder="1234 Main St, New York, NY 10001, USA"
rows="3"
/>
</VCol>
<!-- 👉 Pincode -->
<VCol
cols="12"
md="6"
>
<VTextField
label="Pincode"
placeholder="123456"
type="number"
/>
</VCol>
<!-- 👉 Landmark -->
<VCol
cols="12"
md="6"
>
<VTextField
label="Landmark"
placeholder="Near City Mall"
/>
</VCol>
<!-- 👉 City -->
<VCol
cols="12"
md="6"
>
<VTextField
label="City"
placeholder="New York"
/>
</VCol>
<!-- 👉 State -->
<VCol
cols="12"
md="6"
>
<VSelect
:items="stateList"
label="State"
placeholder="Select State"
/>
</VCol>
<!-- 👉 Address Type -->
<VCol cols="12">
<VLabel class="mb-3">
Address Type
</VLabel>
<VRadioGroup
v-model="radios"
inline
>
<div>
<VRadio
label="Home (All day delivery)"
value="home"
/>
<VRadio
label="Office (Delivery between 10 AM - 5 PM)"
value="office"
/>
</div>
</VRadioGroup>
</VCol>
</VRow>
</VForm>
</VExpansionPanelText>
</VExpansionPanel>
<!-- !SECTION Delivery Address -->
<!-- SECTION Delivery Options -->
<VExpansionPanel>
<VExpansionPanelTitle>Delivery Options</VExpansionPanelTitle>
<VExpansionPanelText>
<!-- 👉 Radio Group -->
<VRadioGroup
v-model="deliveryOption"
class="delivery-options pt-4 pb-2"
>
<div
class="delivery-option d-flex rounded-t"
:class="deliveryOption === 'standard' ? 'active' : ''"
@click="deliveryOption = 'standard'"
>
<VRadio
inline
value="standard"
class="mt-n4"
/>
<div class="w-100">
<div class="d-flex justify-space-between">
<h6 class="text-base font-weight-medium">
Standard 3-5 Days
</h6>
<h6 class="text-base font-weight-medium">
Free
</h6>
</div>
<span class="text-sm">Friday, 15 Nov - Monday, 18 Nov</span>
</div>
</div>
<div
class="delivery-option d-flex"
:class="deliveryOption === 'express' ? 'active' : ''"
@click="deliveryOption = 'express'"
>
<VRadio
inline
class="mt-n4"
value="express"
/>
<div class="w-100">
<div class="d-flex justify-space-between">
<h5 class="text-base font-weight-medium">
Express
</h5>
<h6 class="text-base font-weight-medium">
$5.00
</h6>
</div>
<span class="text-sm">Friday, 15 Nov - Sunday, 17 Nov</span>
</div>
</div>
<div
class="delivery-option d-flex rounded-b"
:class="deliveryOption === 'overnight' ? 'active' : ''"
@click="deliveryOption = 'overnight'"
>
<VRadio
inline
class="mt-n4"
value="overnight"
/>
<div class="w-100">
<div class="d-flex justify-space-between">
<h6 class="text-base font-weight-medium">
Overnight
</h6>
<h6 class="text-base font-weight-medium">
$10.00
</h6>
</div>
<span class="text-sm">Friday, 15 Nov - Saturday, 16 Nov</span>
</div>
</div>
</VRadioGroup>
</VExpansionPanelText>
</VExpansionPanel>
<!-- !SECTION Delivery Options -->
<!-- SECTION Payment Method -->
<VExpansionPanel>
<VExpansionPanelTitle>Payment Method</VExpansionPanelTitle>
<VExpansionPanelText>
<VRow>
<VCol
md="6"
cols="12"
>
<VForm class="pt-4 pb-2">
<!-- 👉 Payment Method -->
<VRow>
<VCol cols="12">
<div>
<VRadioGroup
v-model="paymentMethod"
inline
>
<div>
<VRadio
v-for="payment in paymentMethods"
:key="payment.radioValue"
:value="payment.radioValue"
>
<template #label>
<span class="me-1">{{ payment.radioLabel }}</span>
<VIcon
size="18"
:icon="payment.icon"
/>
</template>
</VRadio>
</div>
</VRadioGroup>
</div>
</VCol>
</VRow>
<VRow v-show="paymentMethod === 'credit-debit-card'">
<!-- 👉 Card Number -->
<VCol cols="12">
<VTextField
label="Card Number"
type="number"
placeholder="1234 5678 9012 3456"
/>
</VCol>
<!-- 👉 Name -->
<VCol
cols="12"
md="6"
>
<VTextField
label="Name"
placeholder="john doe"
/>
</VCol>
<!-- 👉 Expire Date -->
<VCol
cols="6"
md="3"
>
<VTextField
label="Expiry Date"
placeholder="MM/YY"
/>
</VCol>
<!-- 👉 CVV Code -->
<VCol
cols="6"
md="3"
>
<VTextField
label="CVV Code"
type="number"
max="3"
placeholder="123"
/>
</VCol>
<VCol>
<div class="d-flex gap-4">
<VBtn>Place Order</VBtn>
<VBtn
color="secondary"
variant="tonal"
>
Cancel
</VBtn>
</div>
</VCol>
</VRow>
<VRow v-show="paymentMethod === 'cash-on-delivery'">
<VCol cols="12">
<p class="text-base text-high-emphasis">
Cash on Delivery is a type of payment method where the recipient make payment for the order at the time of delivery rather than in advance.
</p>
<VBtn>
Pay on delivery
</VBtn>
</VCol>
</VRow>
</VForm>
</VCol>
</VRow>
</VExpansionPanelText>
</VExpansionPanel>
<!-- !SECTION Payment Method -->
</VExpansionPanels>
</template>
<style lang="scss">
.delivery-options {
cursor: pointer;
.v-selection-control-group {
inline-size: 100%;
}
}
.delivery-option {
padding: 1rem;
border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
&.active {
border-color: rgb(var(--v-theme-primary));
}
}
</style>