@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,506 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Island component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwIsland /> component provides a card-based container with icon, title, description, and collapsible content - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Island
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwIsland
|
|
10
|
+
|
|
11
|
+
**Category:** Molecule | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwIsland` component is an enhanced card component that displays content with an icon, title, description, and optional collapsible content section. It's designed for feature showcases, settings panels, and informational blocks.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwIsland` provides an island-style card with:
|
|
18
|
+
- Icon with customizable color
|
|
19
|
+
- Title and description
|
|
20
|
+
- Collapsible/expandable content
|
|
21
|
+
- Options slot for action buttons
|
|
22
|
+
- Footer section
|
|
23
|
+
- Custom arrow icon
|
|
24
|
+
- Can be used as a link
|
|
25
|
+
- Responsive design
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Basic Example
|
|
30
|
+
|
|
31
|
+
```markup
|
|
32
|
+
<AwIsland
|
|
33
|
+
title="Feature Title"
|
|
34
|
+
description="This is a description of the feature"
|
|
35
|
+
icon="awesio/settings"
|
|
36
|
+
icon-color="accent"
|
|
37
|
+
>
|
|
38
|
+
<p>Content goes here</p>
|
|
39
|
+
</AwIsland>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Collapsible Content
|
|
43
|
+
|
|
44
|
+
```markup
|
|
45
|
+
<AwIsland
|
|
46
|
+
title="Collapsible Section"
|
|
47
|
+
description="Click to expand"
|
|
48
|
+
icon="awesio/info-circle"
|
|
49
|
+
>
|
|
50
|
+
<div>
|
|
51
|
+
<p>This content can be collapsed and expanded.</p>
|
|
52
|
+
<p>Add any content here.</p>
|
|
53
|
+
</div>
|
|
54
|
+
</AwIsland>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Always Expanded
|
|
58
|
+
|
|
59
|
+
```markup
|
|
60
|
+
<AwIsland
|
|
61
|
+
title="Always Open"
|
|
62
|
+
description="This section is always visible"
|
|
63
|
+
icon="awesio/check"
|
|
64
|
+
expanded
|
|
65
|
+
>
|
|
66
|
+
<p>Content is always visible.</p>
|
|
67
|
+
</AwIsland>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### As Link
|
|
71
|
+
|
|
72
|
+
```markup
|
|
73
|
+
<AwIsland
|
|
74
|
+
title="Clickable Island"
|
|
75
|
+
description="Click anywhere to navigate"
|
|
76
|
+
icon="awesio/arrow-r"
|
|
77
|
+
tag="AwLink"
|
|
78
|
+
href="/settings"
|
|
79
|
+
/>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### With Options
|
|
83
|
+
|
|
84
|
+
```markup
|
|
85
|
+
<AwIsland
|
|
86
|
+
title="With Actions"
|
|
87
|
+
description="Section with action buttons"
|
|
88
|
+
icon="awesio/settings"
|
|
89
|
+
expanded
|
|
90
|
+
>
|
|
91
|
+
<template #options>
|
|
92
|
+
<AwButton size="sm" icon="awesio/edit" theme="icon" />
|
|
93
|
+
<AwButton size="sm" icon="awesio/delete" theme="icon" />
|
|
94
|
+
</template>
|
|
95
|
+
|
|
96
|
+
<p>Content with actions</p>
|
|
97
|
+
</AwIsland>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Note:** The options slot is usually used with the `expanded` prop to keep the content visible while providing action buttons.
|
|
101
|
+
|
|
102
|
+
### With Custom Icon
|
|
103
|
+
|
|
104
|
+
You can use the `icon` slot to replace the default icon with custom content, such as images or avatar components.
|
|
105
|
+
|
|
106
|
+
**Using Custom Image:**
|
|
107
|
+
|
|
108
|
+
```markup
|
|
109
|
+
<AwIsland title="Custom Icon" description="Using slot for custom icon">
|
|
110
|
+
<template #icon>
|
|
111
|
+
<img src="/custom-icon.svg" class="w-6 h-6" />
|
|
112
|
+
</template>
|
|
113
|
+
|
|
114
|
+
<p>Content</p>
|
|
115
|
+
</AwIsland>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Using AwAvatar Component:**
|
|
119
|
+
|
|
120
|
+
```markup
|
|
121
|
+
<AwIsland
|
|
122
|
+
title="Personal Information"
|
|
123
|
+
description="Your personal details"
|
|
124
|
+
:model="personalModel"
|
|
125
|
+
>
|
|
126
|
+
<template #icon>
|
|
127
|
+
<AwAvatar
|
|
128
|
+
:src="personalModel.$.avatar"
|
|
129
|
+
:name="personalModel.$.name"
|
|
130
|
+
:size="42"
|
|
131
|
+
/>
|
|
132
|
+
</template>
|
|
133
|
+
|
|
134
|
+
<AwGrid>
|
|
135
|
+
<AwInput v-model="personalModel.name" label="Name" />
|
|
136
|
+
<AwInput v-model="personalModel.email" label="Email" />
|
|
137
|
+
</AwGrid>
|
|
138
|
+
</AwIsland>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
This pattern is commonly used for user profile sections where an avatar provides better visual representation than an icon.
|
|
142
|
+
|
|
143
|
+
### With Footer
|
|
144
|
+
|
|
145
|
+
```markup
|
|
146
|
+
<AwIsland
|
|
147
|
+
title="With Footer"
|
|
148
|
+
description="Island with footer section"
|
|
149
|
+
icon="awesio/check"
|
|
150
|
+
>
|
|
151
|
+
<p>Main content</p>
|
|
152
|
+
|
|
153
|
+
<template #footer>
|
|
154
|
+
<AwButton>Save Changes</AwButton>
|
|
155
|
+
</template>
|
|
156
|
+
</AwIsland>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## API
|
|
160
|
+
|
|
161
|
+
### Props
|
|
162
|
+
|
|
163
|
+
| Name | Description | Type | Required | Default |
|
|
164
|
+
|------|-------------|------|----------|---------|
|
|
165
|
+
| title | Island title | `String` | `false` | `''` |
|
|
166
|
+
| titleTag | HTML tag for title | `String` | `false` | `'h2'` |
|
|
167
|
+
| description | Description text below title | `String` | `false` | `''` |
|
|
168
|
+
| icon | Icon name - see [Built-in Icons](/reference/icons) | `String` | `false` | `''` |
|
|
169
|
+
| iconColor | Icon color (CSS custom property name) | `String` | `false` | `'mono-400'` |
|
|
170
|
+
| expanded | Always show content (not collapsible) | `Boolean` | `false` | `false` |
|
|
171
|
+
| show | Initial collapsed state | `Boolean` | `false` | `false` |
|
|
172
|
+
| showArrow | Force show arrow icon | `Boolean` | `false` | `false` |
|
|
173
|
+
| tag | Root element tag (use 'AwLink' for links) | `String` | `false` | `'section'` |
|
|
174
|
+
| model | vue-mc Model instance for save/reset functionality | `Object` | `false` | `null` |
|
|
175
|
+
| disabled | Disable island interactions | `Boolean` | `false` | `false` |
|
|
176
|
+
|
|
177
|
+
All AwCard props are also supported (inherited).
|
|
178
|
+
|
|
179
|
+
**Model Object Requirements:**
|
|
180
|
+
|
|
181
|
+
When providing a `model` prop, the object must implement:
|
|
182
|
+
- `changed()` - Method that returns `true` if model has unsaved changes
|
|
183
|
+
- `save()` - Method that returns a Promise to save changes
|
|
184
|
+
- `reset()` - Method to reset changes to original values
|
|
185
|
+
|
|
186
|
+
### Slots
|
|
187
|
+
|
|
188
|
+
| Name | Description | Props | Default Slot Content |
|
|
189
|
+
|------|-------------|-------|---------------------|
|
|
190
|
+
| default | Main content | `{ isOpened, toggle }` | - |
|
|
191
|
+
| icon | Custom icon | - | AwIcon with icon prop |
|
|
192
|
+
| title | Custom title | `{ titleTag, isOpened, toggle }` | Title text |
|
|
193
|
+
| after-title | Content after title | - | - |
|
|
194
|
+
| description | Custom description | `{ isOpened, toggle }` | AwDescription with description prop |
|
|
195
|
+
| options | Action buttons before arrow | `{ isOpened, toggle }` | - |
|
|
196
|
+
| arrow | Custom arrow icon | `{ isOpened, toggle }` | AwIconSystemMono angle |
|
|
197
|
+
| separator | Content between header and body | `{ isOpened, toggle }` | - |
|
|
198
|
+
| footer | Footer section | `{ isOpened, toggle }` | - |
|
|
199
|
+
|
|
200
|
+
### Events
|
|
201
|
+
|
|
202
|
+
Inherits all events from AwCard.
|
|
203
|
+
|
|
204
|
+
### Methods
|
|
205
|
+
|
|
206
|
+
| Name | Parameters | Description |
|
|
207
|
+
|------|------------|-------------|
|
|
208
|
+
| toggle | - | Toggle collapsed/expanded state |
|
|
209
|
+
|
|
210
|
+
## Behavior
|
|
211
|
+
|
|
212
|
+
### Collapsible Mode (default)
|
|
213
|
+
|
|
214
|
+
When content slot is present and `expanded` is false:
|
|
215
|
+
- Arrow icon shows collapse/expand state
|
|
216
|
+
- Click header to toggle content
|
|
217
|
+
- Content animated with AwAccordionFold
|
|
218
|
+
- isOpened state tracked internally
|
|
219
|
+
|
|
220
|
+
### Expanded Mode
|
|
221
|
+
|
|
222
|
+
When `expanded` prop is true:
|
|
223
|
+
- Content always visible
|
|
224
|
+
- No collapse animation
|
|
225
|
+
- Arrow icon rotates 180° (pointing down)
|
|
226
|
+
- Header not clickable for toggle
|
|
227
|
+
|
|
228
|
+
**Common Pattern with Options Slot:**
|
|
229
|
+
|
|
230
|
+
The `expanded` prop is commonly used together with the `options` slot to create always-visible panels with action buttons:
|
|
231
|
+
|
|
232
|
+
```markup
|
|
233
|
+
<AwIsland
|
|
234
|
+
title="User Settings"
|
|
235
|
+
description="Manage your preferences"
|
|
236
|
+
icon="awesio/settings"
|
|
237
|
+
expanded
|
|
238
|
+
>
|
|
239
|
+
<template #options>
|
|
240
|
+
<AwButton size="sm" icon="awesio/edit" theme="icon" />
|
|
241
|
+
<AwButton size="sm" icon="awesio/delete" theme="icon" />
|
|
242
|
+
</template>
|
|
243
|
+
|
|
244
|
+
<p>Settings content here</p>
|
|
245
|
+
</AwIsland>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
This pattern ensures the content remains visible while users interact with the action buttons, avoiding the need to expand/collapse to access both content and actions.
|
|
249
|
+
|
|
250
|
+
### Link Mode
|
|
251
|
+
|
|
252
|
+
When `tag="AwLink"`:
|
|
253
|
+
- Entire island becomes clickable link
|
|
254
|
+
- Inherits all AwLink props (href, to, etc.)
|
|
255
|
+
- Card reset styling applied
|
|
256
|
+
|
|
257
|
+
## Model Integration
|
|
258
|
+
|
|
259
|
+
### Using with vue-mc Models
|
|
260
|
+
|
|
261
|
+
`AwIsland` integrates with vue-mc models to provide automatic save/reset functionality in the footer. When a model is provided and has unsaved changes, the footer automatically displays Save and Reset buttons.
|
|
262
|
+
|
|
263
|
+
```javascript
|
|
264
|
+
import { BaseModel } from '@awes-io/vue-mc'
|
|
265
|
+
|
|
266
|
+
class SettingsModel extends BaseModel {
|
|
267
|
+
defaults() {
|
|
268
|
+
return {
|
|
269
|
+
notifications: true,
|
|
270
|
+
darkMode: false
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
routes() {
|
|
275
|
+
return {
|
|
276
|
+
save: '/api/settings'
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export default {
|
|
282
|
+
data() {
|
|
283
|
+
return {
|
|
284
|
+
settingsModel: new SettingsModel()
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
```markup
|
|
291
|
+
<AwIsland
|
|
292
|
+
title="Settings"
|
|
293
|
+
description="Configure your preferences"
|
|
294
|
+
icon="awesio/settings"
|
|
295
|
+
:model="settingsModel"
|
|
296
|
+
>
|
|
297
|
+
<AwGrid>
|
|
298
|
+
<AwCheckbox v-model="settingsModel.notifications" label="Enable notifications" />
|
|
299
|
+
<AwCheckbox v-model="settingsModel.darkMode" label="Dark mode" />
|
|
300
|
+
</AwGrid>
|
|
301
|
+
</AwIsland>
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Automatic Behavior:**
|
|
305
|
+
|
|
306
|
+
- **No Changes**: Footer shows only "Close" button
|
|
307
|
+
- **Has Changes**: Footer shows "Reset" and "Save" buttons
|
|
308
|
+
- **Saving**: Save button disabled during save operation
|
|
309
|
+
- **Success**: Shows success notification and closes island
|
|
310
|
+
- **Error**: Shows error notification and keeps island open
|
|
311
|
+
|
|
312
|
+
### Custom Footer with Model
|
|
313
|
+
|
|
314
|
+
You can override the default footer buttons while still using model integration:
|
|
315
|
+
|
|
316
|
+
```markup
|
|
317
|
+
<AwIsland
|
|
318
|
+
title="Settings"
|
|
319
|
+
:model="settingsModel"
|
|
320
|
+
>
|
|
321
|
+
<AwCheckbox v-model="settingsModel.notifications" label="Notifications" />
|
|
322
|
+
|
|
323
|
+
<template #buttons>
|
|
324
|
+
<AwButton
|
|
325
|
+
v-if="settingsModel.changed()"
|
|
326
|
+
@click="settingsModel.reset()"
|
|
327
|
+
color="mono"
|
|
328
|
+
>
|
|
329
|
+
Cancel
|
|
330
|
+
</AwButton>
|
|
331
|
+
<AwButton
|
|
332
|
+
v-if="settingsModel.changed()"
|
|
333
|
+
@click="customSave"
|
|
334
|
+
:disabled="settingsModel.saving"
|
|
335
|
+
>
|
|
336
|
+
Apply Changes
|
|
337
|
+
</AwButton>
|
|
338
|
+
</template>
|
|
339
|
+
</AwIsland>
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## AwIslandBuilder
|
|
343
|
+
|
|
344
|
+
### Overview
|
|
345
|
+
|
|
346
|
+
`AwIslandBuilder` is a wrapper component that manages multiple `AwIsland` components with accordion behavior. Only one island can be open at a time, and it provides unsaved changes protection when switching between islands.
|
|
347
|
+
|
|
348
|
+
### Basic Usage
|
|
349
|
+
|
|
350
|
+
```markup
|
|
351
|
+
<AwIslandBuilder>
|
|
352
|
+
<AwIsland
|
|
353
|
+
title="Personal Information"
|
|
354
|
+
description="Your personal details"
|
|
355
|
+
icon="awesio/user"
|
|
356
|
+
:model="personalModel"
|
|
357
|
+
>
|
|
358
|
+
<AwInput v-model="personalModel.name" label="Name" />
|
|
359
|
+
<AwInput v-model="personalModel.email" label="Email" />
|
|
360
|
+
</AwIsland>
|
|
361
|
+
|
|
362
|
+
<AwIsland
|
|
363
|
+
title="Account Settings"
|
|
364
|
+
description="Manage your preferences"
|
|
365
|
+
icon="awesio/settings"
|
|
366
|
+
:model="accountModel"
|
|
367
|
+
>
|
|
368
|
+
<AwCheckbox v-model="accountModel.notifications" label="Email notifications" />
|
|
369
|
+
<AwCheckbox v-model="accountModel.twoFactor" label="Two-factor authentication" />
|
|
370
|
+
</AwIsland>
|
|
371
|
+
|
|
372
|
+
<AwIsland
|
|
373
|
+
title="Privacy"
|
|
374
|
+
description="Control your privacy"
|
|
375
|
+
icon="awesio/lock"
|
|
376
|
+
:model="privacyModel"
|
|
377
|
+
>
|
|
378
|
+
<AwCheckbox v-model="privacyModel.publicProfile" label="Public profile" />
|
|
379
|
+
<AwCheckbox v-model="privacyModel.showEmail" label="Show email" />
|
|
380
|
+
</AwIsland>
|
|
381
|
+
</AwIslandBuilder>
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### AwIslandBuilder Props
|
|
385
|
+
|
|
386
|
+
| Name | Description | Type | Required | Default |
|
|
387
|
+
|------|-------------|------|----------|---------|
|
|
388
|
+
| confirmText | Confirmation message for unsaved changes | `String` | `false` | `'There is unsaved data...'` |
|
|
389
|
+
|
|
390
|
+
All `AwGrid` props are also supported (inherited).
|
|
391
|
+
|
|
392
|
+
### Accordion Behavior
|
|
393
|
+
|
|
394
|
+
**Single Open Island:**
|
|
395
|
+
- Only one island can be expanded at a time
|
|
396
|
+
- Clicking an island header collapses the currently open island
|
|
397
|
+
- Click the same header again to collapse it
|
|
398
|
+
|
|
399
|
+
**Unsaved Changes Protection:**
|
|
400
|
+
|
|
401
|
+
When switching islands with unsaved changes:
|
|
402
|
+
1. Confirmation dialog appears
|
|
403
|
+
2. User can confirm (discards changes) or cancel (stays on current island)
|
|
404
|
+
3. If confirmed, model is reset and new island opens
|
|
405
|
+
|
|
406
|
+
**Route Navigation Protection:**
|
|
407
|
+
|
|
408
|
+
Automatically prevents navigation with unsaved changes:
|
|
409
|
+
- Intercepts router navigation
|
|
410
|
+
- Shows confirmation dialog
|
|
411
|
+
- Resets model if user confirms
|
|
412
|
+
- Cancels navigation if user declines
|
|
413
|
+
|
|
414
|
+
**Window Close Protection:**
|
|
415
|
+
|
|
416
|
+
Prevents accidental window close with unsaved changes:
|
|
417
|
+
- Browser shows native "Leave site?" dialog
|
|
418
|
+
- Uses `confirmText` prop as message (where supported)
|
|
419
|
+
|
|
420
|
+
### Use Cases
|
|
421
|
+
|
|
422
|
+
**Settings Pages:**
|
|
423
|
+
Perfect for grouped settings with separate save contexts:
|
|
424
|
+
|
|
425
|
+
```markup
|
|
426
|
+
<AwIslandBuilder>
|
|
427
|
+
<AwIsland title="Profile" :model="profileModel">...</AwIsland>
|
|
428
|
+
<AwIsland title="Security" :model="securityModel">...</AwIsland>
|
|
429
|
+
<AwIsland title="Notifications" :model="notificationsModel">...</AwIsland>
|
|
430
|
+
</AwIslandBuilder>
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**Wizard Steps:**
|
|
434
|
+
Multi-step forms with independent save operations:
|
|
435
|
+
|
|
436
|
+
```markup
|
|
437
|
+
<AwIslandBuilder>
|
|
438
|
+
<AwIsland title="Step 1: Basic Info" :model="step1Model">...</AwIsland>
|
|
439
|
+
<AwIsland title="Step 2: Details" :model="step2Model">...</AwIsland>
|
|
440
|
+
<AwIsland title="Step 3: Review" :model="step3Model">...</AwIsland>
|
|
441
|
+
</AwIslandBuilder>
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
**Expandable Sections:**
|
|
445
|
+
Read-only information sections (without models):
|
|
446
|
+
|
|
447
|
+
```markup
|
|
448
|
+
<AwIslandBuilder>
|
|
449
|
+
<AwIsland title="Documentation">
|
|
450
|
+
<p>Documentation content...</p>
|
|
451
|
+
</AwIsland>
|
|
452
|
+
<AwIsland title="Examples">
|
|
453
|
+
<p>Example code...</p>
|
|
454
|
+
</AwIsland>
|
|
455
|
+
</AwIslandBuilder>
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
## Icon Colors
|
|
459
|
+
|
|
460
|
+
Use CSS custom property names for icon colors:
|
|
461
|
+
|
|
462
|
+
```markup
|
|
463
|
+
<AwIsland
|
|
464
|
+
icon="awesio/info-circle"
|
|
465
|
+
icon-color="accent"
|
|
466
|
+
/>
|
|
467
|
+
|
|
468
|
+
<AwIsland
|
|
469
|
+
icon="awesio/warning"
|
|
470
|
+
icon-color="error"
|
|
471
|
+
/>
|
|
472
|
+
|
|
473
|
+
<AwIsland
|
|
474
|
+
icon="awesio/check"
|
|
475
|
+
icon-color="success"
|
|
476
|
+
/>
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
## Related Components
|
|
480
|
+
|
|
481
|
+
- `AwIslandBuilder` - Accordion wrapper for multiple islands
|
|
482
|
+
- `AwCard` - Base card component
|
|
483
|
+
- `AwAccordionFold` - Collapse animation (used internally)
|
|
484
|
+
- `AwIcon` - Icon component
|
|
485
|
+
- `AwIconSystemMono` - System icons
|
|
486
|
+
- `AwAvatar` - Avatar component (can be used in icon slot)
|
|
487
|
+
- `AwIslandAvatar` - Island variant with avatar
|
|
488
|
+
- [vue-mc Models](/vue-mc/models) - Model integration documentation
|
|
489
|
+
|
|
490
|
+
## Notes
|
|
491
|
+
|
|
492
|
+
- **Import Method:** Global - Available as molecule component
|
|
493
|
+
- Extends AwCard component
|
|
494
|
+
- Uses AwAccordionFold for collapse animation
|
|
495
|
+
- Arrow icon automatically appears when content slot is used
|
|
496
|
+
- Click anywhere in header to toggle (when collapsible)
|
|
497
|
+
- Icon color uses CSS custom properties (--c-{color})
|
|
498
|
+
- Content toggle only works when `expanded` is false
|
|
499
|
+
- Title slot provides titleTag for custom heading levels
|
|
500
|
+
- Icon slot can be used with AwAvatar for user profile sections
|
|
501
|
+
- Options slot appears before arrow icon
|
|
502
|
+
- Footer only visible when footer slot is used
|
|
503
|
+
- Model prop enables automatic save/reset functionality
|
|
504
|
+
- Works seamlessly with vue-mc BaseModel instances
|
|
505
|
+
- AwIslandBuilder provides accordion behavior for multiple islands
|
|
506
|
+
- Builder automatically handles unsaved changes protection
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Number component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwNumber /> component is used to render Number input - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Number
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AwNumber
|
|
10
|
+
|
|
11
|
+
**Category:** Molecule | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwNumber` component is a numeric input field with increment/decrement buttons, min/max validation, and step control. It extends `AwInput` with specialized number handling.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwNumber` provides a comprehensive number input solution with:
|
|
18
|
+
- Increment/decrement buttons (can be hidden)
|
|
19
|
+
- Min/max value constraints
|
|
20
|
+
- Step control for value changes
|
|
21
|
+
- Integer-only mode
|
|
22
|
+
- Automatic value clamping on blur
|
|
23
|
+
- Paste validation
|
|
24
|
+
- Keyboard input filtering
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### Basic Example
|
|
29
|
+
|
|
30
|
+
```markup
|
|
31
|
+
<AwNumber v-model="quantity" />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### With Min and Max
|
|
35
|
+
|
|
36
|
+
```markup
|
|
37
|
+
<AwNumber
|
|
38
|
+
v-model="age"
|
|
39
|
+
:min="0"
|
|
40
|
+
:max="120"
|
|
41
|
+
label="Age"
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### With Step
|
|
46
|
+
|
|
47
|
+
```markup
|
|
48
|
+
<AwNumber
|
|
49
|
+
v-model="price"
|
|
50
|
+
:step="0.1"
|
|
51
|
+
:min="0"
|
|
52
|
+
label="Price"
|
|
53
|
+
/>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Integer Only
|
|
57
|
+
|
|
58
|
+
```markup
|
|
59
|
+
<AwNumber
|
|
60
|
+
v-model="count"
|
|
61
|
+
integer
|
|
62
|
+
:min="0"
|
|
63
|
+
label="Count"
|
|
64
|
+
/>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Without Buttons
|
|
68
|
+
|
|
69
|
+
```markup
|
|
70
|
+
<AwNumber
|
|
71
|
+
v-model="value"
|
|
72
|
+
hide-buttons
|
|
73
|
+
label="Number"
|
|
74
|
+
/>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Custom Postfix Slot
|
|
78
|
+
|
|
79
|
+
```markup
|
|
80
|
+
<AwNumber v-model="value" label="Custom">
|
|
81
|
+
<template #postfix>
|
|
82
|
+
<span class="px-4">units</span>
|
|
83
|
+
</template>
|
|
84
|
+
</AwNumber>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## API
|
|
88
|
+
|
|
89
|
+
### Props
|
|
90
|
+
|
|
91
|
+
| Name | Description | Type | Required | Default |
|
|
92
|
+
|------|-------------|------|----------|---------|
|
|
93
|
+
| value | Current numeric value | `Number` / `String` | `false` | `0` |
|
|
94
|
+
| min | Minimum allowed value | `Number` / `String` | `false` | `-Infinity` |
|
|
95
|
+
| max | Maximum allowed value | `Number` / `String` | `false` | `Infinity` |
|
|
96
|
+
| step | Step amount for increment/decrement | `Number` / `String` | `false` | `1` |
|
|
97
|
+
| integer | Restrict input to integers only | `Boolean` | `false` | `false` |
|
|
98
|
+
| hideButtons | Hide increment/decrement buttons | `Boolean` | `false` | `false` |
|
|
99
|
+
|
|
100
|
+
All standard `AwInput` props are also supported via `$attrs` (e.g., `label`, `placeholder`, `error`, `disabled`, etc.).
|
|
101
|
+
|
|
102
|
+
### Slots
|
|
103
|
+
|
|
104
|
+
| Name | Description | Props | Default Slot Content |
|
|
105
|
+
|------|-------------|-------|---------------------|
|
|
106
|
+
| element | Custom input element | `{ cssClass, value, errorTooltip, mergedListeners, mergedAttributes, errorText, errorId }` | Default input element |
|
|
107
|
+
| postfix | Custom postfix content (replaces buttons when provided) | - | Increment/decrement buttons |
|
|
108
|
+
|
|
109
|
+
### Events
|
|
110
|
+
|
|
111
|
+
| Name | Payload | Description |
|
|
112
|
+
|------|---------|-------------|
|
|
113
|
+
| input | `Number` | Emitted when value changes |
|
|
114
|
+
|
|
115
|
+
### Methods
|
|
116
|
+
|
|
117
|
+
| Name | Description |
|
|
118
|
+
|------|-------------|
|
|
119
|
+
| add | Increment the value by step amount |
|
|
120
|
+
| subtract | Decrement the value by step amount |
|
|
121
|
+
|
|
122
|
+
## Related Components
|
|
123
|
+
|
|
124
|
+
- `AwInput` - Base input component used internally
|
|
125
|
+
- `AwButton` - Button component used for increment/decrement controls
|
|
126
|
+
|
|
127
|
+
## Notes
|
|
128
|
+
|
|
129
|
+
- **Import Method:** Global - Component is globally registered
|
|
130
|
+
- Value is automatically clamped to min/max range on blur
|
|
131
|
+
- Paste events are validated against min/max constraints
|
|
132
|
+
- Keys `-`, `+`, and `e` are prevented to avoid invalid number formats
|
|
133
|
+
- When `integer` is true, only numeric keys are allowed
|
|
134
|
+
- Input type is set to `tel` for better mobile keyboard support
|
|
135
|
+
- Uses `inputmode="numeric"` for mobile numeric keyboard
|
|
136
|
+
- Buttons are automatically disabled when min/max limits are reached
|
|
137
|
+
- Value is converted to number internally (empty/null values become `null`)
|
|
138
|
+
|