@awes-io/ui 2.142.3 → 2.143.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/assets/css/components/_index.css +7 -1
- package/assets/css/components/animation.css +38 -32
- package/assets/css/components/content-placeholder.css +103 -0
- package/assets/css/components/empty-container.css +69 -1
- package/assets/css/components/filter-chosen.css +6 -0
- package/assets/css/components/filter-date-range.css +17 -1
- package/assets/css/components/filter-month.css +23 -17
- package/assets/css/components/filter-select.css +11 -0
- package/assets/css/components/layout.css +1 -32
- package/assets/css/components/modal.css +1 -1
- package/assets/css/components/number.css +12 -0
- package/assets/css/components/page-aside.css +54 -0
- package/assets/js/css.js +1 -1
- package/assets/js/icons/mono.js +59 -91
- package/assets/js/icons/multicolor.js +1 -31
- package/components/1_atoms/AwContentPlaceholder.vue +60 -0
- package/components/1_atoms/AwFlow.vue +21 -48
- package/components/1_atoms/AwLabel.vue +1 -1
- package/components/2_molecules/AwButton.vue +1 -1
- package/components/2_molecules/AwEmptyContainer.vue +74 -72
- package/components/2_molecules/AwNumber.vue +180 -0
- package/components/2_molecules/AwSelect.vue +11 -4
- package/components/3_organisms/AwFilterChosen.vue +73 -0
- package/components/3_organisms/AwFilterDateRange.vue +177 -0
- package/components/3_organisms/AwFilterMonth.vue +37 -40
- package/components/3_organisms/AwFilterSelect.vue +368 -0
- package/components/3_organisms/AwMultiBlockBuilder.vue +1 -1
- package/components/3_organisms/AwTable/AwTableBuilder.vue +12 -60
- package/components/4_pages/AwPageAside.vue +108 -0
- package/components/5_layouts/AwLayoutCenter.vue +3 -8
- package/components/5_layouts/_AwUserMenu.vue +1 -1
- package/dist/css/aw-icons.css +26 -0
- package/dist/fonts/aw-icons.svg +18 -0
- package/dist/fonts/aw-icons.ttf +0 -0
- package/dist/fonts/aw-icons.woff +0 -0
- package/dist/fonts/aw-icons.woff2 +0 -0
- package/docs/_template.md +80 -0
- package/docs/components/atoms/aw-accordion-fold.md +91 -0
- package/docs/components/atoms/aw-action-card-body.md +67 -0
- package/docs/components/atoms/aw-action-card.md +94 -0
- package/docs/components/atoms/aw-action-icon.md +88 -0
- package/docs/components/atoms/aw-avatar.md +106 -0
- package/docs/components/atoms/aw-card.md +112 -0
- package/docs/components/atoms/aw-checkbox.md +112 -0
- package/docs/components/atoms/aw-content-placeholder.md +116 -0
- package/docs/components/atoms/aw-description.md +83 -0
- package/docs/components/atoms/aw-dock.md +84 -0
- package/docs/components/atoms/aw-dropdown-button.md +94 -0
- package/docs/components/atoms/aw-dropdown.md +128 -0
- package/docs/components/atoms/aw-file.md +73 -0
- package/docs/components/atoms/aw-flow.md +92 -0
- package/docs/components/atoms/aw-grid.md +91 -0
- package/docs/components/atoms/aw-headline.md +71 -0
- package/docs/components/atoms/aw-icon-system-color.md +121 -0
- package/docs/components/atoms/aw-icon-system-mono.md +205 -0
- package/docs/components/atoms/aw-icon.md +235 -0
- package/docs/components/atoms/aw-info.md +85 -0
- package/docs/components/atoms/aw-input.md +120 -0
- package/docs/components/atoms/aw-label.md +83 -0
- package/docs/components/atoms/aw-link.md +99 -0
- package/docs/components/atoms/aw-list.md +88 -0
- package/docs/components/atoms/aw-progress.md +70 -0
- package/docs/components/atoms/aw-radio.md +109 -0
- package/docs/components/atoms/aw-refresh-wrapper.md +81 -0
- package/docs/components/atoms/aw-select-native.md +106 -0
- package/docs/components/atoms/aw-slider.md +82 -0
- package/docs/components/atoms/aw-sub-headline.md +73 -0
- package/docs/components/atoms/aw-switcher.md +115 -0
- package/docs/components/atoms/aw-tag.md +80 -0
- package/docs/components/atoms/aw-title.md +70 -0
- package/docs/components/atoms/aw-toggler.md +69 -0
- package/docs/components/layouts/aw-layout-center.md +168 -0
- package/docs/components/layouts/aw-layout-error.md +153 -0
- package/docs/components/layouts/aw-layout-provider.md +238 -0
- package/docs/components/layouts/aw-layout.md +88 -0
- package/docs/components/molecules/aw-action-button.md +91 -0
- package/docs/components/molecules/aw-alert.md +96 -0
- package/docs/components/molecules/aw-badge.md +108 -0
- package/docs/components/molecules/aw-banner-text.md +90 -0
- package/docs/components/molecules/aw-button-nav.md +46 -0
- package/docs/components/molecules/aw-button.md +123 -0
- package/docs/components/molecules/aw-description-input.md +67 -0
- package/docs/components/molecules/aw-empty-container.md +86 -0
- package/docs/components/molecules/aw-island.md +234 -0
- package/docs/components/molecules/aw-number.md +138 -0
- package/docs/components/molecules/aw-select-object.md +401 -0
- package/docs/components/molecules/aw-select.md +215 -0
- package/docs/components/molecules/aw-tab-nav.md +108 -0
- package/docs/components/molecules/aw-tel.md +129 -0
- package/docs/components/molecules/aw-textarea.md +83 -0
- package/docs/components/molecules/aw-userpic.md +115 -0
- package/docs/components/organisms/aw-address-block.md +64 -0
- package/docs/components/organisms/aw-address.md +132 -0
- package/docs/components/organisms/aw-birthday-picker.md +73 -0
- package/docs/components/organisms/aw-bottom-bar.md +66 -0
- package/docs/components/organisms/aw-calendar-days.md +115 -0
- package/docs/components/organisms/aw-calendar-nav.md +98 -0
- package/docs/components/organisms/aw-calendar-view.md +98 -0
- package/docs/components/organisms/aw-calendar.md +166 -0
- package/docs/components/organisms/aw-chart.md +154 -0
- package/docs/components/organisms/aw-chip-select.md +164 -0
- package/docs/components/organisms/aw-chip.md +126 -0
- package/docs/components/organisms/aw-code-snippet.md +94 -0
- package/docs/components/organisms/aw-code.md +132 -0
- package/docs/components/organisms/aw-context-menu.md +117 -0
- package/docs/components/organisms/aw-cropper.md +151 -0
- package/docs/components/organisms/aw-date.md +161 -0
- package/docs/components/organisms/aw-display-date.md +33 -0
- package/docs/components/organisms/aw-download-link.md +46 -0
- package/docs/components/organisms/aw-fetch-data.md +161 -0
- package/docs/components/organisms/aw-filter-chosen.md +226 -0
- package/docs/components/organisms/aw-filter-date-range.md +205 -0
- package/docs/components/organisms/aw-filter-month.md +43 -0
- package/docs/components/organisms/aw-filter-select.md +225 -0
- package/docs/components/organisms/aw-form.md +174 -0
- package/docs/components/organisms/aw-gmap-marker.md +86 -0
- package/docs/components/organisms/aw-gmap.md +90 -0
- package/docs/components/organisms/aw-image-upload.md +56 -0
- package/docs/components/organisms/aw-island-avatar.md +87 -0
- package/docs/components/organisms/aw-markdown-editor.md +104 -0
- package/docs/components/organisms/aw-modal-buttons.md +57 -0
- package/docs/components/organisms/aw-modal.md +246 -0
- package/docs/components/organisms/aw-model-edit.md +74 -0
- package/docs/components/organisms/aw-money.md +53 -0
- package/docs/components/organisms/aw-multi-block-builder.md +165 -0
- package/docs/components/organisms/aw-pagination.md +121 -0
- package/docs/components/organisms/aw-password.md +103 -0
- package/docs/components/organisms/aw-preview-card.md +45 -0
- package/docs/components/organisms/aw-search.md +116 -0
- package/docs/components/organisms/aw-subnav.md +122 -0
- package/docs/components/organisms/aw-table-builder.md +165 -0
- package/docs/components/organisms/aw-table-col.md +123 -0
- package/docs/components/organisms/aw-table-head.md +92 -0
- package/docs/components/organisms/aw-table-row.md +91 -0
- package/docs/components/organisms/aw-table.md +172 -0
- package/docs/components/organisms/aw-tags.md +54 -0
- package/docs/components/organisms/aw-toggle-show-aside.md +43 -0
- package/docs/components/organisms/aw-uploader-files.md +125 -0
- package/docs/components/organisms/aw-uploader.md +163 -0
- package/docs/components/organisms/aw-user-menu.md +87 -0
- package/docs/components/pages/aw-page-aside.md +296 -0
- package/docs/components/pages/aw-page-menu-buttons.md +172 -0
- package/docs/components/pages/aw-page-modal.md +198 -0
- package/docs/components/pages/aw-page-single.md +253 -0
- package/docs/components/pages/aw-page.md +194 -0
- package/docs/configuration.md +493 -0
- package/docs/cookbook/advanced-patterns.md +1388 -0
- package/docs/cookbook/common-patterns.md +965 -0
- package/docs/cookbook/index.md +786 -0
- package/docs/getting-started.md +596 -0
- package/docs/guides/best-practices.md +1106 -0
- package/docs/guides/data-fetching.md +852 -0
- package/docs/guides/error-handling.md +1172 -0
- package/docs/guides/forms-guide.md +1329 -0
- package/docs/guides/mobile-subnavigation.md +359 -0
- package/docs/guides/page-patterns/aside-pages.md +1418 -0
- package/docs/guides/page-patterns/dashboard-pages.md +990 -0
- package/docs/guides/page-patterns/detail-pages.md +1493 -0
- package/docs/guides/page-patterns/list-pages.md +1094 -0
- package/docs/index.md +263 -1
- package/docs/integrations.md +870 -0
- package/docs/reference/menu.md +462 -0
- package/docs/reference/plugins.md +970 -0
- package/docs/reference/troubleshooting.md +945 -0
- package/nuxt/awes.config.js +9 -8
- package/nuxt/icons.css +26 -0
- package/nuxt/index.js +2 -2
- package/nuxt/pages/more.vue +1 -1
- package/package.json +5 -3
- package/readme.md +171 -1
- package/docs/aw-accordion-fold.md +0 -46
- package/docs/aw-address.md +0 -44
- package/docs/aw-avatar.md +0 -51
- package/docs/aw-badge.md +0 -32
- package/docs/aw-button-nav.md +0 -44
- package/docs/aw-button.md +0 -50
- package/docs/aw-calendar-days.md +0 -46
- package/docs/aw-calendar-nav.md +0 -25
- package/docs/aw-calendar-view.md +0 -12
- package/docs/aw-calendar.md +0 -59
- package/docs/aw-card.md +0 -48
- package/docs/aw-chart.md +0 -51
- package/docs/aw-checkbox.md +0 -56
- package/docs/aw-chip-select.md +0 -46
- package/docs/aw-chip.md +0 -53
- package/docs/aw-code-snippet.md +0 -18
- package/docs/aw-code.md +0 -56
- package/docs/aw-content-wrapper.md +0 -40
- package/docs/aw-context-menu.md +0 -31
- package/docs/aw-cropper.md +0 -60
- package/docs/aw-dashboard-card.md +0 -37
- package/docs/aw-dashboard-donut.md +0 -30
- package/docs/aw-dashboard-line.md +0 -20
- package/docs/aw-dashboard-progress.md +0 -33
- package/docs/aw-dashboard-section.md +0 -32
- package/docs/aw-dashboard-speed.md +0 -30
- package/docs/aw-date.md +0 -52
- package/docs/aw-dropdown-button.md +0 -31
- package/docs/aw-dropdown.md +0 -69
- package/docs/aw-fetch-data.md +0 -45
- package/docs/aw-form.md +0 -52
- package/docs/aw-grid.md +0 -48
- package/docs/aw-icon.md +0 -50
- package/docs/aw-info.md +0 -53
- package/docs/aw-input.md +0 -55
- package/docs/aw-layout-default.md +0 -30
- package/docs/aw-layout-frame-center.md +0 -29
- package/docs/aw-layout-simple.md +0 -49
- package/docs/aw-link.md +0 -54
- package/docs/aw-markdown-editor.md +0 -51
- package/docs/aw-modal.md +0 -63
- package/docs/aw-multi-block-builder.md +0 -66
- package/docs/aw-page.md +0 -36
- package/docs/aw-pagination.md +0 -54
- package/docs/aw-password.md +0 -48
- package/docs/aw-radio.md +0 -54
- package/docs/aw-search.md +0 -49
- package/docs/aw-select.md +0 -93
- package/docs/aw-slider.md +0 -40
- package/docs/aw-svg-image.md +0 -19
- package/docs/aw-switcher.md +0 -51
- package/docs/aw-tab-nav.md +0 -55
- package/docs/aw-table-builder.md +0 -58
- package/docs/aw-table-col.md +0 -33
- package/docs/aw-table-head.md +0 -28
- package/docs/aw-table-row.md +0 -33
- package/docs/aw-table.md +0 -59
- package/docs/aw-tel.md +0 -47
- package/docs/aw-textarea.md +0 -47
- package/docs/aw-toggler.md +0 -41
- package/docs/aw-uploader-files.md +0 -20
- package/docs/aw-uploader.md +0 -60
- package/docs/aw-user-menu.md +0 -34
- package/docs/aw-userpic.md +0 -34
- /package/components/{3_organisms → 2_molecules}/AwTel.vue +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Uploader component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwUploader /> component is used to render Uploader - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Uploader
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwUploader
|
|
10
|
+
|
|
11
|
+
**Category:** Organism | **Import:** Dynamic
|
|
12
|
+
|
|
13
|
+
The `AwUploader` component is a file upload component with drag-and-drop support, progress tracking, and file validation. It handles file uploads via FormData and provides upload lifecycle events.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwUploader` provides a file upload solution with:
|
|
18
|
+
- Drag and drop file upload
|
|
19
|
+
- Click to select files
|
|
20
|
+
- File format validation
|
|
21
|
+
- File size validation
|
|
22
|
+
- Upload progress tracking
|
|
23
|
+
- Multiple file support
|
|
24
|
+
- Cancel upload functionality
|
|
25
|
+
- Error handling
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Basic Example
|
|
30
|
+
|
|
31
|
+
```markup
|
|
32
|
+
<AwUploader
|
|
33
|
+
url="/api/upload"
|
|
34
|
+
@start="handleStart"
|
|
35
|
+
@finish="handleFinish"
|
|
36
|
+
@error="handleError"
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Single File
|
|
41
|
+
|
|
42
|
+
```markup
|
|
43
|
+
<AwUploader
|
|
44
|
+
url="/api/upload"
|
|
45
|
+
:max="5"
|
|
46
|
+
format="['image/jpeg', 'image/png']"
|
|
47
|
+
/>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Multiple Files
|
|
51
|
+
|
|
52
|
+
```markup
|
|
53
|
+
<AwUploader
|
|
54
|
+
url="/api/upload"
|
|
55
|
+
multiple
|
|
56
|
+
:max="10"
|
|
57
|
+
format="['image/*']"
|
|
58
|
+
/>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Custom Format
|
|
62
|
+
|
|
63
|
+
```markup
|
|
64
|
+
<AwUploader
|
|
65
|
+
url="/api/upload"
|
|
66
|
+
:format="['.pdf', '.doc', '.docx']"
|
|
67
|
+
:max="20"
|
|
68
|
+
/>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Custom Label
|
|
72
|
+
|
|
73
|
+
```markup
|
|
74
|
+
<AwUploader url="/api/upload">
|
|
75
|
+
<template #label="{ isDragging }">
|
|
76
|
+
<div :class="{ 'opacity-50': isDragging }">
|
|
77
|
+
Custom upload area
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
</AwUploader>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Hide Progress
|
|
84
|
+
|
|
85
|
+
```markup
|
|
86
|
+
<AwUploader
|
|
87
|
+
url="/api/upload"
|
|
88
|
+
hide-progress
|
|
89
|
+
/>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## API
|
|
93
|
+
|
|
94
|
+
### Props
|
|
95
|
+
|
|
96
|
+
| Name | Description | Type | Required | Default |
|
|
97
|
+
|------|-------------|------|----------|---------|
|
|
98
|
+
| url | API endpoint URL for file upload | `String` | `true` | - |
|
|
99
|
+
| name | Form field name for file input | `String` | `false` | `'file'` |
|
|
100
|
+
| format | Allowed file formats (MIME types or extensions) | `Array` | `false` | `[]` |
|
|
101
|
+
| max | Maximum file size in MB | `Number` | `false` | `2` |
|
|
102
|
+
| multiple | Allow multiple file selection | `Boolean` | `false` | `false` |
|
|
103
|
+
| hideProgress | Hide progress bar | `Boolean` | `false` | `false` |
|
|
104
|
+
|
|
105
|
+
**Format Examples:**
|
|
106
|
+
```javascript
|
|
107
|
+
['image/jpeg', 'image/png'] // MIME types
|
|
108
|
+
['.pdf', '.doc', '.docx'] // File extensions
|
|
109
|
+
['image/*'] // Wildcard MIME types
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Slots
|
|
113
|
+
|
|
114
|
+
| Name | Description | Props | Default Slot Content |
|
|
115
|
+
|------|-------------|-------|---------------------|
|
|
116
|
+
| label | Custom upload area content | `{ isDragging }` | Default icon and text |
|
|
117
|
+
| drag-over | Content shown when dragging over | `{ isDragging }` | Default file icon |
|
|
118
|
+
|
|
119
|
+
### Events
|
|
120
|
+
|
|
121
|
+
| Name | Payload | Description |
|
|
122
|
+
|------|---------|-------------|
|
|
123
|
+
| start | `{ id, file, loading, progress, cancel }` | Emitted when upload starts |
|
|
124
|
+
| progress | `{ id, file, loading, progress, cancel }` | Emitted during upload progress |
|
|
125
|
+
| finish | `{ id, response }` | Emitted when upload completes successfully |
|
|
126
|
+
| error | `{ id, response }` | Emitted when upload fails |
|
|
127
|
+
|
|
128
|
+
**Event Payload:**
|
|
129
|
+
```javascript
|
|
130
|
+
{
|
|
131
|
+
id: 1, // Unique file ID
|
|
132
|
+
file: File, // File object
|
|
133
|
+
loading: true, // Upload in progress
|
|
134
|
+
progress: 50, // Upload progress (0-100)
|
|
135
|
+
cancel: Function, // Cancel upload function
|
|
136
|
+
response: Object // Axios response (finish/error)
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Mixins
|
|
141
|
+
|
|
142
|
+
- `errorMixin` - Provides error handling functionality
|
|
143
|
+
|
|
144
|
+
## Related Components
|
|
145
|
+
|
|
146
|
+
- `AwUploaderFiles` - Component for displaying uploaded files list
|
|
147
|
+
- `AwButton` - Button component (used in examples)
|
|
148
|
+
- `AwProgress` - Progress component (used internally)
|
|
149
|
+
|
|
150
|
+
## Notes
|
|
151
|
+
|
|
152
|
+
- **Import Method:** Dynamic - Component is loaded on-demand as an organism
|
|
153
|
+
- Files are uploaded using FormData via Axios
|
|
154
|
+
- Drag and drop works across the entire document (global listeners)
|
|
155
|
+
- File validation happens before upload starts
|
|
156
|
+
- Upload can be cancelled using `cancel()` function from event payload
|
|
157
|
+
- Progress is tracked per file (for multiple uploads)
|
|
158
|
+
- Component uses Axios cancel tokens for cancellation
|
|
159
|
+
- Error messages are displayed via tooltip
|
|
160
|
+
- Format validation uses file MIME type or extension
|
|
161
|
+
- Size validation compares file size to `max` prop (in MB)
|
|
162
|
+
- Component registers global drag listeners (one per page)
|
|
163
|
+
- Dropzone overlay appears when dragging files over component
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: UserMenu component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwUserMenu /> component is used to render UserMenu - UI Vue component for AwesCode UI.
|
|
6
|
+
title: UserMenu
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwUserMenu
|
|
10
|
+
|
|
11
|
+
**Category:** Layout (Internal) | **Import:** Dynamic
|
|
12
|
+
|
|
13
|
+
The `AwUserMenu` component is an internal layout component that displays the user menu dropdown in the header. It shows user avatar, profile link, theme toggle, and menu items.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwUserMenu` provides a user menu solution with:
|
|
18
|
+
- User avatar display
|
|
19
|
+
- Profile link
|
|
20
|
+
- Theme toggle (dark/light)
|
|
21
|
+
- Menu items
|
|
22
|
+
- Dropdown menu
|
|
23
|
+
- Desktop/mobile interactions
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
This component is typically used internally by layout components. Direct usage is not recommended unless building custom layouts.
|
|
28
|
+
|
|
29
|
+
### Internal Usage
|
|
30
|
+
|
|
31
|
+
```markup
|
|
32
|
+
<AwUserMenu
|
|
33
|
+
:avatar="userAvatar"
|
|
34
|
+
:name="userName"
|
|
35
|
+
:info="userInfo"
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## API
|
|
40
|
+
|
|
41
|
+
### Props
|
|
42
|
+
|
|
43
|
+
| Name | Description | Type | Required | Default |
|
|
44
|
+
|------|-------------|------|----------|---------|
|
|
45
|
+
| avatar | Path to user avatar image | `String` | `false` | `''` |
|
|
46
|
+
| name | User name | `String` | `false` | `''` |
|
|
47
|
+
| info | Additional info under user name | `String` | `false` | `''` |
|
|
48
|
+
| darkTheme | Is dark mode enabled (for internal use) | `Boolean` | `false` | `false` |
|
|
49
|
+
| outline | Use outline avatar style | `Boolean` | `false` | `false` |
|
|
50
|
+
| caret | Show dropdown caret icon | `Boolean` | `false` | `true` |
|
|
51
|
+
| vertical | Vertical menu layout | `Boolean` | `false` | `false` |
|
|
52
|
+
| showUser | Show user menu button | `Boolean` | `false` | `true` |
|
|
53
|
+
|
|
54
|
+
### Slots
|
|
55
|
+
|
|
56
|
+
| Name | Description | Props | Default Slot Content |
|
|
57
|
+
|------|-------------|-------|---------------------|
|
|
58
|
+
| default | Menu items | - | Profile link, theme toggle, menu items |
|
|
59
|
+
| user | Custom user button | - | Default avatar button |
|
|
60
|
+
| user-menu | Custom menu content | - | Default dropdown menu |
|
|
61
|
+
| after-profile | Content after profile section | - | - |
|
|
62
|
+
|
|
63
|
+
### Events
|
|
64
|
+
|
|
65
|
+
This component does not emit custom events.
|
|
66
|
+
|
|
67
|
+
## Related Components
|
|
68
|
+
|
|
69
|
+
- `AwAvatar` - Avatar component (used for user display)
|
|
70
|
+
- `AwUserpic` - User picture component (used in menu)
|
|
71
|
+
- `AwDropdown` - Dropdown component (used for menu)
|
|
72
|
+
- `AwNavItem` - Navigation item component
|
|
73
|
+
- `AwIcon` - Icon components
|
|
74
|
+
|
|
75
|
+
## Notes
|
|
76
|
+
|
|
77
|
+
- **Import Method:** Dynamic - Component is loaded on-demand as a layout component
|
|
78
|
+
- Component is internal (used within layout components)
|
|
79
|
+
- User data is typically retrieved from Vuex store (`awesIo` module)
|
|
80
|
+
- Profile URL is managed via Vuex store
|
|
81
|
+
- Theme toggle switches between dark/light modes
|
|
82
|
+
- Desktop: hover to open, mouseleave to close
|
|
83
|
+
- Mobile: click to open, click outside to close
|
|
84
|
+
- Menu includes profile link, theme toggle, and custom menu items
|
|
85
|
+
- Avatar size changes based on `outline` prop (24px vs 40px)
|
|
86
|
+
- Dropdown positioning adjusts based on `vertical` prop
|
|
87
|
+
- Component uses `AwDropdown` for menu display
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: PageAside component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwPageAside /> component is used to render page with aside sidebar - UI Vue component for AwesCode UI.
|
|
6
|
+
title: PageAside
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwPageAside
|
|
10
|
+
|
|
11
|
+
**Category:** Page | **Import:** Dynamic
|
|
12
|
+
|
|
13
|
+
The `AwPageAside` component is a specialized page layout wrapper that adds a persistent sidebar (aside) section to the standard `AwPage` component. It provides responsive behavior with the aside appearing as a separate column on desktop and as a card on mobile.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwPageAside` provides a page layout with aside sidebar:
|
|
18
|
+
- Responsive aside positioning (sidebar on desktop, card on mobile)
|
|
19
|
+
- Sticky aside buttons at the bottom
|
|
20
|
+
- Pass-through support for all `AwPage` props and slots
|
|
21
|
+
- Desktop/mobile breakpoint customization
|
|
22
|
+
- Optional aside line separator
|
|
23
|
+
- Mobile aside can be hidden
|
|
24
|
+
- Bottom bar spacing awareness
|
|
25
|
+
- `isDesktop` prop in all slots for responsive content
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Basic Example
|
|
30
|
+
|
|
31
|
+
```markup
|
|
32
|
+
<AwPageAside title="Page with Aside">
|
|
33
|
+
<template #default>
|
|
34
|
+
<p>Main content goes here</p>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<template #aside>
|
|
38
|
+
<AwCard title="Sidebar">
|
|
39
|
+
<p>Sidebar content</p>
|
|
40
|
+
</AwCard>
|
|
41
|
+
</template>
|
|
42
|
+
</AwPageAside>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### With Aside Buttons
|
|
46
|
+
|
|
47
|
+
```markup
|
|
48
|
+
<AwPageAside title="Edit Form">
|
|
49
|
+
<template #default>
|
|
50
|
+
<AwForm url="/api/submit">
|
|
51
|
+
<!-- form fields -->
|
|
52
|
+
</AwForm>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<template #aside>
|
|
56
|
+
<AwCard title="Info">
|
|
57
|
+
<p>Additional information</p>
|
|
58
|
+
</AwCard>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<template #aside-buttons>
|
|
62
|
+
<AwButton cta>Save</AwButton>
|
|
63
|
+
<AwButton theme="outline">Cancel</AwButton>
|
|
64
|
+
</template>
|
|
65
|
+
</AwPageAside>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Custom Desktop Breakpoint
|
|
69
|
+
|
|
70
|
+
```markup
|
|
71
|
+
<AwPageAside
|
|
72
|
+
title="Responsive Page"
|
|
73
|
+
desktop-from="xl"
|
|
74
|
+
>
|
|
75
|
+
<template #default>
|
|
76
|
+
<p>Main content</p>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<template #aside>
|
|
80
|
+
<p>Sidebar switches to desktop mode at xl breakpoint</p>
|
|
81
|
+
</template>
|
|
82
|
+
</AwPageAside>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### With Line Separator
|
|
86
|
+
|
|
87
|
+
```markup
|
|
88
|
+
<AwPageAside
|
|
89
|
+
title="Page Title"
|
|
90
|
+
modifiers="line"
|
|
91
|
+
>
|
|
92
|
+
<template #default>
|
|
93
|
+
<p>Main content</p>
|
|
94
|
+
</template>
|
|
95
|
+
|
|
96
|
+
<template #aside>
|
|
97
|
+
<p>Aside with vertical line separator</p>
|
|
98
|
+
</template>
|
|
99
|
+
</AwPageAside>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Hide Mobile Aside
|
|
103
|
+
|
|
104
|
+
```markup
|
|
105
|
+
<AwPageAside
|
|
106
|
+
title="Page Title"
|
|
107
|
+
hide-mobile-aside
|
|
108
|
+
>
|
|
109
|
+
<template #default>
|
|
110
|
+
<p>Main content</p>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<template #aside>
|
|
114
|
+
<p>This aside only appears on desktop</p>
|
|
115
|
+
</template>
|
|
116
|
+
</AwPageAside>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Custom Mobile Aside
|
|
120
|
+
|
|
121
|
+
```markup
|
|
122
|
+
<AwPageAside title="Custom Mobile">
|
|
123
|
+
<template #default>
|
|
124
|
+
<p>Main content</p>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<template #aside="{ isDesktop }">
|
|
128
|
+
<div v-if="isDesktop">
|
|
129
|
+
<!-- Desktop aside layout -->
|
|
130
|
+
<AwCard title="Desktop Sidebar">...</AwCard>
|
|
131
|
+
</div>
|
|
132
|
+
<div v-else>
|
|
133
|
+
<!-- Mobile aside layout -->
|
|
134
|
+
<AwAccordionFold title="More Info">...</AwAccordionFold>
|
|
135
|
+
</div>
|
|
136
|
+
</template>
|
|
137
|
+
|
|
138
|
+
<template #mobile-aside="{ isDesktop }">
|
|
139
|
+
<AwCard v-if="!isDesktop" class="custom-mobile-card">
|
|
140
|
+
<slot name="aside" />
|
|
141
|
+
</AwCard>
|
|
142
|
+
</template>
|
|
143
|
+
</AwPageAside>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Pass-Through AwPage Props
|
|
147
|
+
|
|
148
|
+
```markup
|
|
149
|
+
<AwPageAside
|
|
150
|
+
title="Page Title"
|
|
151
|
+
:breadcrumb="{ href: '/back', title: 'Back' }"
|
|
152
|
+
:subnav="tabs"
|
|
153
|
+
container="small"
|
|
154
|
+
>
|
|
155
|
+
<template #buttons>
|
|
156
|
+
<AwButton>Action</AwButton>
|
|
157
|
+
</template>
|
|
158
|
+
|
|
159
|
+
<template #default>
|
|
160
|
+
<p>Main content</p>
|
|
161
|
+
</template>
|
|
162
|
+
|
|
163
|
+
<template #aside>
|
|
164
|
+
<p>Sidebar</p>
|
|
165
|
+
</template>
|
|
166
|
+
</AwPageAside>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## API
|
|
170
|
+
|
|
171
|
+
### Props
|
|
172
|
+
|
|
173
|
+
| Name | Description | Type | Required | Default |
|
|
174
|
+
|------|-------------|------|----------|---------|
|
|
175
|
+
| desktopFrom | Screen breakpoint for desktop layout | `String` | `false` | `'lg'` |
|
|
176
|
+
| modifiers | CSS modifier classes (e.g., `'line'` for separator) | `String` / `Object` | `false` | `''` |
|
|
177
|
+
| hideMobileAside | Hide aside section on mobile | `Boolean` | `false` | `false` |
|
|
178
|
+
|
|
179
|
+
**Breakpoint Options:** `'sm'`, `'md'`, `'lg'`, `'xl'`, `'2xl'`
|
|
180
|
+
|
|
181
|
+
**All `AwPage` props** are also supported and passed through via `v-bind="$attrs"`:
|
|
182
|
+
- `title` - Page title
|
|
183
|
+
- `breadcrumb` - Breadcrumb navigation
|
|
184
|
+
- `subnav` - Subnavigation tabs
|
|
185
|
+
- `container` - Container size
|
|
186
|
+
- `fullscreen` - Fullscreen mode
|
|
187
|
+
- etc.
|
|
188
|
+
|
|
189
|
+
See [AwPage documentation](./aw-page.md#props) for complete list.
|
|
190
|
+
|
|
191
|
+
### Slots
|
|
192
|
+
|
|
193
|
+
| Name | Description | Props | Default Slot Content |
|
|
194
|
+
|------|-------------|-------|---------------------|
|
|
195
|
+
| default | Main page content | `{ isDesktop }` | - |
|
|
196
|
+
| aside | Aside sidebar content | `{ isDesktop }` | - |
|
|
197
|
+
| aside-buttons | Buttons at bottom of aside (sticky) | - | - |
|
|
198
|
+
| mobile-aside | Custom mobile aside wrapper | `{ isDesktop }` | AwCard wrapper |
|
|
199
|
+
| bottom | Content below main content | - | - |
|
|
200
|
+
|
|
201
|
+
**Pass-through slots from AwPage:**
|
|
202
|
+
- `heading` - Custom page header
|
|
203
|
+
- `title` - Custom title content
|
|
204
|
+
- `buttons` - Header buttons
|
|
205
|
+
- `subnav` - Custom subnavigation
|
|
206
|
+
- `headline-breadcrumb` - Custom breadcrumb
|
|
207
|
+
- `after-breadcrumb` - Content after breadcrumb
|
|
208
|
+
- `mobile-title` - Mobile title display
|
|
209
|
+
- `bottom-bar` - Custom bottom bar
|
|
210
|
+
|
|
211
|
+
All slots receive `isDesktop` prop for responsive rendering.
|
|
212
|
+
|
|
213
|
+
### Events
|
|
214
|
+
|
|
215
|
+
All events from `AwPage` are passed through (e.g., `update:fullscreen`).
|
|
216
|
+
|
|
217
|
+
### Data Properties
|
|
218
|
+
|
|
219
|
+
| Name | Description | Type |
|
|
220
|
+
|------|-------------|------|
|
|
221
|
+
| hideBottomBar | Whether bottom bar is hidden (computed from AwPage) | `Boolean` |
|
|
222
|
+
|
|
223
|
+
### Computed Properties
|
|
224
|
+
|
|
225
|
+
| Name | Description |
|
|
226
|
+
|------|-------------|
|
|
227
|
+
| isDesktop | Whether current screen size is desktop (based on `desktopFrom` prop) |
|
|
228
|
+
| _slots | Filtered slots object excluding self-managed slots |
|
|
229
|
+
|
|
230
|
+
### Methods
|
|
231
|
+
|
|
232
|
+
| Name | Parameters | Description |
|
|
233
|
+
|------|------------|-------------|
|
|
234
|
+
| _wathcBottomBar | - | Updates hideBottomBar state from AwPage reference |
|
|
235
|
+
|
|
236
|
+
### Head
|
|
237
|
+
|
|
238
|
+
Component adds `aw-page-aside-page-body` class to `<body>` element for styling.
|
|
239
|
+
|
|
240
|
+
## Related Components
|
|
241
|
+
|
|
242
|
+
- [AwPage](./aw-page.md) - Base page component used internally
|
|
243
|
+
- [AwPageSingle](./aw-page-single.md) - Single column page layout
|
|
244
|
+
- [AwCard](../atoms/aw-card.md) - Card component used for mobile aside wrapper
|
|
245
|
+
- [AwButton](../molecules/aw-button.md) - Button component for aside actions
|
|
246
|
+
|
|
247
|
+
## Notes
|
|
248
|
+
|
|
249
|
+
- **Import Method:** Dynamic - Component is loaded on-demand as a page component
|
|
250
|
+
- Component wraps `AwPage` and passes through all props via `$attrs`
|
|
251
|
+
- Desktop/mobile layout switches based on `$screen[desktopFrom]` breakpoint
|
|
252
|
+
- On desktop, aside appears as a fixed-width sidebar on the right
|
|
253
|
+
- On mobile, aside appears as a card below main content (unless `hideMobileAside` is true)
|
|
254
|
+
- Aside buttons are sticky at the bottom on both desktop and mobile
|
|
255
|
+
- Bottom spacing adjusts automatically when bottom bar is present (`4rem` padding)
|
|
256
|
+
- Uses CSS custom property `--page-aside-buttons-bottom` for spacing control
|
|
257
|
+
- Component filters out `default`, `aside`, and `aside-buttons` slots before passing to AwPage
|
|
258
|
+
- The `modifiers` prop with value `'line'` adds `.aw-page-aside__aside--line` class
|
|
259
|
+
- Uses `$refs.page` to access internal AwPage component state
|
|
260
|
+
- Bottom bar visibility is watched in `created` and `updated` lifecycle hooks
|
|
261
|
+
- All pass-through slots maintain their scoped slot data plus `isDesktop` prop
|
|
262
|
+
- Component uses `inheritAttrs: false` to control attribute inheritance
|
|
263
|
+
- Body class is set via Nuxt's `head()` method for global styling
|
|
264
|
+
|
|
265
|
+
## Layout Structure
|
|
266
|
+
|
|
267
|
+
**Desktop Layout:**
|
|
268
|
+
```
|
|
269
|
+
┌─────────────────────────────────────────────┐
|
|
270
|
+
│ AwPage Wrapper (Main Content) │
|
|
271
|
+
│ ┌─────────────────────────────────────────┐ │ ┌─────────────┐
|
|
272
|
+
│ │ Page Header │ │ │ Aside │
|
|
273
|
+
│ ├─────────────────────────────────────────┤ │ │ Content │
|
|
274
|
+
│ │ Main Content │ │ │ │
|
|
275
|
+
│ │ │ │ │ │
|
|
276
|
+
│ │ │ │ │ │
|
|
277
|
+
│ └─────────────────────────────────────────┘ │ ├─────────────┤
|
|
278
|
+
│ │ │ Buttons │
|
|
279
|
+
└─────────────────────────────────────────────┘ └─────────────┘
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Mobile Layout:**
|
|
283
|
+
```
|
|
284
|
+
┌─────────────────────────────────────────────┐
|
|
285
|
+
│ Page Header │
|
|
286
|
+
├─────────────────────────────────────────────┤
|
|
287
|
+
│ Main Content │
|
|
288
|
+
│ │
|
|
289
|
+
│ │
|
|
290
|
+
├─────────────────────────────────────────────┤
|
|
291
|
+
│ Mobile Aside (Card) │
|
|
292
|
+
│ │
|
|
293
|
+
├─────────────────────────────────────────────┤
|
|
294
|
+
│ Aside Buttons (Sticky) │
|
|
295
|
+
└─────────────────────────────────────────────┘
|
|
296
|
+
```
|