@awes-io/ui 2.143.0 → 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/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 +14 -0
- 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 +4 -3
- package/assets/css/components/dropdown.css +20 -7
- package/assets/css/components/icon-menu-item.css +12 -7
- package/assets/css/components/mobile-menu-nav.css +8 -4
- package/assets/css/components/text-field.css +4 -0
- package/components/1_atoms/AwActionIcon.vue +11 -2
- package/components/1_atoms/AwFlow.vue +26 -11
- 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/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/AwDescriptionInput.vue +19 -1
- package/components/3_organisms/AwBottomBar.vue +22 -4
- package/components/3_organisms/AwSubnav.vue +11 -1
- package/components/3_organisms/AwTable/AwTableBuilder.vue +8 -0
- 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/5_layouts/_AwMenuItemIcon.vue +9 -2
- package/components/5_layouts/_AwMobileMenuItem.vue +5 -3
- package/components/_config.js +26 -1
- package/docs/components/atoms/aw-accordion-fold.md +55 -17
- package/docs/components/atoms/aw-action-card-body.md +37 -5
- package/docs/components/atoms/aw-action-card.md +47 -11
- package/docs/components/atoms/aw-action-icon.md +50 -12
- package/docs/components/atoms/aw-card.md +35 -10
- package/docs/components/atoms/aw-checkbox.md +176 -0
- package/docs/components/atoms/aw-content-placeholder.md +33 -2
- package/docs/components/atoms/aw-dock.md +20 -14
- package/docs/components/atoms/aw-dropdown.md +72 -22
- package/docs/components/atoms/aw-flow.md +71 -23
- package/docs/components/atoms/aw-grid.md +30 -12
- package/docs/components/atoms/aw-icon-system-color.md +1 -0
- package/docs/components/atoms/aw-icon-system-mono.md +1 -0
- package/docs/components/atoms/aw-icon.md +3 -3
- package/docs/components/atoms/aw-info.md +38 -0
- package/docs/components/atoms/aw-input.md +94 -2
- package/docs/components/atoms/aw-label.md +62 -9
- package/docs/components/atoms/aw-link.md +61 -9
- package/docs/components/atoms/aw-list.md +68 -4
- package/docs/components/atoms/aw-progress.md +52 -3
- package/docs/components/atoms/aw-radio.md +73 -0
- package/docs/components/atoms/aw-select-native.md +128 -0
- package/docs/components/atoms/aw-slider.md +114 -7
- package/docs/components/atoms/aw-switcher.md +77 -0
- package/docs/components/atoms/aw-tag.md +67 -3
- package/docs/components/atoms/aw-toggler.md +22 -1
- package/docs/components/molecules/aw-action-button.md +58 -11
- package/docs/components/molecules/aw-alert.md +122 -27
- package/docs/components/molecules/aw-badge.md +31 -10
- package/docs/components/molecules/aw-banner-text.md +84 -18
- package/docs/components/molecules/aw-button-nav.md +65 -0
- package/docs/components/molecules/aw-button.md +76 -6
- package/docs/components/molecules/aw-description-input.md +63 -6
- package/docs/components/molecules/aw-empty-container.md +172 -23
- package/docs/components/molecules/aw-island.md +282 -10
- package/docs/components/organisms/aw-filter-select.md +14 -0
- package/docs/components/pages/aw-page-single.md +47 -0
- package/docs/guides/page-patterns/detail-pages.md +89 -26
- package/docs/guides/page-patterns/list-pages.md +158 -10
- package/docs/reference/colors.md +232 -0
- package/docs/reference/icons.md +163 -0
- package/docs/reference/troubleshooting.md +19 -0
- package/package.json +2 -2
- package/store/awesIo.js +11 -0
- package/CHANGELOG.md +0 -4544
- package/dist/css/aw-icons.css +0 -26
- package/dist/fonts/aw-icons.svg +0 -18
- 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/nuxt/icons.css +0 -26
|
@@ -21,33 +21,69 @@ The `AwActionCard` component is a card-like container with a title, optional des
|
|
|
21
21
|
### Basic Example
|
|
22
22
|
|
|
23
23
|
```markup
|
|
24
|
-
<AwActionCard
|
|
24
|
+
<AwActionCard
|
|
25
|
+
title="Simple Action Card"
|
|
26
|
+
description="This is a basic action card with a title and description"
|
|
27
|
+
/>
|
|
25
28
|
```
|
|
26
29
|
|
|
27
30
|
### With Action Button
|
|
28
31
|
|
|
29
32
|
```markup
|
|
30
33
|
<AwActionCard
|
|
31
|
-
title="Card
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
title="Card with Action"
|
|
35
|
+
description="Click the button to trigger an action"
|
|
36
|
+
:action="{ text: 'Click Me', color: 'mono-dark' }"
|
|
37
|
+
@action="onAction"
|
|
34
38
|
/>
|
|
35
39
|
```
|
|
36
40
|
|
|
37
|
-
### With
|
|
41
|
+
### With Link
|
|
42
|
+
|
|
43
|
+
```markup
|
|
44
|
+
<AwActionCard
|
|
45
|
+
title="Clickable Card"
|
|
46
|
+
description="This entire card is clickable"
|
|
47
|
+
href="/components"
|
|
48
|
+
/>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### With Content Slot
|
|
52
|
+
|
|
53
|
+
```markup
|
|
54
|
+
<AwActionCard
|
|
55
|
+
title="Card with Body"
|
|
56
|
+
description="This card includes additional body content"
|
|
57
|
+
:action="{ text: 'Save', color: 'accent' }"
|
|
58
|
+
>
|
|
59
|
+
<AwActionCardBody title="Details">
|
|
60
|
+
<AwDescription>You can add any content inside the action card.</AwDescription>
|
|
61
|
+
<AwList>
|
|
62
|
+
<li>Item 1</li>
|
|
63
|
+
<li>Item 2</li>
|
|
64
|
+
<li>Item 3</li>
|
|
65
|
+
</AwList>
|
|
66
|
+
</AwActionCardBody>
|
|
67
|
+
</AwActionCard>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### With Custom Slots
|
|
38
71
|
|
|
39
72
|
```markup
|
|
40
|
-
<AwActionCard
|
|
73
|
+
<AwActionCard
|
|
74
|
+
title="Custom Card"
|
|
75
|
+
description="This card uses custom slots for before and after title"
|
|
76
|
+
>
|
|
41
77
|
<template #before-title>
|
|
42
|
-
<
|
|
78
|
+
<AwActionIcon icon="awesio/check" size="sm" />
|
|
43
79
|
</template>
|
|
44
|
-
|
|
80
|
+
|
|
45
81
|
<template #after-title>
|
|
46
|
-
<
|
|
82
|
+
<AwButton text="Custom Action" color="accent" size="sm" />
|
|
47
83
|
</template>
|
|
48
|
-
|
|
84
|
+
|
|
49
85
|
<AwActionCardBody>
|
|
50
|
-
<
|
|
86
|
+
<AwDescription>Custom slot content with icon before title and custom button after.</AwDescription>
|
|
51
87
|
</AwActionCardBody>
|
|
52
88
|
</AwActionCard>
|
|
53
89
|
```
|
|
@@ -18,35 +18,73 @@ The `AwActionIcon` component displays an icon with optional text, with customiza
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### Different Sizes
|
|
22
22
|
|
|
23
23
|
```markup
|
|
24
|
-
<AwActionIcon icon="
|
|
24
|
+
<AwActionIcon icon="awesio/check" size="xxs" />
|
|
25
|
+
<AwActionIcon icon="awesio/check" size="xs" />
|
|
26
|
+
<AwActionIcon icon="awesio/check" size="sm" />
|
|
27
|
+
<AwActionIcon icon="awesio/check" size="md" />
|
|
28
|
+
<AwActionIcon icon="awesio/check" size="lg" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Different Colors
|
|
32
|
+
|
|
33
|
+
```markup
|
|
34
|
+
<AwActionIcon icon="awesio/star" color="accent" />
|
|
35
|
+
<AwActionIcon icon="awesio/star" color="success" />
|
|
36
|
+
<AwActionIcon icon="awesio/star" color="warning" />
|
|
37
|
+
<AwActionIcon icon="awesio/star" color="error" />
|
|
38
|
+
<AwActionIcon icon="awesio/star" color="info" />
|
|
25
39
|
```
|
|
26
40
|
|
|
27
41
|
### With Text
|
|
28
42
|
|
|
29
43
|
```markup
|
|
30
|
-
<AwActionIcon icon="
|
|
44
|
+
<AwActionIcon icon="awesio/download" text="Download" size="sm" />
|
|
45
|
+
<AwActionIcon icon="awesio/upload" text="Upload" size="md" />
|
|
46
|
+
<AwActionIcon icon="awesio/mail" text="Send" size="lg" />
|
|
31
47
|
```
|
|
32
48
|
|
|
33
|
-
###
|
|
49
|
+
### Custom Icon Color
|
|
34
50
|
|
|
35
51
|
```markup
|
|
36
|
-
<AwActionIcon
|
|
52
|
+
<AwActionIcon
|
|
53
|
+
icon="awesio/heart"
|
|
54
|
+
color="mono-100"
|
|
55
|
+
icon-color="error"
|
|
56
|
+
/>
|
|
37
57
|
```
|
|
38
58
|
|
|
39
|
-
###
|
|
59
|
+
### Outline Style
|
|
40
60
|
|
|
41
61
|
```markup
|
|
42
|
-
<AwActionIcon
|
|
43
|
-
icon="awesio/check"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
onColor="white"
|
|
62
|
+
<AwActionIcon
|
|
63
|
+
icon="awesio/check"
|
|
64
|
+
color="success"
|
|
65
|
+
modifiers="outline"
|
|
47
66
|
/>
|
|
48
67
|
```
|
|
49
68
|
|
|
69
|
+
### With Image
|
|
70
|
+
|
|
71
|
+
```markup
|
|
72
|
+
<AwActionIcon
|
|
73
|
+
:image="{ src: 'url', alt: 'Alt text' }"
|
|
74
|
+
size="md"
|
|
75
|
+
/>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Custom Size (px)
|
|
79
|
+
|
|
80
|
+
You can provide a numeric value for the `size` prop to set a custom size in pixels.
|
|
81
|
+
|
|
82
|
+
```markup
|
|
83
|
+
<AwActionIcon icon="awesio/settings" :size="30" />
|
|
84
|
+
<AwActionIcon icon="awesio/settings" :size="50" />
|
|
85
|
+
<AwActionIcon icon="awesio/settings" :size="70" />
|
|
86
|
+
```
|
|
87
|
+
|
|
50
88
|
## API
|
|
51
89
|
|
|
52
90
|
### Props
|
|
@@ -56,7 +94,7 @@ The `AwActionIcon` component displays an icon with optional text, with customiza
|
|
|
56
94
|
| image | Image object with src and alt | `Object` | `false` | `null` | - |
|
|
57
95
|
| icon | Icon name | `String` | `false` | `'arrow-animated'` | - |
|
|
58
96
|
| text | Text to display alongside icon | `String` | `false` | `''` | - |
|
|
59
|
-
| size | Icon size
|
|
97
|
+
| size | Icon size preset or custom pixels | `String` / `Number` | `false` | `'md'` | Must be one of: xxs, xs, sm, md, lg or any `Number` |
|
|
60
98
|
| color | Background color | `String` | `false` | `'mono-700'` | - |
|
|
61
99
|
| onColor | Text/icon color | `String` | `false` | `''` | - |
|
|
62
100
|
| iconColor | Custom icon color | `String` | `false` | `''` | - |
|
|
@@ -22,7 +22,7 @@ The `AwCard` component is a flexible container with optional header, title, desc
|
|
|
22
22
|
|
|
23
23
|
```markup
|
|
24
24
|
<AwCard>
|
|
25
|
-
<
|
|
25
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
26
26
|
</AwCard>
|
|
27
27
|
```
|
|
28
28
|
|
|
@@ -30,35 +30,60 @@ The `AwCard` component is a flexible container with optional header, title, desc
|
|
|
30
30
|
|
|
31
31
|
```markup
|
|
32
32
|
<AwCard title="Card Title">
|
|
33
|
-
<
|
|
33
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
34
34
|
</AwCard>
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
### With Title and Description
|
|
38
38
|
|
|
39
39
|
```markup
|
|
40
|
-
<AwCard
|
|
40
|
+
<AwCard
|
|
41
41
|
title="Card Title"
|
|
42
42
|
description="Card description text"
|
|
43
43
|
>
|
|
44
|
-
<
|
|
44
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
45
45
|
</AwCard>
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
### With
|
|
48
|
+
### With Badge
|
|
49
|
+
|
|
50
|
+
```markup
|
|
51
|
+
<AwCard title="Featured Card">
|
|
52
|
+
<template #badge>
|
|
53
|
+
<AwBadge text="New" color="info" />
|
|
54
|
+
</template>
|
|
55
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
56
|
+
</AwCard>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Custom Header
|
|
49
60
|
|
|
50
61
|
```markup
|
|
51
62
|
<AwCard>
|
|
52
63
|
<template #header>
|
|
53
|
-
<
|
|
64
|
+
<AwFlow class="pb-2 mb-2 border-b">
|
|
65
|
+
<AwActionIcon icon="awesio/settings" size="sm" />
|
|
66
|
+
<AwDescription>Custom header content</AwDescription>
|
|
67
|
+
</AwFlow>
|
|
54
68
|
</template>
|
|
69
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
70
|
+
</AwCard>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Custom Title Slot
|
|
74
|
+
|
|
75
|
+
```markup
|
|
76
|
+
<AwCard>
|
|
55
77
|
<template #title>
|
|
56
|
-
<
|
|
78
|
+
<AwFlow :gap="1">
|
|
79
|
+
<AwActionIcon icon="awesio/check" size="xs" color="success" />
|
|
80
|
+
<strong>Custom Title with Icon</strong>
|
|
81
|
+
</AwFlow>
|
|
57
82
|
</template>
|
|
58
83
|
<template #badge>
|
|
59
|
-
<AwBadge
|
|
84
|
+
<AwBadge text="3" color="error" />
|
|
60
85
|
</template>
|
|
61
|
-
<
|
|
86
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
62
87
|
</AwCard>
|
|
63
88
|
```
|
|
64
89
|
|
|
@@ -66,7 +91,7 @@ The `AwCard` component is a flexible container with optional header, title, desc
|
|
|
66
91
|
|
|
67
92
|
```markup
|
|
68
93
|
<AwCard tag="article" title="Article Title">
|
|
69
|
-
<
|
|
94
|
+
<AwDescription tag="div">Article content</AwDescription>
|
|
70
95
|
</AwCard>
|
|
71
96
|
```
|
|
72
97
|
|
|
@@ -78,10 +78,13 @@ The `AwCheckbox` component is a styled checkbox input with label support and err
|
|
|
78
78
|
|------|-------------|------|----------|---------|
|
|
79
79
|
| value | Value emitted when checked | `String` / `Number` / `Boolean` / `Object` | `false` | `'on'` |
|
|
80
80
|
| checked | Checked state (boolean, number, or array for groups) | `Array` / `Boolean` / `Number` | `false` | `false` |
|
|
81
|
+
| label | Label text displayed next to checkbox | `String` | `false` | `''` |
|
|
81
82
|
| partial | Show partial/indeterminate state | `Boolean` | `false` | `false` |
|
|
82
83
|
|
|
83
84
|
All standard HTML checkbox attributes are supported via `$attrs` (e.g., `disabled`, `required`).
|
|
84
85
|
|
|
86
|
+
Inherits props from `FieldMixin` and `ErrorMixin` for additional field and error handling functionality.
|
|
87
|
+
|
|
85
88
|
### Slots
|
|
86
89
|
|
|
87
90
|
| Name | Description | Props | Default Slot Content |
|
|
@@ -95,6 +98,179 @@ All standard HTML checkbox attributes are supported via `$attrs` (e.g., `disable
|
|
|
95
98
|
|------|---------|-------------|
|
|
96
99
|
| change | `value` | Emitted when checkbox state changes |
|
|
97
100
|
|
|
101
|
+
## Component Behavior
|
|
102
|
+
|
|
103
|
+
### V-Model Implementation
|
|
104
|
+
|
|
105
|
+
`AwCheckbox` uses a custom v-model configuration:
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
model: {
|
|
109
|
+
prop: 'checked',
|
|
110
|
+
event: 'change'
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
This means:
|
|
115
|
+
- `v-model="value"` is equivalent to `:checked="value" @change="value = $event"`
|
|
116
|
+
- The `checked` prop receives the current state
|
|
117
|
+
- The `change` event emits the new state
|
|
118
|
+
|
|
119
|
+
**Single Checkbox (Boolean):**
|
|
120
|
+
```vue
|
|
121
|
+
<template>
|
|
122
|
+
<AwCheckbox v-model="accepted" label="I accept" />
|
|
123
|
+
</template>
|
|
124
|
+
|
|
125
|
+
<script>
|
|
126
|
+
export default {
|
|
127
|
+
data() {
|
|
128
|
+
return {
|
|
129
|
+
accepted: false // Boolean value
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
</script>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Checkbox Group (Array):**
|
|
137
|
+
```vue
|
|
138
|
+
<template>
|
|
139
|
+
<AwCheckbox v-model="selected" value="option1" label="Option 1" />
|
|
140
|
+
<AwCheckbox v-model="selected" value="option2" label="Option 2" />
|
|
141
|
+
<AwCheckbox v-model="selected" value="option3" label="Option 3" />
|
|
142
|
+
</template>
|
|
143
|
+
|
|
144
|
+
<script>
|
|
145
|
+
export default {
|
|
146
|
+
data() {
|
|
147
|
+
return {
|
|
148
|
+
selected: [] // Array of selected values
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
</script>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
When `checked` is an array, the component automatically:
|
|
156
|
+
- Adds `value` to the array when checked
|
|
157
|
+
- Removes `value` from the array when unchecked
|
|
158
|
+
- Maintains the immutability of the array (returns new arrays)
|
|
159
|
+
|
|
160
|
+
### Label Usage
|
|
161
|
+
|
|
162
|
+
The component provides two ways to add a label:
|
|
163
|
+
|
|
164
|
+
**Via Label Prop (Recommended):**
|
|
165
|
+
```markup
|
|
166
|
+
<AwCheckbox v-model="checked" label="Accept terms" />
|
|
167
|
+
```
|
|
168
|
+
- Simple text label
|
|
169
|
+
- Proper `for` attribute linking
|
|
170
|
+
- Automatic styling
|
|
171
|
+
|
|
172
|
+
**Via Label Slot (Advanced):**
|
|
173
|
+
```markup
|
|
174
|
+
<AwCheckbox v-model="checked">
|
|
175
|
+
<template #label="{ label, value, isChecked }">
|
|
176
|
+
<span :class="{ 'font-bold': isChecked }">{{ label }}</span>
|
|
177
|
+
</template>
|
|
178
|
+
</AwCheckbox>
|
|
179
|
+
```
|
|
180
|
+
- Custom label rendering
|
|
181
|
+
- Access to component state
|
|
182
|
+
- Full control over styling
|
|
183
|
+
|
|
184
|
+
**Note:** The default slot is for completely custom checkbox rendering, not for labels. Use the `label` prop or `label` slot for labels.
|
|
185
|
+
|
|
186
|
+
### Value Handling
|
|
187
|
+
|
|
188
|
+
The `value` prop determines what gets emitted when the checkbox is checked:
|
|
189
|
+
|
|
190
|
+
**Default (String):**
|
|
191
|
+
```markup
|
|
192
|
+
<AwCheckbox v-model="checked" />
|
|
193
|
+
<!-- Emits: 'on' when checked -->
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Custom String:**
|
|
197
|
+
```markup
|
|
198
|
+
<AwCheckbox v-model="items" value="item1" />
|
|
199
|
+
<!-- Emits: 'item1' when checked -->
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Number:**
|
|
203
|
+
```markup
|
|
204
|
+
<AwCheckbox v-model="items" :value="42" />
|
|
205
|
+
<!-- Emits: 42 when checked -->
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Object:**
|
|
209
|
+
```markup
|
|
210
|
+
<AwCheckbox v-model="items" :value="{ id: 1, name: 'Item' }" />
|
|
211
|
+
<!-- Emits: the object when checked -->
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Partial/Indeterminate State
|
|
215
|
+
|
|
216
|
+
The `partial` prop shows a partial/indeterminate state:
|
|
217
|
+
```markup
|
|
218
|
+
<AwCheckbox
|
|
219
|
+
v-model="selectAll"
|
|
220
|
+
:partial="someSelected && !allSelected"
|
|
221
|
+
label="Select All"
|
|
222
|
+
/>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Common use case: "Select All" checkbox in a list:
|
|
226
|
+
- `partial: false` - None or all selected (shows check or empty)
|
|
227
|
+
- `partial: true` - Some selected (shows indeterminate dash)
|
|
228
|
+
|
|
229
|
+
### Error Handling
|
|
230
|
+
|
|
231
|
+
Inherits error management from `ErrorMixin`:
|
|
232
|
+
|
|
233
|
+
```vue
|
|
234
|
+
<template>
|
|
235
|
+
<AwCheckbox
|
|
236
|
+
v-model="accepted"
|
|
237
|
+
label="I accept terms"
|
|
238
|
+
:error="error"
|
|
239
|
+
/>
|
|
240
|
+
</template>
|
|
241
|
+
|
|
242
|
+
<script>
|
|
243
|
+
export default {
|
|
244
|
+
data() {
|
|
245
|
+
return {
|
|
246
|
+
accepted: false,
|
|
247
|
+
error: ''
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
methods: {
|
|
251
|
+
validate() {
|
|
252
|
+
if (!this.accepted) {
|
|
253
|
+
this.error = 'You must accept the terms'
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
</script>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Features:
|
|
262
|
+
- Error displayed via tooltip on hover
|
|
263
|
+
- Adds `has-error` class for styling
|
|
264
|
+
- Error clears automatically when state changes
|
|
265
|
+
- Error text shown in tooltip
|
|
266
|
+
|
|
267
|
+
### Field States
|
|
268
|
+
|
|
269
|
+
CSS classes applied based on component state:
|
|
270
|
+
- `is-checkbox` - Always present for checkbox type
|
|
271
|
+
- `has-error` - When error is present
|
|
272
|
+
- `fb-field` - When using default slot (custom rendering)
|
|
273
|
+
|
|
98
274
|
## Related Components
|
|
99
275
|
|
|
100
276
|
- `AwSwitcher` - Toggle switch component
|
|
@@ -45,13 +45,20 @@ The `AwContentPlaceholder` component displays animated placeholder content while
|
|
|
45
45
|
### Avatar Type
|
|
46
46
|
|
|
47
47
|
```markup
|
|
48
|
-
<
|
|
48
|
+
<AwFlow :gap="2">
|
|
49
|
+
<AwContentPlaceholder type="avatar" />
|
|
50
|
+
<AwContentPlaceholder type="avatar" />
|
|
51
|
+
<AwContentPlaceholder type="avatar" />
|
|
52
|
+
</AwFlow>
|
|
49
53
|
```
|
|
50
54
|
|
|
51
55
|
### Button Type
|
|
52
56
|
|
|
53
57
|
```markup
|
|
54
|
-
<
|
|
58
|
+
<AwGrid :gap="2">
|
|
59
|
+
<AwContentPlaceholder type="button" :lines="2" />
|
|
60
|
+
<AwContentPlaceholder type="button" :lines="1" />
|
|
61
|
+
</AwGrid>
|
|
55
62
|
```
|
|
56
63
|
|
|
57
64
|
### Multi-Column Layout
|
|
@@ -64,6 +71,30 @@ The `AwContentPlaceholder` component displays animated placeholder content while
|
|
|
64
71
|
<AwContentPlaceholder type="text" :columns="3" :lines="6" />
|
|
65
72
|
```
|
|
66
73
|
|
|
74
|
+
### Loading Simulation
|
|
75
|
+
|
|
76
|
+
```markup
|
|
77
|
+
<AwCard title="User Profile">
|
|
78
|
+
<AwFlow v-if="!loading" :gap="2">
|
|
79
|
+
<AwAvatar :src="data.avatar" :name="data.name" size="lg" />
|
|
80
|
+
<AwFlow vertical :gap="1">
|
|
81
|
+
<AwDescription tag="div" class="font-semibold">
|
|
82
|
+
{{ data.name }}
|
|
83
|
+
</AwDescription>
|
|
84
|
+
<AwDescription tag="div" class="text-sm">
|
|
85
|
+
{{ data.email }}
|
|
86
|
+
</AwDescription>
|
|
87
|
+
</AwFlow>
|
|
88
|
+
</AwFlow>
|
|
89
|
+
<AwFlow v-else :gap="2">
|
|
90
|
+
<AwContentPlaceholder type="avatar" />
|
|
91
|
+
<AwFlow vertical :gap="1" class="flex-1">
|
|
92
|
+
<AwContentPlaceholder type="text" :lines="2" />
|
|
93
|
+
</AwFlow>
|
|
94
|
+
</AwFlow>
|
|
95
|
+
</AwCard>
|
|
96
|
+
```
|
|
97
|
+
|
|
67
98
|
## API
|
|
68
99
|
|
|
69
100
|
### Props
|
|
@@ -18,19 +18,25 @@ The `AwDock` component is a slide-up panel that can be opened and closed with to
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
### Basic Example
|
|
21
|
+
### Basic Example with Visible Slot
|
|
22
22
|
|
|
23
23
|
```markup
|
|
24
24
|
<AwDock>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
<AwDescription tag="div">
|
|
26
|
+
Scrollable content
|
|
27
|
+
</AwDescription>
|
|
28
|
+
|
|
29
|
+
<template #visible>
|
|
30
|
+
<AwButton
|
|
31
|
+
color="accent"
|
|
32
|
+
size="lg"
|
|
33
|
+
icon-right="arrow-animated"
|
|
34
|
+
highlight-icon
|
|
35
|
+
class="w-full"
|
|
36
|
+
>
|
|
37
|
+
Action
|
|
38
|
+
</AwButton>
|
|
39
|
+
</template>
|
|
34
40
|
</AwDock>
|
|
35
41
|
```
|
|
36
42
|
|
|
@@ -38,10 +44,8 @@ The `AwDock` component is a slide-up panel that can be opened and closed with to
|
|
|
38
44
|
|
|
39
45
|
```markup
|
|
40
46
|
<AwDock prevent-slide="a, button">
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
<button>Button</button>
|
|
44
|
-
</div>
|
|
47
|
+
<a href="#">Link</a>
|
|
48
|
+
<button>Button</button>
|
|
45
49
|
</AwDock>
|
|
46
50
|
```
|
|
47
51
|
|
|
@@ -77,8 +81,10 @@ The `AwDock` component is a slide-up panel that can be opened and closed with to
|
|
|
77
81
|
## Notes
|
|
78
82
|
|
|
79
83
|
- **Import Method:** Global - Available as atom component
|
|
84
|
+
- **Primary Use:** Mobile/tablet component - designed for smaller screens with touch interactions
|
|
80
85
|
- Uses body-scroll-lock to prevent background scrolling when open
|
|
81
86
|
- Supports touch and mouse drag gestures
|
|
82
87
|
- Content in default slot becomes scrollable when dock is fully open
|
|
83
88
|
- Use `visible` slot for content that should always be visible (e.g., action buttons)
|
|
89
|
+
- **Important:** Only one AwDock component should be used per page due to fixed positioning
|
|
84
90
|
|
|
@@ -18,42 +18,88 @@ The `AwDropdown` component provides a positioned dropdown menu with mobile and d
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
### Basic Example
|
|
21
|
+
### Basic Example (Recommended)
|
|
22
|
+
|
|
23
|
+
The recommended way to control the dropdown is by calling the `toggle()` method via ref:
|
|
22
24
|
|
|
23
25
|
```markup
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</
|
|
31
|
-
</
|
|
26
|
+
<AwButton color="accent" @click="$refs.dropdown.toggle()">
|
|
27
|
+
Toggle Dropdown
|
|
28
|
+
</AwButton>
|
|
29
|
+
<AwDropdown ref="dropdown">
|
|
30
|
+
<AwDescription tag="div" class="p-4">
|
|
31
|
+
Dropdown content
|
|
32
|
+
</AwDescription>
|
|
33
|
+
</AwDropdown>
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
### With
|
|
36
|
+
### With Dropdown Buttons
|
|
35
37
|
|
|
36
38
|
```markup
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
>
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
<AwButton color="accent" @click="$refs.dropdown.toggle()">
|
|
40
|
+
Open Menu
|
|
41
|
+
</AwButton>
|
|
42
|
+
<AwDropdown ref="dropdown">
|
|
43
|
+
<AwDropdownButton @click="handleAction">
|
|
44
|
+
Option 1
|
|
45
|
+
</AwDropdownButton>
|
|
46
|
+
<AwDropdownButton color="error" @click="handleAction">
|
|
47
|
+
Option 2
|
|
48
|
+
</AwDropdownButton>
|
|
49
|
+
<AwDropdownButton @click="handleAction">
|
|
50
|
+
Option 3
|
|
51
|
+
</AwDropdownButton>
|
|
52
|
+
</AwDropdown>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### With State Sync (Alternative)
|
|
56
|
+
|
|
57
|
+
If you need to track the dropdown state in your component, use `:show.sync`:
|
|
58
|
+
|
|
59
|
+
```markup
|
|
60
|
+
<AwButton color="accent" @click="show = !show">
|
|
61
|
+
Open Menu
|
|
62
|
+
</AwButton>
|
|
63
|
+
<AwDropdown :show.sync="show">
|
|
64
|
+
<AwDropdownButton @click="handleAction">
|
|
65
|
+
Option 1
|
|
66
|
+
</AwDropdownButton>
|
|
67
|
+
<AwDropdownButton @click="handleAction">
|
|
68
|
+
Option 2
|
|
69
|
+
</AwDropdownButton>
|
|
70
|
+
</AwDropdown>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### With Target Selector
|
|
74
|
+
|
|
75
|
+
```markup
|
|
76
|
+
<AwButton id="trigger" color="accent" @click="show = !show">
|
|
77
|
+
Toggle
|
|
78
|
+
</AwButton>
|
|
79
|
+
|
|
80
|
+
<div>Some other content between dropdown and button</div>
|
|
81
|
+
|
|
82
|
+
<AwDropdown target="#trigger" :show.sync="show">
|
|
83
|
+
<AwDescription tag="div" class="p-4">
|
|
84
|
+
Dropdown content
|
|
85
|
+
</AwDescription>
|
|
44
86
|
</AwDropdown>
|
|
45
87
|
```
|
|
46
88
|
|
|
47
|
-
### With Title and Description
|
|
89
|
+
### With Title and Description (Mobile)
|
|
48
90
|
|
|
49
91
|
```markup
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
92
|
+
<AwButton color="accent" @click="show = !show">
|
|
93
|
+
Open Menu
|
|
94
|
+
</AwButton>
|
|
95
|
+
<AwDropdown
|
|
96
|
+
:show.sync="show"
|
|
53
97
|
title="Menu Title"
|
|
54
98
|
description="Menu description"
|
|
55
99
|
>
|
|
56
|
-
<div>
|
|
100
|
+
<AwDescription tag="div" class="p-4">
|
|
101
|
+
Content
|
|
102
|
+
</AwDescription>
|
|
57
103
|
</AwDropdown>
|
|
58
104
|
```
|
|
59
105
|
|
|
@@ -124,5 +170,9 @@ export default {
|
|
|
124
170
|
- Prevents body scrolling when open on mobile
|
|
125
171
|
- Closes automatically when clicking action elements (links, buttons) by default
|
|
126
172
|
- Supports custom Popper.js options for advanced positioning
|
|
173
|
+
- **Auto-target detection:** If no `target` prop is specified, the dropdown automatically uses the previous sibling element as the trigger
|
|
174
|
+
- **Recommended control method:** Use `$refs.dropdown.toggle()` for simple show/hide control. This is the preferred approach for most use cases
|
|
175
|
+
- **Alternative state management:** Use `:show.sync` only when you need to track or react to the dropdown's visibility state in your component
|
|
176
|
+
- **Available methods:** Call `toggle()`, `open()`, or `close()` methods directly via refs for programmatic control
|
|
127
177
|
|
|
128
178
|
|