wally-ui 1.12.1 → 1.13.1
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/dist/cli.js +8 -5
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/playground/showcase/src/app/app.routes.server.ts +4 -0
- package/playground/showcase/src/app/components/ai/ai-composer/ai-composer.html +164 -31
- package/playground/showcase/src/app/components/ai/ai-composer/ai-composer.ts +25 -3
- package/playground/showcase/src/app/components/ai/ai-prompt-input/ai-prompt-input.html +1 -1
- package/playground/showcase/src/app/components/badge/badge.css +0 -0
- package/playground/showcase/src/app/components/badge/badge.html +3 -0
- package/playground/showcase/src/app/components/badge/badge.ts +24 -0
- package/playground/showcase/src/app/components/button/button.html +1 -3
- package/playground/showcase/src/app/components/button/button.ts +4 -4
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-content/dropdown-menu-content.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-content/dropdown-menu-content.html +9 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-content/dropdown-menu-content.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-content/dropdown-menu-content.ts +167 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-group/dropdown-menu-group.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-group/dropdown-menu-group.html +5 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-group/dropdown-menu-group.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-group/dropdown-menu-group.ts +10 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-item/dropdown-menu-item.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-item/dropdown-menu-item.html +6 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-item/dropdown-menu-item.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-item/dropdown-menu-item.ts +37 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-label/dropdown-menu-label.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-label/dropdown-menu-label.html +3 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-label/dropdown-menu-label.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-label/dropdown-menu-label.ts +11 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-portal/dropdown-menu-portal.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-portal/dropdown-menu-portal.html +1 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-portal/dropdown-menu-portal.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-portal/dropdown-menu-portal.ts +11 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-separator/dropdown-menu-separator.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-separator/dropdown-menu-separator.html +1 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-separator/dropdown-menu-separator.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-separator/dropdown-menu-separator.ts +11 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub/dropdown-menu-sub.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub/dropdown-menu-sub.html +3 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub/dropdown-menu-sub.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub/dropdown-menu-sub.ts +16 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub-content/dropdown-menu-sub-content.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub-content/dropdown-menu-sub-content.html +9 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub-content/dropdown-menu-sub-content.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub-content/dropdown-menu-sub-content.ts +140 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.html +13 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.ts +40 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub.service.spec.ts +16 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-sub.service.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-trigger/dropdown-menu-trigger.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-trigger/dropdown-menu-trigger.html +8 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-trigger/dropdown-menu-trigger.spec.ts +23 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu-trigger/dropdown-menu-trigger.ts +55 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu.css +0 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu.html +3 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu.service.spec.ts +16 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu.service.ts +31 -0
- package/playground/showcase/src/app/components/dropdown-menu/dropdown-menu.ts +69 -0
- package/playground/showcase/src/app/components/tooltip/tooltip.ts +195 -80
- package/playground/showcase/src/app/pages/documentation/components/components.html +110 -51
- package/playground/showcase/src/app/pages/documentation/components/components.routes.ts +4 -0
- package/playground/showcase/src/app/pages/documentation/components/dropdown-menu-docs/dropdown-menu-docs.css +1 -0
- package/playground/showcase/src/app/pages/documentation/components/dropdown-menu-docs/dropdown-menu-docs.examples.ts +404 -0
- package/playground/showcase/src/app/pages/documentation/components/dropdown-menu-docs/dropdown-menu-docs.html +612 -0
- package/playground/showcase/src/app/pages/documentation/components/dropdown-menu-docs/dropdown-menu-docs.ts +127 -0
- package/playground/showcase/src/app/pages/home/home.html +10 -6
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
export const DropdownMenuCodeExamples = {
|
|
2
|
+
installation: `npx wally-ui add dropdown-menu`,
|
|
3
|
+
|
|
4
|
+
import: `import { DropdownMenu } from './components/wally-ui/dropdown-menu/dropdown-menu';
|
|
5
|
+
import { DropdownMenuTrigger } from './components/wally-ui/dropdown-menu/dropdown-menu-trigger/dropdown-menu-trigger';
|
|
6
|
+
import { DropdownMenuContent } from './components/wally-ui/dropdown-menu/dropdown-menu-content/dropdown-menu-content';
|
|
7
|
+
import { DropdownMenuItem } from './components/wally-ui/dropdown-menu/dropdown-menu-item/dropdown-menu-item';
|
|
8
|
+
import { DropdownMenuLabel } from './components/wally-ui/dropdown-menu/dropdown-menu-label/dropdown-menu-label';
|
|
9
|
+
import { DropdownMenuSeparator } from './components/wally-ui/dropdown-menu/dropdown-menu-separator/dropdown-menu-separator';
|
|
10
|
+
import { DropdownMenuGroup } from './components/wally-ui/dropdown-menu/dropdown-menu-group/dropdown-menu-group';
|
|
11
|
+
import { DropdownMenuSub } from './components/wally-ui/dropdown-menu/dropdown-menu-sub/dropdown-menu-sub';
|
|
12
|
+
import { DropdownMenuSubTrigger } from './components/wally-ui/dropdown-menu/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger';
|
|
13
|
+
import { DropdownMenuSubContent } from './components/wally-ui/dropdown-menu/dropdown-menu-sub-content/dropdown-menu-sub-content';`,
|
|
14
|
+
|
|
15
|
+
componentImport: `@Component({
|
|
16
|
+
selector: 'app-example',
|
|
17
|
+
imports: [
|
|
18
|
+
DropdownMenu,
|
|
19
|
+
DropdownMenuTrigger,
|
|
20
|
+
DropdownMenuContent,
|
|
21
|
+
DropdownMenuItem,
|
|
22
|
+
DropdownMenuLabel,
|
|
23
|
+
DropdownMenuSeparator
|
|
24
|
+
],
|
|
25
|
+
templateUrl: './example.html'
|
|
26
|
+
})`,
|
|
27
|
+
|
|
28
|
+
basicUsage: `<wally-dropdown-menu>
|
|
29
|
+
<wally-dropdown-menu-trigger>
|
|
30
|
+
<wally-button variant="outline">Open Menu</wally-button>
|
|
31
|
+
</wally-dropdown-menu-trigger>
|
|
32
|
+
|
|
33
|
+
<wally-dropdown-menu-content>
|
|
34
|
+
<wally-dropdown-menu-item (click)="onProfile()">
|
|
35
|
+
Profile
|
|
36
|
+
</wally-dropdown-menu-item>
|
|
37
|
+
<wally-dropdown-menu-item (click)="onSettings()">
|
|
38
|
+
Settings
|
|
39
|
+
</wally-dropdown-menu-item>
|
|
40
|
+
<wally-dropdown-menu-item (click)="onLogout()">
|
|
41
|
+
Log out
|
|
42
|
+
</wally-dropdown-menu-item>
|
|
43
|
+
</wally-dropdown-menu-content>
|
|
44
|
+
</wally-dropdown-menu>`,
|
|
45
|
+
|
|
46
|
+
withLabel: `<wally-dropdown-menu>
|
|
47
|
+
<wally-dropdown-menu-trigger>
|
|
48
|
+
<wally-button variant="outline">Account</wally-button>
|
|
49
|
+
</wally-dropdown-menu-trigger>
|
|
50
|
+
|
|
51
|
+
<wally-dropdown-menu-content>
|
|
52
|
+
<wally-dropdown-menu-label>
|
|
53
|
+
My Account
|
|
54
|
+
</wally-dropdown-menu-label>
|
|
55
|
+
<wally-dropdown-menu-separator></wally-dropdown-menu-separator>
|
|
56
|
+
<wally-dropdown-menu-item (click)="onProfile()">
|
|
57
|
+
Profile
|
|
58
|
+
</wally-dropdown-menu-item>
|
|
59
|
+
<wally-dropdown-menu-item (click)="onBilling()">
|
|
60
|
+
Billing
|
|
61
|
+
</wally-dropdown-menu-item>
|
|
62
|
+
</wally-dropdown-menu-content>
|
|
63
|
+
</wally-dropdown-menu>`,
|
|
64
|
+
|
|
65
|
+
withGroups: `<wally-dropdown-menu>
|
|
66
|
+
<wally-dropdown-menu-trigger>
|
|
67
|
+
<wally-button variant="outline">Actions</wally-button>
|
|
68
|
+
</wally-dropdown-menu-trigger>
|
|
69
|
+
|
|
70
|
+
<wally-dropdown-menu-content>
|
|
71
|
+
<wally-dropdown-menu-group [ariaLabel]="'File actions'">
|
|
72
|
+
<wally-dropdown-menu-item (click)="onNew()">
|
|
73
|
+
New File
|
|
74
|
+
</wally-dropdown-menu-item>
|
|
75
|
+
<wally-dropdown-menu-item (click)="onOpen()">
|
|
76
|
+
Open
|
|
77
|
+
</wally-dropdown-menu-item>
|
|
78
|
+
</wally-dropdown-menu-group>
|
|
79
|
+
|
|
80
|
+
<wally-dropdown-menu-separator></wally-dropdown-menu-separator>
|
|
81
|
+
|
|
82
|
+
<wally-dropdown-menu-group [ariaLabel]="'Edit actions'">
|
|
83
|
+
<wally-dropdown-menu-item (click)="onCopy()">
|
|
84
|
+
Copy
|
|
85
|
+
</wally-dropdown-menu-item>
|
|
86
|
+
<wally-dropdown-menu-item (click)="onPaste()">
|
|
87
|
+
Paste
|
|
88
|
+
</wally-dropdown-menu-item>
|
|
89
|
+
</wally-dropdown-menu-group>
|
|
90
|
+
</wally-dropdown-menu-content>
|
|
91
|
+
</wally-dropdown-menu>`,
|
|
92
|
+
|
|
93
|
+
withSubmenus: `<wally-dropdown-menu>
|
|
94
|
+
<wally-dropdown-menu-trigger>
|
|
95
|
+
<wally-button variant="outline">Options</wally-button>
|
|
96
|
+
</wally-dropdown-menu-trigger>
|
|
97
|
+
|
|
98
|
+
<wally-dropdown-menu-content>
|
|
99
|
+
<wally-dropdown-menu-item (click)="onEdit()">
|
|
100
|
+
Edit
|
|
101
|
+
</wally-dropdown-menu-item>
|
|
102
|
+
<wally-dropdown-menu-item (click)="onDuplicate()">
|
|
103
|
+
Duplicate
|
|
104
|
+
</wally-dropdown-menu-item>
|
|
105
|
+
|
|
106
|
+
<wally-dropdown-menu-separator></wally-dropdown-menu-separator>
|
|
107
|
+
|
|
108
|
+
<wally-dropdown-menu-sub>
|
|
109
|
+
<wally-dropdown-menu-sub-trigger>
|
|
110
|
+
<span>Share</span>
|
|
111
|
+
</wally-dropdown-menu-sub-trigger>
|
|
112
|
+
|
|
113
|
+
<wally-dropdown-menu-sub-content>
|
|
114
|
+
<wally-dropdown-menu-item (click)="onShareEmail()">
|
|
115
|
+
Email
|
|
116
|
+
</wally-dropdown-menu-item>
|
|
117
|
+
<wally-dropdown-menu-item (click)="onShareLink()">
|
|
118
|
+
Copy Link
|
|
119
|
+
</wally-dropdown-menu-item>
|
|
120
|
+
<wally-dropdown-menu-item (click)="onShareSocial()">
|
|
121
|
+
Social Media
|
|
122
|
+
</wally-dropdown-menu-item>
|
|
123
|
+
</wally-dropdown-menu-sub-content>
|
|
124
|
+
</wally-dropdown-menu-sub>
|
|
125
|
+
|
|
126
|
+
<wally-dropdown-menu-separator></wally-dropdown-menu-separator>
|
|
127
|
+
|
|
128
|
+
<wally-dropdown-menu-item (click)="onDelete()">
|
|
129
|
+
Delete
|
|
130
|
+
</wally-dropdown-menu-item>
|
|
131
|
+
</wally-dropdown-menu-content>
|
|
132
|
+
</wally-dropdown-menu>`,
|
|
133
|
+
|
|
134
|
+
withIcons: `<wally-dropdown-menu>
|
|
135
|
+
<wally-dropdown-menu-trigger>
|
|
136
|
+
<wally-button variant="outline">
|
|
137
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
|
138
|
+
stroke-width="1.5" stroke="currentColor" class="size-5">
|
|
139
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
140
|
+
d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z" />
|
|
141
|
+
</svg>
|
|
142
|
+
Profile
|
|
143
|
+
</wally-button>
|
|
144
|
+
</wally-dropdown-menu-trigger>
|
|
145
|
+
|
|
146
|
+
<wally-dropdown-menu-content>
|
|
147
|
+
<wally-dropdown-menu-item (click)="onAccount()">
|
|
148
|
+
<div class="flex items-center gap-3">
|
|
149
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
|
150
|
+
stroke-width="1.5" stroke="currentColor" class="size-5">
|
|
151
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
152
|
+
d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
|
153
|
+
</svg>
|
|
154
|
+
<span>Account</span>
|
|
155
|
+
</div>
|
|
156
|
+
</wally-dropdown-menu-item>
|
|
157
|
+
<wally-dropdown-menu-item (click)="onSettings()">
|
|
158
|
+
<div class="flex items-center gap-3">
|
|
159
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
|
160
|
+
stroke-width="1.5" stroke="currentColor" class="size-5">
|
|
161
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
162
|
+
d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.240.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z" />
|
|
163
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
|
164
|
+
</svg>
|
|
165
|
+
<span>Settings</span>
|
|
166
|
+
</div>
|
|
167
|
+
</wally-dropdown-menu-item>
|
|
168
|
+
</wally-dropdown-menu-content>
|
|
169
|
+
</wally-dropdown-menu>`,
|
|
170
|
+
|
|
171
|
+
hoverMode: `<wally-dropdown-menu [triggerMode]="'hover'">
|
|
172
|
+
<wally-dropdown-menu-trigger>
|
|
173
|
+
<wally-button variant="ghost">Hover Me</wally-button>
|
|
174
|
+
</wally-dropdown-menu-trigger>
|
|
175
|
+
|
|
176
|
+
<wally-dropdown-menu-content>
|
|
177
|
+
<wally-dropdown-menu-item (click)="onAction()">
|
|
178
|
+
Action 1
|
|
179
|
+
</wally-dropdown-menu-item>
|
|
180
|
+
<wally-dropdown-menu-item (click)="onAction2()">
|
|
181
|
+
Action 2
|
|
182
|
+
</wally-dropdown-menu-item>
|
|
183
|
+
</wally-dropdown-menu-content>
|
|
184
|
+
</wally-dropdown-menu>`,
|
|
185
|
+
|
|
186
|
+
positioning: `<!-- Position Bottom (Default) -->
|
|
187
|
+
<wally-dropdown-menu>
|
|
188
|
+
<wally-dropdown-menu-trigger>
|
|
189
|
+
<wally-button>Bottom</wally-button>
|
|
190
|
+
</wally-dropdown-menu-trigger>
|
|
191
|
+
<wally-dropdown-menu-content [position]="'bottom'">
|
|
192
|
+
<!-- items -->
|
|
193
|
+
</wally-dropdown-menu-content>
|
|
194
|
+
</wally-dropdown-menu>
|
|
195
|
+
|
|
196
|
+
<!-- Position Top -->
|
|
197
|
+
<wally-dropdown-menu>
|
|
198
|
+
<wally-dropdown-menu-trigger>
|
|
199
|
+
<wally-button>Top</wally-button>
|
|
200
|
+
</wally-dropdown-menu-trigger>
|
|
201
|
+
<wally-dropdown-menu-content [position]="'top'">
|
|
202
|
+
<!-- items -->
|
|
203
|
+
</wally-dropdown-menu-content>
|
|
204
|
+
</wally-dropdown-menu>
|
|
205
|
+
|
|
206
|
+
<!-- Position Left -->
|
|
207
|
+
<wally-dropdown-menu>
|
|
208
|
+
<wally-dropdown-menu-trigger>
|
|
209
|
+
<wally-button>Left</wally-button>
|
|
210
|
+
</wally-dropdown-menu-trigger>
|
|
211
|
+
<wally-dropdown-menu-content [position]="'left'">
|
|
212
|
+
<!-- items -->
|
|
213
|
+
</wally-dropdown-menu-content>
|
|
214
|
+
</wally-dropdown-menu>
|
|
215
|
+
|
|
216
|
+
<!-- Position Right -->
|
|
217
|
+
<wally-dropdown-menu>
|
|
218
|
+
<wally-dropdown-menu-trigger>
|
|
219
|
+
<wally-button>Right</wally-button>
|
|
220
|
+
</wally-dropdown-menu-trigger>
|
|
221
|
+
<wally-dropdown-menu-content [position]="'right'">
|
|
222
|
+
<!-- items -->
|
|
223
|
+
</wally-dropdown-menu-content>
|
|
224
|
+
</wally-dropdown-menu>`,
|
|
225
|
+
|
|
226
|
+
disabledItems: `<wally-dropdown-menu>
|
|
227
|
+
<wally-dropdown-menu-trigger>
|
|
228
|
+
<wally-button variant="outline">Edit</wally-button>
|
|
229
|
+
</wally-dropdown-menu-trigger>
|
|
230
|
+
|
|
231
|
+
<wally-dropdown-menu-content>
|
|
232
|
+
<wally-dropdown-menu-item (click)="onCut()">
|
|
233
|
+
Cut
|
|
234
|
+
</wally-dropdown-menu-item>
|
|
235
|
+
<wally-dropdown-menu-item (click)="onCopy()">
|
|
236
|
+
Copy
|
|
237
|
+
</wally-dropdown-menu-item>
|
|
238
|
+
<wally-dropdown-menu-item [disabled]="true">
|
|
239
|
+
Paste (Nothing to paste)
|
|
240
|
+
</wally-dropdown-menu-item>
|
|
241
|
+
</wally-dropdown-menu-content>
|
|
242
|
+
</wally-dropdown-menu>`,
|
|
243
|
+
|
|
244
|
+
destructiveAction: `<wally-dropdown-menu>
|
|
245
|
+
<wally-dropdown-menu-trigger>
|
|
246
|
+
<wally-button variant="ghost">
|
|
247
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
|
248
|
+
stroke-width="1.5" stroke="currentColor" class="size-5">
|
|
249
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
250
|
+
d="M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z" />
|
|
251
|
+
</svg>
|
|
252
|
+
</wally-button>
|
|
253
|
+
</wally-dropdown-menu-trigger>
|
|
254
|
+
|
|
255
|
+
<wally-dropdown-menu-content>
|
|
256
|
+
<wally-dropdown-menu-item (click)="onEdit()">
|
|
257
|
+
Edit
|
|
258
|
+
</wally-dropdown-menu-item>
|
|
259
|
+
<wally-dropdown-menu-item (click)="onDuplicate()">
|
|
260
|
+
Duplicate
|
|
261
|
+
</wally-dropdown-menu-item>
|
|
262
|
+
<wally-dropdown-menu-separator></wally-dropdown-menu-separator>
|
|
263
|
+
<wally-dropdown-menu-item (click)="onArchive()">
|
|
264
|
+
Archive
|
|
265
|
+
</wally-dropdown-menu-item>
|
|
266
|
+
<wally-dropdown-menu-separator></wally-dropdown-menu-separator>
|
|
267
|
+
<wally-dropdown-menu-item (click)="onDelete()">
|
|
268
|
+
<span class="text-red-600 dark:text-red-400">Delete</span>
|
|
269
|
+
</wally-dropdown-menu-item>
|
|
270
|
+
</wally-dropdown-menu-content>
|
|
271
|
+
</wally-dropdown-menu>`,
|
|
272
|
+
|
|
273
|
+
componentTs: `import { Component } from '@angular/core';
|
|
274
|
+
|
|
275
|
+
@Component({
|
|
276
|
+
selector: 'app-example',
|
|
277
|
+
templateUrl: './example.html'
|
|
278
|
+
})
|
|
279
|
+
export class ExampleComponent {
|
|
280
|
+
onProfile(): void {
|
|
281
|
+
console.log('Navigate to profile');
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
onSettings(): void {
|
|
285
|
+
console.log('Navigate to settings');
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
onLogout(): void {
|
|
289
|
+
console.log('User logged out');
|
|
290
|
+
}
|
|
291
|
+
}`,
|
|
292
|
+
|
|
293
|
+
realWorldExample: `<!-- User Account Dropdown -->
|
|
294
|
+
<wally-dropdown-menu>
|
|
295
|
+
<wally-dropdown-menu-trigger>
|
|
296
|
+
<wally-button variant="ghost" [rounded]="true">
|
|
297
|
+
<img src="avatar.jpg" alt="User" class="size-8 rounded-full" />
|
|
298
|
+
</wally-button>
|
|
299
|
+
</wally-dropdown-menu-trigger>
|
|
300
|
+
|
|
301
|
+
<wally-dropdown-menu-content>
|
|
302
|
+
<wally-dropdown-menu-label>
|
|
303
|
+
john@example.com
|
|
304
|
+
</wally-dropdown-menu-label>
|
|
305
|
+
<wally-dropdown-menu-separator></wally-dropdown-menu-separator>
|
|
306
|
+
|
|
307
|
+
<wally-dropdown-menu-group [ariaLabel]="'Account actions'">
|
|
308
|
+
<wally-dropdown-menu-item (click)="onProfile()">
|
|
309
|
+
<div class="flex items-center gap-3">
|
|
310
|
+
<svg class="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
311
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
312
|
+
d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
|
|
313
|
+
</svg>
|
|
314
|
+
<span>Profile</span>
|
|
315
|
+
</div>
|
|
316
|
+
</wally-dropdown-menu-item>
|
|
317
|
+
<wally-dropdown-menu-item (click)="onBilling()">
|
|
318
|
+
<div class="flex items-center gap-3">
|
|
319
|
+
<svg class="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
320
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
321
|
+
d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />
|
|
322
|
+
</svg>
|
|
323
|
+
<span>Billing</span>
|
|
324
|
+
</div>
|
|
325
|
+
</wally-dropdown-menu-item>
|
|
326
|
+
<wally-dropdown-menu-item (click)="onSettings()">
|
|
327
|
+
<div class="flex items-center gap-3">
|
|
328
|
+
<svg class="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
329
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
330
|
+
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
|
331
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
332
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
|
333
|
+
</svg>
|
|
334
|
+
<span>Settings</span>
|
|
335
|
+
</div>
|
|
336
|
+
</wally-dropdown-menu-item>
|
|
337
|
+
</wally-dropdown-menu-group>
|
|
338
|
+
|
|
339
|
+
<wally-dropdown-menu-separator></wally-dropdown-menu-separator>
|
|
340
|
+
|
|
341
|
+
<wally-dropdown-menu-item (click)="onLogout()">
|
|
342
|
+
<div class="flex items-center gap-3">
|
|
343
|
+
<svg class="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
344
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
345
|
+
d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
|
|
346
|
+
</svg>
|
|
347
|
+
<span>Log out</span>
|
|
348
|
+
</div>
|
|
349
|
+
</wally-dropdown-menu-item>
|
|
350
|
+
</wally-dropdown-menu-content>
|
|
351
|
+
</wally-dropdown-menu>`,
|
|
352
|
+
|
|
353
|
+
nestedSubmenuExample: `<wally-dropdown-menu>
|
|
354
|
+
<wally-dropdown-menu-trigger>
|
|
355
|
+
<wally-button variant="outline">Advanced</wally-button>
|
|
356
|
+
</wally-dropdown-menu-trigger>
|
|
357
|
+
|
|
358
|
+
<wally-dropdown-menu-content>
|
|
359
|
+
<wally-dropdown-menu-item (click)="onNew()">
|
|
360
|
+
New
|
|
361
|
+
</wally-dropdown-menu-item>
|
|
362
|
+
|
|
363
|
+
<wally-dropdown-menu-sub>
|
|
364
|
+
<wally-dropdown-menu-sub-trigger>
|
|
365
|
+
<span>Import</span>
|
|
366
|
+
</wally-dropdown-menu-sub-trigger>
|
|
367
|
+
<wally-dropdown-menu-sub-content>
|
|
368
|
+
<wally-dropdown-menu-item (click)="onImportJSON()">
|
|
369
|
+
JSON
|
|
370
|
+
</wally-dropdown-menu-item>
|
|
371
|
+
<wally-dropdown-menu-item (click)="onImportCSV()">
|
|
372
|
+
CSV
|
|
373
|
+
</wally-dropdown-menu-item>
|
|
374
|
+
<wally-dropdown-menu-item (click)="onImportXML()">
|
|
375
|
+
XML
|
|
376
|
+
</wally-dropdown-menu-item>
|
|
377
|
+
</wally-dropdown-menu-sub-content>
|
|
378
|
+
</wally-dropdown-menu-sub>
|
|
379
|
+
|
|
380
|
+
<wally-dropdown-menu-sub>
|
|
381
|
+
<wally-dropdown-menu-sub-trigger>
|
|
382
|
+
<span>Export</span>
|
|
383
|
+
</wally-dropdown-menu-sub-trigger>
|
|
384
|
+
<wally-dropdown-menu-sub-content>
|
|
385
|
+
<wally-dropdown-menu-item (click)="onExportJSON()">
|
|
386
|
+
JSON
|
|
387
|
+
</wally-dropdown-menu-item>
|
|
388
|
+
<wally-dropdown-menu-item (click)="onExportCSV()">
|
|
389
|
+
CSV
|
|
390
|
+
</wally-dropdown-menu-item>
|
|
391
|
+
<wally-dropdown-menu-item (click)="onExportPDF()">
|
|
392
|
+
PDF
|
|
393
|
+
</wally-dropdown-menu-item>
|
|
394
|
+
</wally-dropdown-menu-sub-content>
|
|
395
|
+
</wally-dropdown-menu-sub>
|
|
396
|
+
|
|
397
|
+
<wally-dropdown-menu-separator></wally-dropdown-menu-separator>
|
|
398
|
+
|
|
399
|
+
<wally-dropdown-menu-item (click)="onClose()">
|
|
400
|
+
Close
|
|
401
|
+
</wally-dropdown-menu-item>
|
|
402
|
+
</wally-dropdown-menu-content>
|
|
403
|
+
</wally-dropdown-menu>`
|
|
404
|
+
};
|