Skip to content

Commit 8937318

Browse files
committed
afcl progress
1 parent 216caa7 commit 8937318

File tree

5 files changed

+90
-40
lines changed

5 files changed

+90
-40
lines changed

adminforth/documentation/docs/tutorial/03-Customization/14-afcl.md

Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ This allows to keep the design consistent with minimal efforts. ACL components w
99

1010

1111

12+
<div class="split-screen" >
13+
<div >
1214
```js
1315
import { Button } from '@/afcl'
1416
```
1517

16-
<div class="split-screen" >
17-
<div >
1818
```html
1919
<Button @click="doSmth"
2020
:loader="false" class="w-full">
@@ -38,12 +38,15 @@ loader prop would show loader when it's true.
3838

3939
## Link
4040

41+
42+
43+
<div class="split-screen" >
44+
<div >
45+
4146
```js
4247
import { Link } from '@/afcl'
4348
```
4449

45-
<div class="split-screen" >
46-
<div >
4750
```html
4851
<Link to="/login">Go to login</Link>
4952
```
@@ -57,12 +60,14 @@ import { Link } from '@/afcl'
5760

5861
Looks like button but works like link. Uses `router-link` under the hood.
5962

63+
64+
65+
<div class="split-screen" >
66+
<div >
6067
```js
6168
import { LinkButton } from '@/afcl'
6269
```
6370

64-
<div class="split-screen" >
65-
<div >
6671
```html
6772
<LinkButton to="/login">Go to login</LinkButton>
6873
```
@@ -207,12 +212,14 @@ You might need to put some extra item at bottom of list
207212

208213
## Input
209214

215+
216+
217+
<div class="split-screen" >
218+
<div >
210219
```js
211220
import { Input } from '@/afcl'
212221
```
213222

214-
<div class="split-screen" >
215-
<div >
216223
```html
217224
<Input type="number" class="w-full">
218225
<template #suffix>
@@ -231,12 +238,15 @@ import { Input } from '@/afcl'
231238

232239
Wrap an element on which you would like to show a tooltip with the `Tooltip` component and add a `tooltip` slot to it.
233240

241+
242+
243+
<div class="split-screen" >
244+
<div >
245+
234246
```js
235247
import { Tooltip } from '@/afcl'
236248
```
237249

