@awes-io/ui 2.142.0 → 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 +58 -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/AwImageUpload.vue +1 -1
- package/components/3_organisms/AwMarkdownEditor.vue +0 -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-timeline-builder.md +0 -50
- 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,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: PageMenuButtons component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwPageMenuButtons /> component renders page action buttons with responsive behavior - UI Vue component for AwesCode UI.
|
|
6
|
+
title: PageMenuButtons
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwPageMenuButtons
|
|
10
|
+
|
|
11
|
+
**Category:** Page | **Import:** Dynamic
|
|
12
|
+
|
|
13
|
+
The `AwPageMenuButtons` component displays page action buttons with responsive behavior. On desktop, buttons are shown expanded; on mobile, CTA buttons become fixed floating buttons and others go into a context menu dropdown.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwPageMenuButtons` provides responsive page actions with:
|
|
18
|
+
- Desktop: Full buttons displayed expanded
|
|
19
|
+
- Mobile: CTA buttons as fixed floating buttons, others in dropdown
|
|
20
|
+
- Context menu for non-CTA buttons
|
|
21
|
+
- Download button handling with loading states
|
|
22
|
+
- Teleport/portal support for fixed buttons
|
|
23
|
+
- Scroll-based expand/collapse animation
|
|
24
|
+
- Conditional visibility support
|
|
25
|
+
- Tooltip support
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Basic Example
|
|
30
|
+
|
|
31
|
+
```markup
|
|
32
|
+
<AwPageMenuButtons
|
|
33
|
+
:items="[
|
|
34
|
+
{ text: 'Save', cta: true, href: '/save' },
|
|
35
|
+
{ text: 'Edit', href: '/edit', icon: 'edit' },
|
|
36
|
+
{ text: 'Delete', href: '/delete', icon: 'trash' }
|
|
37
|
+
]"
|
|
38
|
+
/>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### With Download Button
|
|
42
|
+
|
|
43
|
+
```markup
|
|
44
|
+
<AwPageMenuButtons
|
|
45
|
+
:items="[
|
|
46
|
+
{ text: 'Download PDF', download: 'pdf', href: '/api/download', icon: 'download', cta: true }
|
|
47
|
+
]"
|
|
48
|
+
/>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### With Conditional Visibility
|
|
52
|
+
|
|
53
|
+
```markup
|
|
54
|
+
<AwPageMenuButtons
|
|
55
|
+
:items="[
|
|
56
|
+
{ text: 'Edit', cta: true, href: '/edit', show: (vm) => vm.$can('edit', 'post') },
|
|
57
|
+
{ text: 'Delete', href: '/delete', show: false }
|
|
58
|
+
]"
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Custom Breakpoint
|
|
63
|
+
|
|
64
|
+
```markup
|
|
65
|
+
<AwPageMenuButtons
|
|
66
|
+
:items="buttons"
|
|
67
|
+
breakpoint="xl"
|
|
68
|
+
teleport-fixed-to=".custom-container"
|
|
69
|
+
/>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## API
|
|
73
|
+
|
|
74
|
+
### Props
|
|
75
|
+
|
|
76
|
+
| Name | Description | Type | Required | Default |
|
|
77
|
+
|------|-------------|------|----------|---------|
|
|
78
|
+
| items | Array of button configurations | `Array` | `false` | `[]` |
|
|
79
|
+
| breakpoint | Screen breakpoint for expanded/collapsed state | `String` | `false` | `'lg'` |
|
|
80
|
+
| teleportFixedTo | Target selector for fixed buttons teleport | `String` | `false` | `'body'` |
|
|
81
|
+
| expandOffset | Max scroll distance for expanded fixed buttons (px) | `Number` | `false` | `150` |
|
|
82
|
+
| showContextMenuTextFrom | Breakpoint to show context menu text | `String` | `false` | `'lg'` |
|
|
83
|
+
| iconVertical | Vertical icon orientation in context menu | `Boolean` | `false` | `false` |
|
|
84
|
+
|
|
85
|
+
### Button Item Structure
|
|
86
|
+
|
|
87
|
+
Each item in the `items` array can have these properties:
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
{
|
|
91
|
+
text: String, // Button text
|
|
92
|
+
icon: String, // Icon name
|
|
93
|
+
href: String, // Link URL
|
|
94
|
+
cta: Boolean, // Call-to-action (primary button, shows as fixed on mobile)
|
|
95
|
+
download: String, // File type for download ('pdf', 'csv', etc.)
|
|
96
|
+
tooltip: String, // Tooltip text
|
|
97
|
+
show: Boolean|Function, // Visibility (can be function receiving component instance)
|
|
98
|
+
listeners: Object, // Custom event listeners
|
|
99
|
+
// ... any other AwButton props
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Slots
|
|
104
|
+
|
|
105
|
+
This component does not have slots.
|
|
106
|
+
|
|
107
|
+
### Events
|
|
108
|
+
|
|
109
|
+
This component does not emit custom events.
|
|
110
|
+
|
|
111
|
+
### Injected Context
|
|
112
|
+
|
|
113
|
+
The component injects optional `teleportButtonsTo` from parent for teleport target.
|
|
114
|
+
|
|
115
|
+
## Responsive Behavior
|
|
116
|
+
|
|
117
|
+
### Desktop (breakpoint+)
|
|
118
|
+
|
|
119
|
+
- All buttons displayed as full `AwButton` components
|
|
120
|
+
- CTA buttons and regular buttons shown in expanded state
|
|
121
|
+
- Context menu shows non-CTA buttons in dropdown
|
|
122
|
+
|
|
123
|
+
### Mobile (< breakpoint)
|
|
124
|
+
|
|
125
|
+
- CTA buttons teleported as fixed floating buttons at bottom
|
|
126
|
+
- Non-CTA buttons only in context menu dropdown
|
|
127
|
+
- Fixed buttons collapse based on scroll position
|
|
128
|
+
|
|
129
|
+
## Download Handling
|
|
130
|
+
|
|
131
|
+
Buttons with `download` property automatically:
|
|
132
|
+
- Prevent default click behavior
|
|
133
|
+
- Show loading state during download
|
|
134
|
+
- Use `downloadFile` utility for file downloads
|
|
135
|
+
- Require `$axios` instance
|
|
136
|
+
|
|
137
|
+
Example:
|
|
138
|
+
```markup
|
|
139
|
+
{
|
|
140
|
+
text: 'Export',
|
|
141
|
+
download: 'xlsx',
|
|
142
|
+
href: '/api/export',
|
|
143
|
+
cta: true
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Scroll Behavior
|
|
148
|
+
|
|
149
|
+
Fixed buttons expand/collapse based on scroll position:
|
|
150
|
+
- `expandOffset > 0`: Buttons expand when scroll < offset
|
|
151
|
+
- `expandOffset === -1`: Buttons never expand (always collapsed)
|
|
152
|
+
- `expandOffset === 150` (default): Expand in top 150px
|
|
153
|
+
|
|
154
|
+
Button text visibility is controlled by scroll position on mobile.
|
|
155
|
+
|
|
156
|
+
## Related Components
|
|
157
|
+
|
|
158
|
+
- `AwPage` - Main page component
|
|
159
|
+
- `AwPageSingle` - Often used with page menu buttons
|
|
160
|
+
- `AwButton` - Button component used for rendering
|
|
161
|
+
- `AwContextMenu` - Dropdown menu for non-CTA buttons
|
|
162
|
+
|
|
163
|
+
## Notes
|
|
164
|
+
|
|
165
|
+
- **Import Method:** Dynamic - Component is loaded on-demand as page component
|
|
166
|
+
- Uses Teleport (vue2-teleport) for fixed buttons
|
|
167
|
+
- Fixed buttons set CSS variable `--page-fixed-buttons-height` on body
|
|
168
|
+
- CTA buttons transformed to icon buttons on mobile (size lg, theme solid)
|
|
169
|
+
- Context menu positioned at bottom-end with 8px offset
|
|
170
|
+
- Visibility functions receive component instance for conditional logic
|
|
171
|
+
- Download functionality requires axios integration
|
|
172
|
+
- Tooltip directive support for all buttons
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: PageModal component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwPageModal /> component renders a modal page overlay with multiple themes - UI Vue component for AwesCode UI.
|
|
6
|
+
title: PageModal
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwPageModal
|
|
10
|
+
|
|
11
|
+
**Category:** Page | **Import:** Dynamic
|
|
12
|
+
|
|
13
|
+
The `AwPageModal` component provides a modal/dialog page overlay with multiple display themes: default (centered modal), fullscreen, and aside (side panel). It includes header, content area, and optional button footer.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwPageModal` provides modal page display with:
|
|
18
|
+
- Three themes: default, fullscreen, aside
|
|
19
|
+
- Header with title, breadcrumb, and close button
|
|
20
|
+
- Scrollable content area
|
|
21
|
+
- Optional button footer
|
|
22
|
+
- Body scroll locking
|
|
23
|
+
- Click-outside-to-close support
|
|
24
|
+
- Back button integration
|
|
25
|
+
- Responsive design
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Basic Example
|
|
30
|
+
|
|
31
|
+
```markup
|
|
32
|
+
<AwPageModal title="Edit User">
|
|
33
|
+
<AwForm url="/api/users/1">
|
|
34
|
+
<AwInput name="name" label="Name" />
|
|
35
|
+
<AwInput name="email" label="Email" />
|
|
36
|
+
</AwForm>
|
|
37
|
+
</AwPageModal>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Fullscreen Theme
|
|
41
|
+
|
|
42
|
+
```markup
|
|
43
|
+
<AwPageModal
|
|
44
|
+
title="Document Editor"
|
|
45
|
+
theme="fullscreen"
|
|
46
|
+
container="small"
|
|
47
|
+
>
|
|
48
|
+
<AwMarkdownEditor v-model="content" />
|
|
49
|
+
</AwPageModal>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Aside Theme (Side Panel)
|
|
53
|
+
|
|
54
|
+
```markup
|
|
55
|
+
<AwPageModal
|
|
56
|
+
title="Filters"
|
|
57
|
+
theme="aside"
|
|
58
|
+
@close="$router.back()"
|
|
59
|
+
>
|
|
60
|
+
<AwForm>
|
|
61
|
+
<AwSelect name="category" label="Category" />
|
|
62
|
+
<AwSelect name="status" label="Status" />
|
|
63
|
+
</AwForm>
|
|
64
|
+
</AwPageModal>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### With Breadcrumb and Buttons
|
|
68
|
+
|
|
69
|
+
```markup
|
|
70
|
+
<AwPageModal
|
|
71
|
+
title="Order Details"
|
|
72
|
+
:breadcrumb="{ href: '/orders', title: 'Orders' }"
|
|
73
|
+
>
|
|
74
|
+
<template #default="{ closeModal }">
|
|
75
|
+
<OrderDetails :order="order" />
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<template #buttons>
|
|
79
|
+
<AwButton @click="saveOrder">Save</AwButton>
|
|
80
|
+
<AwButton color="mono" @click="$router.back()">Cancel</AwButton>
|
|
81
|
+
</template>
|
|
82
|
+
</AwPageModal>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## API
|
|
86
|
+
|
|
87
|
+
### Props
|
|
88
|
+
|
|
89
|
+
| Name | Description | Type | Required | Default |
|
|
90
|
+
|------|-------------|------|----------|---------|
|
|
91
|
+
| title | Modal title | `String` | `false` | `''` |
|
|
92
|
+
| breadcrumb | Breadcrumb object with href | `Object` | `false` | `null` |
|
|
93
|
+
| theme | Modal theme | `String` | `false` | `'default'` |
|
|
94
|
+
| container | Content container size (fullscreen only) | `String` | `false` | `null` |
|
|
95
|
+
|
|
96
|
+
**Theme Validator:** `'default'`, `'fullscreen'`, `'aside'`
|
|
97
|
+
|
|
98
|
+
**Container Options (fullscreen only):**
|
|
99
|
+
- `'small'` - Narrower content area
|
|
100
|
+
- `'full'` - Full-width content area
|
|
101
|
+
- `null` - Default width
|
|
102
|
+
|
|
103
|
+
**Breadcrumb Structure:**
|
|
104
|
+
```javascript
|
|
105
|
+
{
|
|
106
|
+
href: String, // Back link URL
|
|
107
|
+
title: String // Back button title (for aria-label)
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Also inherits all props from `AwPage` component.
|
|
112
|
+
|
|
113
|
+
### Slots
|
|
114
|
+
|
|
115
|
+
| Name | Description | Props | Default Slot Content |
|
|
116
|
+
|------|-------------|-------|---------------------|
|
|
117
|
+
| default | Modal content | `{ closeModal }` | - |
|
|
118
|
+
| headline-title | Custom title rendering | `{ title }` | Title text |
|
|
119
|
+
| headline-after-title | Content after title | - | - |
|
|
120
|
+
| buttons | Button footer area | - | - |
|
|
121
|
+
|
|
122
|
+
### Events
|
|
123
|
+
|
|
124
|
+
| Name | Payload | Description |
|
|
125
|
+
|------|---------|-------------|
|
|
126
|
+
| close | - | Emitted when modal should close |
|
|
127
|
+
|
|
128
|
+
**Note:** If no `close` listener is provided, the component automatically calls `$router.back()` on close.
|
|
129
|
+
|
|
130
|
+
## Themes
|
|
131
|
+
|
|
132
|
+
### Default Theme
|
|
133
|
+
|
|
134
|
+
Centered modal overlay with backdrop:
|
|
135
|
+
- Centered on screen
|
|
136
|
+
- Click backdrop to close
|
|
137
|
+
- Medium-sized dialog
|
|
138
|
+
- Suitable for forms and small content
|
|
139
|
+
|
|
140
|
+
### Fullscreen Theme
|
|
141
|
+
|
|
142
|
+
Full-screen modal:
|
|
143
|
+
- Covers entire viewport
|
|
144
|
+
- No backdrop
|
|
145
|
+
- Container size options
|
|
146
|
+
- Suitable for editors and large content
|
|
147
|
+
|
|
148
|
+
### Aside Theme
|
|
149
|
+
|
|
150
|
+
Side panel that slides in from right:
|
|
151
|
+
- Appears on right side
|
|
152
|
+
- Backdrop with click-to-close
|
|
153
|
+
- Narrower than default
|
|
154
|
+
- Suitable for filters and sidebars
|
|
155
|
+
|
|
156
|
+
## Close Behavior
|
|
157
|
+
|
|
158
|
+
The modal can be closed by:
|
|
159
|
+
1. Click close button (×) in header
|
|
160
|
+
2. Click breadcrumb back arrow
|
|
161
|
+
3. Click outside modal (backdrop) - only in default/aside themes
|
|
162
|
+
4. Custom close handler via `@close` event
|
|
163
|
+
|
|
164
|
+
If no `close` event handler is provided, `$router.back()` is called automatically.
|
|
165
|
+
|
|
166
|
+
## Body Scroll Lock
|
|
167
|
+
|
|
168
|
+
The component automatically:
|
|
169
|
+
- Disables body scrolling when mounted
|
|
170
|
+
- Re-enables body scrolling when destroyed
|
|
171
|
+
- Reserves scrollbar gap to prevent layout shift
|
|
172
|
+
|
|
173
|
+
## Accessibility
|
|
174
|
+
|
|
175
|
+
- `role="dialog"` on modal container
|
|
176
|
+
- `role="document"` on dialog content
|
|
177
|
+
- Close button has `aria-label` and `title`
|
|
178
|
+
- Breadcrumb link has `aria-label`
|
|
179
|
+
- Tabindex management for focus
|
|
180
|
+
|
|
181
|
+
## Related Components
|
|
182
|
+
|
|
183
|
+
- `AwPage` - Base page component
|
|
184
|
+
- `AwModal` - Standard modal component
|
|
185
|
+
- `AwPageSingle` - Single page layout
|
|
186
|
+
|
|
187
|
+
## Notes
|
|
188
|
+
|
|
189
|
+
- **Import Method:** Dynamic - Component is loaded on-demand as page component
|
|
190
|
+
- Uses body-scroll-lock library to prevent background scrolling
|
|
191
|
+
- Inherits props from AwPage component (title, breadcrumb, container)
|
|
192
|
+
- Container prop only affects fullscreen theme
|
|
193
|
+
- Default theme shows centered modal dialog
|
|
194
|
+
- Aside theme slides in from right side
|
|
195
|
+
- Fullscreen theme uses AwIconSystemMono for icons
|
|
196
|
+
- Close button always visible in top-right
|
|
197
|
+
- Breadcrumb back arrow only shows if breadcrumb.href is provided
|
|
198
|
+
- Button footer (buttons slot) adds padding to content area
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: PageSingle component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwPageSingle /> component renders a single entity page with header, content, and optional preview panel - UI Vue component for AwesCode UI.
|
|
6
|
+
title: PageSingle
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwPageSingle
|
|
10
|
+
|
|
11
|
+
**Category:** Page | **Import:** Dynamic
|
|
12
|
+
|
|
13
|
+
The `AwPageSingle` component provides a page layout for displaying single entities (user profile, document view, product details, etc.) with a sticky header, content area, optional preview panel, and action button support.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwPageSingle` provides single-entity page layout with:
|
|
18
|
+
- Sticky page header with breadcrumb
|
|
19
|
+
- Title and description display
|
|
20
|
+
- Content area with optional preview panel
|
|
21
|
+
- Mobile/desktop responsive layouts
|
|
22
|
+
- Fixed action button on mobile
|
|
23
|
+
- Progress indicator support
|
|
24
|
+
- Scroll-based sticky behavior
|
|
25
|
+
- Container size options
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
**⚠️ Essential: Always use `layout: 'empty'`**
|
|
30
|
+
|
|
31
|
+
Every page using `AwPageSingle` must include `layout: 'empty'` in the component export:
|
|
32
|
+
|
|
33
|
+
```javascript
|
|
34
|
+
export default {
|
|
35
|
+
layout: 'empty', // Required for AwPageSingle pages
|
|
36
|
+
// ... rest of component
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Basic Example
|
|
41
|
+
|
|
42
|
+
```markup
|
|
43
|
+
<template>
|
|
44
|
+
<AwPageSingle title="John Doe" description="User Profile">
|
|
45
|
+
<AwCard>
|
|
46
|
+
<h3>Personal Information</h3>
|
|
47
|
+
<!-- user details -->
|
|
48
|
+
</AwCard>
|
|
49
|
+
</AwPageSingle>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
export default {
|
|
54
|
+
layout: 'empty'
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### With Preview Panel
|
|
60
|
+
|
|
61
|
+
```markup
|
|
62
|
+
<AwPageSingle
|
|
63
|
+
title="Invoice #12345"
|
|
64
|
+
description="Draft invoice"
|
|
65
|
+
:breadcrumb="{ href: '/invoices', title: 'Invoices' }"
|
|
66
|
+
>
|
|
67
|
+
<!-- Main content -->
|
|
68
|
+
<AwForm url="/api/invoices/12345">
|
|
69
|
+
<AwInput name="customer" label="Customer" />
|
|
70
|
+
<AwInput name="amount" label="Amount" />
|
|
71
|
+
</AwForm>
|
|
72
|
+
|
|
73
|
+
<!-- Preview panel -->
|
|
74
|
+
<template #preview>
|
|
75
|
+
<InvoicePreview :invoice="invoice" />
|
|
76
|
+
</template>
|
|
77
|
+
</AwPageSingle>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### With Action Button
|
|
81
|
+
|
|
82
|
+
```markup
|
|
83
|
+
<AwPageSingle
|
|
84
|
+
title="Document"
|
|
85
|
+
:action="{ text: 'Save', icon: 'awesio/check', color: 'accent' }"
|
|
86
|
+
@action="saveDocument"
|
|
87
|
+
>
|
|
88
|
+
<AwMarkdownEditor v-model="content" />
|
|
89
|
+
</AwPageSingle>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### With Custom Container
|
|
93
|
+
|
|
94
|
+
```markup
|
|
95
|
+
<AwPageSingle
|
|
96
|
+
title="Wide Content"
|
|
97
|
+
container="full"
|
|
98
|
+
>
|
|
99
|
+
<AwTable :data="items" />
|
|
100
|
+
</AwPageSingle>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## API
|
|
104
|
+
|
|
105
|
+
### Props
|
|
106
|
+
|
|
107
|
+
| Name | Description | Type | Required | Default |
|
|
108
|
+
|------|-------------|------|----------|---------|
|
|
109
|
+
| title | Page title | `String` | `false` | `''` |
|
|
110
|
+
| description | Description text (mobile only) | `String` | `false` | `''` |
|
|
111
|
+
| headerDescription | Description in header (desktop) | `String` | `false` | `''` |
|
|
112
|
+
| breadcrumb | Breadcrumb configuration | `Object` | `false` | `null` |
|
|
113
|
+
| headerProgress | Progress value (0-100) | `Number` | `false` | `null` |
|
|
114
|
+
| action | Action button configuration | `Object` | `false` | `null` |
|
|
115
|
+
| container | Container size type | `String` | `false` | `null` |
|
|
116
|
+
| desktopFrom | Breakpoint for desktop layout | `String` | `false` | `'lg'` |
|
|
117
|
+
| reverse | Reverse content/preview order | `Boolean` | `false` | `false` |
|
|
118
|
+
| hideMenu | Hide page menu | `Boolean` | `false` | `false` |
|
|
119
|
+
|
|
120
|
+
**Breadcrumb Structure:**
|
|
121
|
+
```javascript
|
|
122
|
+
{
|
|
123
|
+
href: String, // Back link URL (optional, defaults to $router.back())
|
|
124
|
+
title: String // Back button aria-label
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Action Button Structure:**
|
|
129
|
+
```javascript
|
|
130
|
+
{
|
|
131
|
+
text: String, // Button text
|
|
132
|
+
icon: String, // Icon name
|
|
133
|
+
color: String, // Button color
|
|
134
|
+
before: Boolean, // Show before menu on desktop
|
|
135
|
+
// ... any other AwButton props
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Container Options:**
|
|
140
|
+
- `'default'` - Standard container with max-width
|
|
141
|
+
- `'full'` - Full-width fluid container
|
|
142
|
+
- `null` - Custom preview-based layout
|
|
143
|
+
|
|
144
|
+
### Slots
|
|
145
|
+
|
|
146
|
+
| Name | Description | Props | Default Slot Content |
|
|
147
|
+
|------|-------------|-------|---------------------|
|
|
148
|
+
| default | Main content area | - | - |
|
|
149
|
+
| preview | Preview panel (right side on desktop) | - | - |
|
|
150
|
+
| breadcrumb | Custom breadcrumb content | - | Back button |
|
|
151
|
+
| after-breadcrumb | Content after breadcrumb | - | - |
|
|
152
|
+
| buttons | Additional buttons in header | - | - |
|
|
153
|
+
| after-menu | Content after page menu | - | - |
|
|
154
|
+
|
|
155
|
+
### Events
|
|
156
|
+
|
|
157
|
+
| Name | Payload | Description |
|
|
158
|
+
|------|---------|-------------|
|
|
159
|
+
| action | - | Emitted when action button is clicked |
|
|
160
|
+
|
|
161
|
+
## Layout Behavior
|
|
162
|
+
|
|
163
|
+
### Desktop (lg+)
|
|
164
|
+
|
|
165
|
+
- Sticky header with title and action button
|
|
166
|
+
- Content and preview side-by-side (if preview slot used)
|
|
167
|
+
- Action button in header (position based on `action.before`)
|
|
168
|
+
- Description shown in header if `headerDescription` provided
|
|
169
|
+
|
|
170
|
+
### Mobile
|
|
171
|
+
|
|
172
|
+
- Title in header when scrolled (hidden at top)
|
|
173
|
+
- Content and preview stacked vertically
|
|
174
|
+
- Fixed floating action button at bottom
|
|
175
|
+
- Description shown below header if `description` provided
|
|
176
|
+
- Action button sticky at bottom
|
|
177
|
+
|
|
178
|
+
## Container Types
|
|
179
|
+
|
|
180
|
+
### Default Container
|
|
181
|
+
|
|
182
|
+
Standard centered container with max-width:
|
|
183
|
+
```markup
|
|
184
|
+
<AwPageSingle container="default">
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Full Container
|
|
188
|
+
|
|
189
|
+
Full-width fluid container:
|
|
190
|
+
```markup
|
|
191
|
+
<AwPageSingle container="full">
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Preview Container (null)
|
|
195
|
+
|
|
196
|
+
Custom two-column layout with preview:
|
|
197
|
+
```markup
|
|
198
|
+
<AwPageSingle :container="null">
|
|
199
|
+
<div>Content</div>
|
|
200
|
+
<template #preview>Preview</template>
|
|
201
|
+
</AwPageSingle>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Scroll Behavior
|
|
205
|
+
|
|
206
|
+
The component uses IntersectionObserver to track:
|
|
207
|
+
- Header sticky state (when scrolled past top)
|
|
208
|
+
- Action button sticky state on mobile
|
|
209
|
+
|
|
210
|
+
Scroll marks are placed at top and bottom of content to detect visibility.
|
|
211
|
+
|
|
212
|
+
## Reverse Layout
|
|
213
|
+
|
|
214
|
+
Use `reverse` prop to swap content/preview order:
|
|
215
|
+
```markup
|
|
216
|
+
<AwPageSingle reverse>
|
|
217
|
+
<div>Main content</div>
|
|
218
|
+
<template #preview>Preview (shows on left)</template>
|
|
219
|
+
</AwPageSingle>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Header Progress
|
|
223
|
+
|
|
224
|
+
Show progress indicator in header:
|
|
225
|
+
```markup
|
|
226
|
+
<AwPageSingle
|
|
227
|
+
title="Document"
|
|
228
|
+
:header-progress="75"
|
|
229
|
+
>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Progress bar appears in header, useful for multi-step forms or loading states.
|
|
233
|
+
|
|
234
|
+
## Related Components
|
|
235
|
+
|
|
236
|
+
- `AwPage` - Standard page component
|
|
237
|
+
- `AwPageHeader` - Page header component (used internally)
|
|
238
|
+
- `AwPageModal` - Modal page component
|
|
239
|
+
- `AwPageMenuButtons` - Page menu buttons
|
|
240
|
+
|
|
241
|
+
## Notes
|
|
242
|
+
|
|
243
|
+
- **Import Method:** Dynamic - Component is loaded on-demand as page component
|
|
244
|
+
- Uses `pageMixin` for common page functionality
|
|
245
|
+
- Sets body class `aw-page-single-noty` for notification positioning
|
|
246
|
+
- Automatically handles responsive breakpoints
|
|
247
|
+
- Preview panel only shows if preview slot is used
|
|
248
|
+
- Action button placement differs between mobile/desktop
|
|
249
|
+
- Back button uses `$router.back()` if no breadcrumb.href provided
|
|
250
|
+
- IntersectionObserver for scroll detection
|
|
251
|
+
- Supports Nuxt head() for body attributes
|
|
252
|
+
- Header stickiness based on scroll position
|
|
253
|
+
- Mobile action button animates based on bottom visibility
|