@awes-io/ui 2.142.3 → 2.144.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/assets/css/components/_index.css +7 -1
- package/assets/css/components/action-card.css +1 -0
- package/assets/css/components/action-icon.css +2 -2
- package/assets/css/components/alert.css +28 -22
- package/assets/css/components/animation.css +52 -32
- package/assets/css/components/badge.css +1 -0
- package/assets/css/components/banner-text.css +15 -4
- package/assets/css/components/card.css +0 -1
- package/assets/css/components/content-placeholder.css +104 -0
- package/assets/css/components/dropdown.css +20 -7
- 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/icon-menu-item.css +12 -7
- package/assets/css/components/layout.css +1 -32
- package/assets/css/components/mobile-menu-nav.css +8 -4
- 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/css/components/text-field.css +4 -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/AwActionIcon.vue +11 -2
- package/components/1_atoms/AwContentPlaceholder.vue +60 -0
- package/components/1_atoms/AwFlow.vue +37 -49
- package/components/1_atoms/AwGrid.vue +11 -3
- package/components/1_atoms/AwIcon/AwIcon.vue +5 -3
- package/components/1_atoms/AwIcon/AwIconSystemMono.vue +3 -2
- package/components/1_atoms/AwInput.vue +2 -2
- package/components/1_atoms/AwLabel.vue +1 -1
- package/components/1_atoms/AwList.vue +3 -1
- package/components/1_atoms/AwRadio.vue +1 -1
- package/components/1_atoms/AwSlider.vue +15 -1
- package/components/1_atoms/AwTag.vue +6 -1
- package/components/2_molecules/AwAlert.vue +63 -42
- package/components/2_molecules/AwBadge.vue +1 -1
- package/components/2_molecules/AwBannerText.vue +8 -2
- package/components/2_molecules/AwButton.vue +1 -1
- package/components/2_molecules/AwDescriptionInput.vue +19 -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/AwBottomBar.vue +22 -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/AwSubnav.vue +11 -1
- package/components/3_organisms/AwTable/AwTableBuilder.vue +20 -60
- package/components/3_organisms/AwTable/_AwTableCellDropdown.vue +6 -1
- package/components/3_organisms/AwTable/_AwTableRow.vue +2 -1
- package/components/4_pages/AwPage.vue +1 -0
- package/components/4_pages/AwPageAside.vue +108 -0
- package/components/5_layouts/AwLayoutCenter.vue +3 -8
- package/components/5_layouts/_AwMenuItemIcon.vue +9 -2
- package/components/5_layouts/_AwMobileMenuItem.vue +5 -3
- package/components/5_layouts/_AwUserMenu.vue +1 -1
- package/components/_config.js +26 -1
- package/docs/_template.md +80 -0
- package/docs/components/atoms/aw-accordion-fold.md +129 -0
- package/docs/components/atoms/aw-action-card-body.md +99 -0
- package/docs/components/atoms/aw-action-card.md +130 -0
- package/docs/components/atoms/aw-action-icon.md +126 -0
- package/docs/components/atoms/aw-avatar.md +106 -0
- package/docs/components/atoms/aw-card.md +137 -0
- package/docs/components/atoms/aw-checkbox.md +288 -0
- package/docs/components/atoms/aw-content-placeholder.md +147 -0
- package/docs/components/atoms/aw-description.md +83 -0
- package/docs/components/atoms/aw-dock.md +90 -0
- package/docs/components/atoms/aw-dropdown-button.md +94 -0
- package/docs/components/atoms/aw-dropdown.md +178 -0
- package/docs/components/atoms/aw-file.md +73 -0
- package/docs/components/atoms/aw-flow.md +140 -0
- package/docs/components/atoms/aw-grid.md +109 -0
- package/docs/components/atoms/aw-headline.md +71 -0
- package/docs/components/atoms/aw-icon-system-color.md +122 -0
- package/docs/components/atoms/aw-icon-system-mono.md +206 -0
- package/docs/components/atoms/aw-icon.md +235 -0
- package/docs/components/atoms/aw-info.md +123 -0
- package/docs/components/atoms/aw-input.md +212 -0
- package/docs/components/atoms/aw-label.md +136 -0
- package/docs/components/atoms/aw-link.md +151 -0
- package/docs/components/atoms/aw-list.md +152 -0
- package/docs/components/atoms/aw-progress.md +119 -0
- package/docs/components/atoms/aw-radio.md +182 -0
- package/docs/components/atoms/aw-refresh-wrapper.md +81 -0
- package/docs/components/atoms/aw-select-native.md +234 -0
- package/docs/components/atoms/aw-slider.md +189 -0
- package/docs/components/atoms/aw-sub-headline.md +73 -0
- package/docs/components/atoms/aw-switcher.md +192 -0
- package/docs/components/atoms/aw-tag.md +144 -0
- package/docs/components/atoms/aw-title.md +70 -0
- package/docs/components/atoms/aw-toggler.md +90 -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 +138 -0
- package/docs/components/molecules/aw-alert.md +191 -0
- package/docs/components/molecules/aw-badge.md +129 -0
- package/docs/components/molecules/aw-banner-text.md +156 -0
- package/docs/components/molecules/aw-button-nav.md +111 -0
- package/docs/components/molecules/aw-button.md +193 -0
- package/docs/components/molecules/aw-description-input.md +124 -0
- package/docs/components/molecules/aw-empty-container.md +235 -0
- package/docs/components/molecules/aw-island.md +506 -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 +239 -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 +300 -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 +1556 -0
- package/docs/guides/page-patterns/list-pages.md +1242 -0
- package/docs/index.md +263 -1
- package/docs/integrations.md +870 -0
- package/docs/reference/colors.md +232 -0
- package/docs/reference/icons.md +163 -0
- package/docs/reference/menu.md +462 -0
- package/docs/reference/plugins.md +970 -0
- package/docs/reference/troubleshooting.md +964 -0
- package/nuxt/awes.config.js +9 -8
- package/nuxt/index.js +2 -2
- package/nuxt/pages/more.vue +1 -1
- package/package.json +5 -3
- package/readme.md +171 -1
- package/store/awesIo.js +11 -0
- package/CHANGELOG.md +0 -4520
- 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,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: LayoutProvider component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwLayoutProvider /> is a layout provider that manages navigation menus and provides context for all layouts in AwesCode UI.
|
|
6
|
+
title: LayoutProvider
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwLayoutProvider
|
|
10
|
+
|
|
11
|
+
**Category:** Layout | **Import:** Dynamic
|
|
12
|
+
|
|
13
|
+
The `AwLayoutProvider` component is the base layout provider that manages navigation menus from Vuex store and provides layout context to child components. It serves as the foundation for all other layout components.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwLayoutProvider` provides layout management with:
|
|
18
|
+
- Menu management from Vuex store (mainMenu, secondaryMenu, userMenu, tertiaryMenu)
|
|
19
|
+
- Active menu item detection based on current route
|
|
20
|
+
- Menu transformation with permissions checking
|
|
21
|
+
- Provides layout context via Vue provide/inject
|
|
22
|
+
- Offline notification display
|
|
23
|
+
- Translation support for menu items
|
|
24
|
+
- Route-based active item highlighting
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### Basic Example
|
|
29
|
+
|
|
30
|
+
```markup
|
|
31
|
+
<AwLayoutProvider>
|
|
32
|
+
<div>Your layout content</div>
|
|
33
|
+
</AwLayoutProvider>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Used by Other Layouts
|
|
37
|
+
|
|
38
|
+
```markup
|
|
39
|
+
<!-- AwLayout uses AwLayoutProvider internally -->
|
|
40
|
+
<template>
|
|
41
|
+
<AwLayoutProvider class="aw-layout">
|
|
42
|
+
<AwLayoutMenu v-if="$screen.lg" />
|
|
43
|
+
<AwHeaderNotification />
|
|
44
|
+
<slot />
|
|
45
|
+
</AwLayoutProvider>
|
|
46
|
+
</template>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Accessing Layout Context
|
|
50
|
+
|
|
51
|
+
```markup
|
|
52
|
+
<script>
|
|
53
|
+
export default {
|
|
54
|
+
inject: ['layoutProvider'],
|
|
55
|
+
|
|
56
|
+
computed: {
|
|
57
|
+
mainMenu() {
|
|
58
|
+
return this.layoutProvider.mainMenu
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
activeMenuItem() {
|
|
62
|
+
return this.layoutProvider.activeMenuItem
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## API
|
|
70
|
+
|
|
71
|
+
### Props
|
|
72
|
+
|
|
73
|
+
This component does not have props. All menu data comes from Vuex store.
|
|
74
|
+
|
|
75
|
+
### Slots
|
|
76
|
+
|
|
77
|
+
| Name | Description | Props | Default Slot Content |
|
|
78
|
+
|------|-------------|-------|---------------------|
|
|
79
|
+
| default | Layout content | - | - |
|
|
80
|
+
|
|
81
|
+
### Events
|
|
82
|
+
|
|
83
|
+
This component does not emit custom events.
|
|
84
|
+
|
|
85
|
+
### Provided Context
|
|
86
|
+
|
|
87
|
+
The component provides a `layoutProvider` object via Vue's provide/inject API:
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
{
|
|
91
|
+
mainMenu: Array, // Transformed main menu items
|
|
92
|
+
secondaryMenu: Array, // Transformed secondary menu items
|
|
93
|
+
userMenu: Array, // Transformed user menu items
|
|
94
|
+
tertiaryMenu: Array, // Transformed tertiary menu items
|
|
95
|
+
activeMenu: Object, // Currently active top-level menu item
|
|
96
|
+
activeMenuItem: Object // Currently active menu item (including nested)
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Menu Item Structure
|
|
101
|
+
|
|
102
|
+
Menu items are transformed from Vuex store with this structure:
|
|
103
|
+
|
|
104
|
+
```javascript
|
|
105
|
+
{
|
|
106
|
+
text: String, // Translated menu item text
|
|
107
|
+
subtitle: String, // Translated subtitle (optional)
|
|
108
|
+
description: String, // Translated description (optional)
|
|
109
|
+
href: String, // Link URL
|
|
110
|
+
icon: String, // Icon name
|
|
111
|
+
iconBg: String, // Icon background color
|
|
112
|
+
iconActive: String, // Active icon name
|
|
113
|
+
class: String, // Custom CSS class
|
|
114
|
+
expanded: Boolean, // Expanded state
|
|
115
|
+
target: String, // Link target (_blank, etc.)
|
|
116
|
+
rel: String, // Link rel attribute
|
|
117
|
+
listeners: Object, // Event listeners
|
|
118
|
+
abstract: Boolean, // Abstract menu item (no link)
|
|
119
|
+
key: String, // Unique key
|
|
120
|
+
badge: String/Number, // Badge value
|
|
121
|
+
switcher: Boolean, // Switcher toggle
|
|
122
|
+
back: Boolean, // Back button
|
|
123
|
+
isDivide: Boolean, // Divider
|
|
124
|
+
arrow: Boolean, // Show arrow
|
|
125
|
+
hideText: Boolean, // Hide text
|
|
126
|
+
children: Array // Child menu items
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Vuex Store Integration
|
|
131
|
+
|
|
132
|
+
The component reads menu data from the `awesIo` Vuex module:
|
|
133
|
+
|
|
134
|
+
```javascript
|
|
135
|
+
// In your Vuex store or via API
|
|
136
|
+
this.$store.dispatch('awesIo/setMainMenu', [
|
|
137
|
+
{
|
|
138
|
+
text: 'Dashboard',
|
|
139
|
+
href: '/dashboard',
|
|
140
|
+
icon: 'dashboard'
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
text: 'Users',
|
|
144
|
+
icon: 'users',
|
|
145
|
+
toggler: true,
|
|
146
|
+
children: [
|
|
147
|
+
{ text: 'All Users', href: '/users' },
|
|
148
|
+
{ text: 'Add User', href: '/users/create' }
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
])
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Menu Transformation Features
|
|
155
|
+
|
|
156
|
+
### Permission Checking
|
|
157
|
+
|
|
158
|
+
Menu items with `show` function are filtered based on permissions:
|
|
159
|
+
|
|
160
|
+
```javascript
|
|
161
|
+
{
|
|
162
|
+
text: 'Admin',
|
|
163
|
+
href: '/admin',
|
|
164
|
+
show: ($can) => $can('access', 'admin')
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Translation
|
|
169
|
+
|
|
170
|
+
Menu items are automatically translated unless `translate: false`:
|
|
171
|
+
|
|
172
|
+
```javascript
|
|
173
|
+
{
|
|
174
|
+
text: 'Users', // Will be translated via this.$t('Users')
|
|
175
|
+
translate: true // Default
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
{
|
|
179
|
+
text: 'Custom Name',
|
|
180
|
+
translate: false // Won't be translated
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Dynamic Hrefs
|
|
185
|
+
|
|
186
|
+
Hrefs can be functions receiving store state and getters:
|
|
187
|
+
|
|
188
|
+
```javascript
|
|
189
|
+
{
|
|
190
|
+
text: 'Profile',
|
|
191
|
+
href: (state, getters) => `/users/${state.user.id}`
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Auto-Generated Hrefs
|
|
196
|
+
|
|
197
|
+
Parent items without href automatically use first child's href:
|
|
198
|
+
|
|
199
|
+
```javascript
|
|
200
|
+
{
|
|
201
|
+
text: 'Settings',
|
|
202
|
+
toggler: true,
|
|
203
|
+
children: [
|
|
204
|
+
{ text: 'Profile', href: '/settings/profile' }, // Parent will use this href
|
|
205
|
+
{ text: 'Security', href: '/settings/security' }
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Active Item Detection
|
|
211
|
+
|
|
212
|
+
The provider automatically detects active menu items based on current route:
|
|
213
|
+
|
|
214
|
+
- Compares route path with menu item hrefs
|
|
215
|
+
- Handles nested menu items
|
|
216
|
+
- Updates on route changes
|
|
217
|
+
- Sets `activeMenu` (top-level) and `activeMenuItem` (any level)
|
|
218
|
+
|
|
219
|
+
## Related Components
|
|
220
|
+
|
|
221
|
+
- `AwLayout` - Uses AwLayoutProvider internally
|
|
222
|
+
- `AwLayoutCenter` - Uses AwLayoutProvider internally
|
|
223
|
+
- `AwLayoutMenu` - Consumes layout context
|
|
224
|
+
- `AwOfflineNotify` - Displayed by provider
|
|
225
|
+
|
|
226
|
+
## Notes
|
|
227
|
+
|
|
228
|
+
- **Import Method:** Dynamic - Component is loaded on-demand as a layout
|
|
229
|
+
- All other layouts use this component as their base
|
|
230
|
+
- Provides menu context to all child components via provide/inject
|
|
231
|
+
- Automatically watches Vuex store for menu changes
|
|
232
|
+
- Handles permission-based menu filtering via `$can` (CASL integration)
|
|
233
|
+
- Menu items are deeply transformed (including nested children)
|
|
234
|
+
- Active item detection uses path prefix matching
|
|
235
|
+
- Offline notification is always displayed (shows when offline)
|
|
236
|
+
- Menu transformation happens on every store update
|
|
237
|
+
- Supports 4 menu types: main, secondary, user, tertiary
|
|
238
|
+
- Used internally by AwLayout and AwLayoutCenter
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Layout component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwLayout /> is a layout with left sidebar navigation for AwesCode UI.
|
|
6
|
+
title: Layout
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwLayout
|
|
10
|
+
|
|
11
|
+
**Category:** Layout | **Import:** Dynamic
|
|
12
|
+
|
|
13
|
+
The `AwLayout` component is the default layout with left sidebar navigation. It provides the main application layout structure with navigation menu, header notifications, and content area.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwLayout` provides the default application layout with:
|
|
18
|
+
- Left sidebar navigation (desktop)
|
|
19
|
+
- Header notifications
|
|
20
|
+
- Content area
|
|
21
|
+
- Responsive design
|
|
22
|
+
- Menu integration with Vuex store
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Basic Example
|
|
27
|
+
|
|
28
|
+
```markup
|
|
29
|
+
<AwLayout>
|
|
30
|
+
<AwPage>
|
|
31
|
+
<h1>Page Content</h1>
|
|
32
|
+
</AwPage>
|
|
33
|
+
</AwLayout>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### With Custom Slots
|
|
37
|
+
|
|
38
|
+
```markup
|
|
39
|
+
<AwLayout>
|
|
40
|
+
<template #before-header>
|
|
41
|
+
<AwBanner>Custom banner</AwBanner>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<template #navbar>
|
|
45
|
+
<CustomNavbar />
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<AwPage>
|
|
49
|
+
<h1>Page Content</h1>
|
|
50
|
+
</AwPage>
|
|
51
|
+
</AwLayout>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## API
|
|
55
|
+
|
|
56
|
+
### Props
|
|
57
|
+
|
|
58
|
+
This component does not have props. Menu is managed via Vuex store (`awesIo` module).
|
|
59
|
+
|
|
60
|
+
### Slots
|
|
61
|
+
|
|
62
|
+
| Name | Description | Props | Default Slot Content |
|
|
63
|
+
|------|-------------|-------|---------------------|
|
|
64
|
+
| default | Main content area | - | - |
|
|
65
|
+
| before-header | Content before header | - | - |
|
|
66
|
+
| navbar | Custom navbar content | - | Default navbar |
|
|
67
|
+
|
|
68
|
+
### Events
|
|
69
|
+
|
|
70
|
+
This component does not emit custom events.
|
|
71
|
+
|
|
72
|
+
## Related Components
|
|
73
|
+
|
|
74
|
+
- `AwLayoutProvider` - Layout provider component (used internally)
|
|
75
|
+
- `AwLayoutMenu` - Sidebar menu component
|
|
76
|
+
- `AwHeaderNotification` - Header notification component
|
|
77
|
+
- `AwPage` - Page component (typically used in default slot)
|
|
78
|
+
|
|
79
|
+
## Notes
|
|
80
|
+
|
|
81
|
+
- **Import Method:** Dynamic - Component is loaded on-demand as a layout
|
|
82
|
+
- Menu is managed via Vuex store (`awesIo` module)
|
|
83
|
+
- Sidebar navigation only shows on desktop (`$screen.lg`)
|
|
84
|
+
- Mobile menu is commented out in current implementation
|
|
85
|
+
- Component uses `AwLayoutProvider` for layout structure
|
|
86
|
+
- Header notifications are automatically displayed
|
|
87
|
+
- All slots are proxied to layout menu component
|
|
88
|
+
- Component provides responsive layout structure
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Action Button component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwActionButton /> component is used to render Action Button - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Action Button
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Action Button
|
|
10
|
+
|
|
11
|
+
**Category:** Molecule | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwActionButton` component is a button-like component with icon, text, and optional descriptions, designed for action cards and lists.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwActionButton` provides a styled action button with a leading icon, main text, optional description and subdescription, and a trailing icon. It extends link functionality and is commonly used in action cards.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Basic Example
|
|
22
|
+
|
|
23
|
+
```markup
|
|
24
|
+
<AwActionButton text="Action" icon="arrow-animated" />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### With Descriptions
|
|
28
|
+
|
|
29
|
+
```markup
|
|
30
|
+
<AwActionButton
|
|
31
|
+
text="Create Project"
|
|
32
|
+
description="Start a new project"
|
|
33
|
+
subdescription="Free plan"
|
|
34
|
+
icon="awesio/plus"
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### With Custom Icon Colors
|
|
39
|
+
|
|
40
|
+
```markup
|
|
41
|
+
<AwActionButton
|
|
42
|
+
text="Action"
|
|
43
|
+
icon="awesio/check"
|
|
44
|
+
icon-color="success"
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### As Links
|
|
49
|
+
|
|
50
|
+
```markup
|
|
51
|
+
<!-- External link -->
|
|
52
|
+
<AwActionButton
|
|
53
|
+
text="External Link"
|
|
54
|
+
icon="awesio/external"
|
|
55
|
+
href="https://example.com"
|
|
56
|
+
target="_blank"
|
|
57
|
+
/>
|
|
58
|
+
|
|
59
|
+
<!-- Internal link (uses router automatically) -->
|
|
60
|
+
<AwActionButton
|
|
61
|
+
text="Internal Link"
|
|
62
|
+
icon="awesio/link"
|
|
63
|
+
href="/components"
|
|
64
|
+
/>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## API
|
|
68
|
+
|
|
69
|
+
### Props
|
|
70
|
+
|
|
71
|
+
| Name | Description | Type | Required | Default |
|
|
72
|
+
|------|-------------|------|----------|---------|
|
|
73
|
+
| icon | Leading icon name | `String` | `false` | `''` |
|
|
74
|
+
| iconColor | Leading icon background color | `String` | `false` | `'green'` |
|
|
75
|
+
| iconOnColor | Leading icon text color | `String` | `false` | `null` |
|
|
76
|
+
| iconSize | Leading icon size | `String` | `false` | `'md'` |
|
|
77
|
+
| text | Button text | `String` | `false` | `''` |
|
|
78
|
+
| description | Description text below main text | `String` | `false` | `''` |
|
|
79
|
+
| subdescription | Subdescription text | `String` | `false` | `''` |
|
|
80
|
+
| iconRight | Trailing icon name | `String` | `false` | `'arrow-animated'` |
|
|
81
|
+
| modifiers | CSS modifiers (e.g., 'outline', 'narrow') | `String` / `Array` | `false` | `''` |
|
|
82
|
+
| href | Link URL (for both internal and external links) | `String` | `false` | `undefined` |
|
|
83
|
+
| target | Link target (e.g., `_blank` for external links) | `String` | `false` | `undefined` |
|
|
84
|
+
|
|
85
|
+
**Link Behavior:**
|
|
86
|
+
- Uses `href` prop for all links (both internal and external)
|
|
87
|
+
- Internal links (starting with `/`) automatically use Vue Router
|
|
88
|
+
- External links work with standard `<a>` tag behavior
|
|
89
|
+
- No need to use `to` prop - the link mixin handles routing automatically
|
|
90
|
+
|
|
91
|
+
### Slots
|
|
92
|
+
|
|
93
|
+
| Name | Description | Props | Default Slot Content |
|
|
94
|
+
|------|-------------|-------|---------------------|
|
|
95
|
+
| default | Custom text content | `{ text }` | Text prop value |
|
|
96
|
+
| icon-wrapper | Custom icon wrapper | - | Default icon wrapper |
|
|
97
|
+
|
|
98
|
+
### Events
|
|
99
|
+
|
|
100
|
+
All link-related events are supported (e.g., `click`).
|
|
101
|
+
|
|
102
|
+
## Related Components
|
|
103
|
+
|
|
104
|
+
- `AwActionCard` - Card component that uses action buttons
|
|
105
|
+
- `AwActionIcon` - Icon component used in action buttons
|
|
106
|
+
- `AwButton` - Standard button component
|
|
107
|
+
|
|
108
|
+
## Component Behavior
|
|
109
|
+
|
|
110
|
+
### Link Functionality
|
|
111
|
+
|
|
112
|
+
The component extends the link mixin, providing intelligent link handling:
|
|
113
|
+
|
|
114
|
+
- **Internal Navigation:** Links starting with `/` automatically use Vue Router for SPA navigation
|
|
115
|
+
- **External Links:** Full URLs (starting with `http://` or `https://`) render as standard `<a>` tags
|
|
116
|
+
- **Prop Usage:** Only use `href` prop - avoid using `to` prop as the link mixin handles routing
|
|
117
|
+
- **Target Control:** Use `target="_blank"` for external links to open in new tabs
|
|
118
|
+
|
|
119
|
+
### Icon Customization
|
|
120
|
+
|
|
121
|
+
- **Leading Icon:** Customize with `icon`, `iconColor`, `iconOnColor`, and `iconSize` props
|
|
122
|
+
- **Trailing Icon:** Defaults to `arrow-animated`, can be customized with `iconRight` prop
|
|
123
|
+
- **Animated Icons:** Automatically detected and styled (e.g., `arrow-animated`)
|
|
124
|
+
|
|
125
|
+
### Visual Modifiers
|
|
126
|
+
|
|
127
|
+
Available modifiers for different styles:
|
|
128
|
+
- `outline` - Outlined button style
|
|
129
|
+
- `narrow` - Reduced padding for compact layouts
|
|
130
|
+
- Multiple modifiers can be combined using an array: `:modifiers="['outline', 'narrow']"`
|
|
131
|
+
|
|
132
|
+
## Notes
|
|
133
|
+
|
|
134
|
+
- **Import Method:** Global - Available as molecule component
|
|
135
|
+
- Commonly used within `AwActionCard` components
|
|
136
|
+
- Description and subdescription provide context for actions
|
|
137
|
+
- Default icon color is `green` with customizable background and text colors
|
|
138
|
+
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Alert component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwAlert /> component is used to render Alert - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Alert
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Alert
|
|
10
|
+
|
|
11
|
+
**Category:** Molecule | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwAlert` component displays alert messages with icon, title, description, and optional action buttons.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwAlert` provides a styled alert component for displaying informational, warning, or error messages. It supports custom colors, icons, and action buttons.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
**Important:** AwAlert components should be placed inside components with "surface" backgrounds (e.g., `AwCard`, `AwModal`, `AwIsland`) for proper visual presentation.
|
|
22
|
+
|
|
23
|
+
### Basic Example
|
|
24
|
+
|
|
25
|
+
```markup
|
|
26
|
+
<AwCard>
|
|
27
|
+
<AwAlert
|
|
28
|
+
title="Basic Alert"
|
|
29
|
+
description="This is a basic alert message."
|
|
30
|
+
/>
|
|
31
|
+
</AwCard>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### With Icons and Semantic Colors
|
|
35
|
+
|
|
36
|
+
```markup
|
|
37
|
+
<AwCard>
|
|
38
|
+
<AwAlert
|
|
39
|
+
title="Success"
|
|
40
|
+
description="Operation completed successfully."
|
|
41
|
+
icon="awesio/check-circle"
|
|
42
|
+
color="success"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<AwAlert
|
|
46
|
+
title="Warning"
|
|
47
|
+
description="Please review this carefully."
|
|
48
|
+
icon="awesio/warning"
|
|
49
|
+
color="warning"
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
<AwAlert
|
|
53
|
+
title="Error"
|
|
54
|
+
description="Something went wrong."
|
|
55
|
+
icon="awesio/close-circle"
|
|
56
|
+
color="error"
|
|
57
|
+
/>
|
|
58
|
+
</AwCard>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### With Custom Icon Color
|
|
62
|
+
|
|
63
|
+
```markup
|
|
64
|
+
<AwCard>
|
|
65
|
+
<AwAlert
|
|
66
|
+
title="Custom Icon Color"
|
|
67
|
+
description="Alert with custom icon color."
|
|
68
|
+
icon="awesio/star"
|
|
69
|
+
icon-color="warning"
|
|
70
|
+
/>
|
|
71
|
+
</AwCard>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### With Action Buttons
|
|
75
|
+
|
|
76
|
+
```markup
|
|
77
|
+
<AwCard>
|
|
78
|
+
<AwAlert
|
|
79
|
+
title="Confirm Action"
|
|
80
|
+
description="Are you sure you want to proceed?"
|
|
81
|
+
icon="awesio/question-circle"
|
|
82
|
+
color="warning"
|
|
83
|
+
>
|
|
84
|
+
<AwButton size="sm" color="success">Confirm</AwButton>
|
|
85
|
+
<AwButton size="sm" color="mono-600">Cancel</AwButton>
|
|
86
|
+
</AwAlert>
|
|
87
|
+
</AwCard>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### With Custom Colors
|
|
91
|
+
|
|
92
|
+
```markup
|
|
93
|
+
<AwCard>
|
|
94
|
+
<AwAlert
|
|
95
|
+
title="Blue Theme"
|
|
96
|
+
description="Alert with blue color."
|
|
97
|
+
icon="awesio/star"
|
|
98
|
+
color="blue"
|
|
99
|
+
/>
|
|
100
|
+
|
|
101
|
+
<AwAlert
|
|
102
|
+
title="Magenta Theme for Icon"
|
|
103
|
+
description="Alert with magenta icon color."
|
|
104
|
+
icon="awesio/question-circle"
|
|
105
|
+
icon-color="on-magenta"
|
|
106
|
+
/>
|
|
107
|
+
</AwCard>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## API
|
|
111
|
+
|
|
112
|
+
### Props
|
|
113
|
+
|
|
114
|
+
| Name | Description | Type | Required | Default |
|
|
115
|
+
|------|-------------|------|----------|---------|
|
|
116
|
+
| icon | Icon name | `String` | `false` | `''` |
|
|
117
|
+
| config | Alert background color and icon | `String` | `false` | `'default'` |
|
|
118
|
+
| color | Alert background color | `String` | `false` | `''` |
|
|
119
|
+
| onColor | Alert icon and text color | `String` | `false` | `''` |
|
|
120
|
+
| iconColor | Icon color | `String` | `false` | `''` |
|
|
121
|
+
| title | Alert title text | `String` | `false` | `''` |
|
|
122
|
+
| description | Alert description text | `String` | `false` | `''` |
|
|
123
|
+
|
|
124
|
+
### Slots
|
|
125
|
+
|
|
126
|
+
| Name | Description | Props | Default Slot Content |
|
|
127
|
+
|------|-------------|-------|---------------------|
|
|
128
|
+
| default | Action buttons | - | - |
|
|
129
|
+
| icon | Custom icon content | - | Default icon |
|
|
130
|
+
| title | Custom title content | - | Title text |
|
|
131
|
+
| description | Custom description content | - | Description text |
|
|
132
|
+
| close | Close icon or button | - | - |
|
|
133
|
+
|
|
134
|
+
### Events
|
|
135
|
+
|
|
136
|
+
No events are emitted by this component.
|
|
137
|
+
|
|
138
|
+
## Component Behavior
|
|
139
|
+
|
|
140
|
+
### Color System
|
|
141
|
+
|
|
142
|
+
The alert component supports both semantic and custom colors:
|
|
143
|
+
|
|
144
|
+
**Semantic Colors:**
|
|
145
|
+
- `info` - Informational messages (blue theme)
|
|
146
|
+
- `success` - Successful operations (green theme)
|
|
147
|
+
- `warning` - Cautionary messages (yellow/orange theme)
|
|
148
|
+
- `error` - Error messages (red theme)
|
|
149
|
+
- `notify` - Notification alerts (notification theme)
|
|
150
|
+
- `accent` - Primary brand color
|
|
151
|
+
|
|
152
|
+
**Custom Colors:**
|
|
153
|
+
Any named color from the design system can be used:
|
|
154
|
+
- `blue`, `purple`, `magenta`, `red`, `green`, etc.
|
|
155
|
+
- Named colors display with light/pastel backgrounds
|
|
156
|
+
- Use `icon-color` with `on-{color}` for vibrant icon colors on custom backgrounds
|
|
157
|
+
|
|
158
|
+
### Icon Colors
|
|
159
|
+
|
|
160
|
+
The `iconColor` prop accepts:
|
|
161
|
+
- **Semantic colors**: `success`, `warning`, `error`, `info`, `accent` (use without `on-` prefix)
|
|
162
|
+
- **Named colors with OnColor variants**: `on-magenta`, `on-purple`, `on-blue`, etc. (use `on-` prefix for vibrant colors on light backgrounds)
|
|
163
|
+
|
|
164
|
+
**Important:** Semantic colors should be used directly without the `on-` prefix (e.g., `icon-color="accent"`), while named colors require the `on-` prefix to get vibrant colors on light backgrounds (e.g., `icon-color="on-magenta"`).
|
|
165
|
+
|
|
166
|
+
### Layout Requirements
|
|
167
|
+
|
|
168
|
+
- **Surface background required**: Alerts must be placed inside components with white/surface backgrounds
|
|
169
|
+
- Compatible containers: `AwCard`, `AwModal`, `AwIsland`, or any component with surface color
|
|
170
|
+
- The surface background provides proper contrast for alert colors
|
|
171
|
+
- Multiple alerts can be stacked within a single container using `AwGrid`
|
|
172
|
+
- Action buttons render in a separate section below title/description
|
|
173
|
+
|
|
174
|
+
## Related Components
|
|
175
|
+
|
|
176
|
+
- `AwCard` - Required container for alerts
|
|
177
|
+
- `AwIcon` - Icon component used within alerts
|
|
178
|
+
- `AwButton` - Button component for alert actions
|
|
179
|
+
- `AwBadge` - Alternative for status indicators
|
|
180
|
+
|
|
181
|
+
## Notes
|
|
182
|
+
|
|
183
|
+
- **Import Method:** Global - Available as molecule component
|
|
184
|
+
- **Container Required:** Always wrap alerts in `AwCard` for proper styling
|
|
185
|
+
- Default color is `'default'` (neutral gray theme)
|
|
186
|
+
- Title and description are both optional but at least one should be provided
|
|
187
|
+
- Icon appears before the title when provided
|
|
188
|
+
- Action buttons use the default slot and appear below content
|
|
189
|
+
- Supports both semantic colors (info, success, warning, error) and custom named colors
|
|
190
|
+
- Use `icon-color` to customize icon independently from alert background
|
|
191
|
+
|