238-
<div class="split-screen" >
239-
<div >
240250
```html
241251
<Tooltip>
242252
<a :href="`https://google.com?q=adminforth`" target="_blank" >
@@ -264,50 +274,59 @@ import { VerticalTabs } from '@/afcl'
264274
import { IconGridSolid, IconUserCircleSolid } from '@iconify-prerendered/vue-flowbite';
265275
```
266276

267-
```html
277+
<div class="split-screen" >
278+
<div>
279+
```html
268280
<VerticalTabs>
269281
<template #tab:Profile>
270282
<IconUserCircleSolid class="w-5 h-5 me-2"/>
271283
Profile
272284
</template>
273285
<template #tab:Dashboard>
274286
<IconGridSolid class="w-5 h-5 me-2"/>
275-
Dashboard
287+
Board
276288
</template>
277289
<template #Profile>
278290
<h3 class="text-lg font-bold text-gray-900 dark:text-white mb-2">Profile Tab</h3>
279-
<p class="mb-2">This is some placeholder content the Profile tab's associated content, clicking another tab will toggle the visibility of this one for the next.</p>
291+
<p class="mb-2">This is some placeholder content the Profile tab's associated content</p>
280292
</template>
281293
<template #Dashboard>
282294
Dashboard Tab Content
283295
</template>
284296
</VerticalTabs>
285-
```
297+
```
298+
</div>
299+
<div>
300+
![AFCL VerticalTabs](image-48.png)
301+
</div>
302+
</div>
303+
304+
286305

287306
## Checkbox
288307

289-
```html
290-
<Checkbox v-model="enable">
291-
Enable
292-
</Checkbox>
293-
```
308+
<div class="split-screen" >
309+
<div >
294310

295311
```ts
296312
import { Checkbox } from '@/afcl'
297313
const enable = ref(false)
298314
```
299315

300-
## Dropzone
301316

302317
```html
303-
<Dropzone
304-
:extensions="['.jpg', '.jpeg', '.png']"
305-
:maxSizeBytes="1024 * 1024 * 2"
306-
:multiple="false"
307-
v-model="files"
308-
/>
309-
318+
<Checkbox v-model="enable">
319+
Enable
320+
</Checkbox>
310321
```
322+
</div>
323+
<div>
324+
![AFCL Checkbox](image-49.png)
325+
</div>
326+
</div>
327+
328+
329+
## Dropzone
311330

312331
```ts
313332
import { Ref } from 'vue'
@@ -324,6 +343,26 @@ watch(files, (files) => {
324343
})
325344
```
326345

346+
<div class="split-screen" >
347+
<div >
348+
349+
350+
351+
```html
352+
<Dropzone
353+
:extensions="['.jpg', '.jpeg', '.png']"
354+
:maxSizeBytes="1024 * 1024 * 2"
355+
:multiple="false"
356+
v-model="files"
357+
/>
358+
359+
```
360+
</div>
361+
<div>
362+
![AFCL Dropzone](image-50.png)
363+
</div>
364+
</div>
365+
327366

328367
## Bar Chart
329368

35.6 KB
Loading
7.98 KB
Loading
27.5 KB
Loading

dev-demo/custom/Dash.vue

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,31 +162,40 @@
162162

163163
<div class="flex justify-center items-center p-80 bg-white">
164164
<div class="border border-indigo-600 p-5 w-80 h-80 min-w-80 min-h-80 flex justify-center items-center">
165-
<Tooltip>
166-
<a :href="`https://google.com?q=adminforth`" target="_blank" >
167-
<IconCardSearch class="w-5 h-5 me-2"/>
168-
</a>
169-
170-
<template #tooltip>
171-
Search for AdminForth
172-
</template>
173-
</Tooltip>
174-
165+
<Dropzone
166+
:extensions="['.jpg', '.jpeg', '.png']"
167+
:maxSizeBytes="1024 * 1024 * 2"
168+
:multiple="false"
169+
v-model="files"
170+
/>
175171
</div>
176172
</div>
177173
</div>
178174
</template>
179175

180176
<script setup lang="ts">
181-
import { ref, type Ref, onMounted, computed } from 'vue';
177+
import { ref, type Ref, onMounted, computed, watch } from 'vue';
182178
import dayjs from 'dayjs';
183179
import { callApi } from '@/utils';
184180
import { useI18n } from 'vue-i18n';
185181
import adminforth from '@/adminforth';
186-
import { AreaChart, BarChart, Input, Link, LinkButton, PieChart, Select } from '@/afcl';
182+
import { AreaChart, BarChart, Input, Link, LinkButton, PieChart, Select, VerticalTabs } from '@/afcl';
187183
import Button from '@/afcl/Button.vue';
188184
import Tooltip from '@/afcl/Tooltip.vue';
189-
import { IconCardSearch } from '@iconify-prerendered/vue-mdi';
185+
import { IconUserCircleSolid, IconGridSolid } from '@iconify-prerendered/vue-flowbite';
186+
import Checkbox from '@/afcl/Checkbox.vue';
187+
188+
import { Dropzone } from '@/afcl'
189+
190+
const files: Ref<File[]> = ref([])
191+
192+
watch(files, (files) => {
193+
console.log('files selected', files);
194+
setTimeout(() => {
195+
// clear
196+
files.length = 0;
197+
}, 5000);
198+
})
190199
191200
const data: Ref<{listedVsUnlistedPriceByDays: any, listedVsUnlistedByDays: any,
192201
apartsByDays: any, apartsCountsByRooms: any, topCountries: any, totalAparts: any} | null> = ref(null);
@@ -195,6 +204,8 @@ const { t } = useI18n();
195204
196205
const COLORS = ["#4E79A7", "#F28E2B", "#E15759", "#76B7B2", "#59A14F"]
197206
207+
const enable = ref(false);
208+
198209
const apartsCountsByDaysChart = computed(() => {
199210
return data.value.apartsByDays?.reverse().map(
200211
(item) => ({

0 commit comments

Comments
 (0)