@exhaustive-ui/mcp 0.0.0-stage → 3.0.0-alpha.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/LICENSE +23 -0
- package/README.md +167 -2
- package/data/components/accordion.md +421 -0
- package/data/components/animateonscroll.md +163 -0
- package/data/components/autocomplete.md +1077 -0
- package/data/components/autofocus.md +38 -0
- package/data/components/avatar.md +417 -0
- package/data/components/badge.md +234 -0
- package/data/components/blockui.md +108 -0
- package/data/components/breadcrumb.md +178 -0
- package/data/components/button.md +774 -0
- package/data/components/card.md +138 -0
- package/data/components/carousel.md +440 -0
- package/data/components/cascadeselect.md +1387 -0
- package/data/components/chart.md +1178 -0
- package/data/components/checkbox.md +529 -0
- package/data/components/chip.md +180 -0
- package/data/components/colorpicker.md +301 -0
- package/data/components/confirmdialog.md +287 -0
- package/data/components/confirmpopup.md +417 -0
- package/data/components/contextmenu.md +491 -0
- package/data/components/dataview.md +600 -0
- package/data/components/datepicker.md +1262 -0
- package/data/components/dialog.md +622 -0
- package/data/components/divider.md +250 -0
- package/data/components/dock.md +500 -0
- package/data/components/dragdrop.md +285 -0
- package/data/components/drawer.md +510 -0
- package/data/components/dynamicdialog.md +109 -0
- package/data/components/editor.md +291 -0
- package/data/components/fieldset.md +182 -0
- package/data/components/fileupload.md +430 -0
- package/data/components/floatlabel.md +155 -0
- package/data/components/fluid.md +72 -0
- package/data/components/focustrap.md +65 -0
- package/data/components/galleria.md +627 -0
- package/data/components/iconfield.md +246 -0
- package/data/components/iftalabel.md +105 -0
- package/data/components/imagecompare.md +97 -0
- package/data/components/inplace.md +233 -0
- package/data/components/inputgroup.md +306 -0
- package/data/components/inputmask.md +518 -0
- package/data/components/inputnumber.md +675 -0
- package/data/components/inputotp.md +336 -0
- package/data/components/inputtext.md +488 -0
- package/data/components/keyfilter.md +85 -0
- package/data/components/knob.md +462 -0
- package/data/components/listbox.md +798 -0
- package/data/components/llms.md +28 -0
- package/data/components/megamenu.md +587 -0
- package/data/components/menu.md +483 -0
- package/data/components/menubar.md +462 -0
- package/data/components/message.md +449 -0
- package/data/components/metergroup.md +241 -0
- package/data/components/multiselect.md +1047 -0
- package/data/components/orderlist.md +342 -0
- package/data/components/organizationchart.md +197 -0
- package/data/components/overlay.md +217 -0
- package/data/components/paginator.md +314 -0
- package/data/components/panel.md +214 -0
- package/data/components/panelmenu.md +699 -0
- package/data/components/password.md +570 -0
- package/data/components/picklist.md +420 -0
- package/data/components/popover.md +378 -0
- package/data/components/progressbar.md +181 -0
- package/data/components/progressspinner.md +91 -0
- package/data/components/radiobutton.md +377 -0
- package/data/components/rating.md +312 -0
- package/data/components/ripple.md +89 -0
- package/data/components/scroller.md +122 -0
- package/data/components/scrollpanel.md +149 -0
- package/data/components/scrolltop.md +105 -0
- package/data/components/select.md +1206 -0
- package/data/components/selectbutton.md +356 -0
- package/data/components/skeleton.md +242 -0
- package/data/components/slider.md +337 -0
- package/data/components/speeddial.md +589 -0
- package/data/components/splitbutton.md +945 -0
- package/data/components/splitter.md +196 -0
- package/data/components/stepper.md +411 -0
- package/data/components/styleclass.md +126 -0
- package/data/components/table.md +4557 -0
- package/data/components/tabs.md +467 -0
- package/data/components/tag.md +200 -0
- package/data/components/terminal.md +118 -0
- package/data/components/textarea.md +416 -0
- package/data/components/tieredmenu.md +578 -0
- package/data/components/timeline.md +310 -0
- package/data/components/toast.md +596 -0
- package/data/components/togglebutton.md +356 -0
- package/data/components/toggleswitch.md +285 -0
- package/data/components/toolbar.md +182 -0
- package/data/components/tooltip.md +211 -0
- package/data/components/tree.md +746 -0
- package/data/components/treeselect.md +912 -0
- package/data/components/treetable.md +2814 -0
- package/data/components.json +43751 -0
- package/data/llms-full.txt +47433 -0
- package/data/llms.txt +121 -0
- package/data/manifest.json +46513 -0
- package/data/pages/accessibility.md +28 -0
- package/data/pages/animations.md +28 -0
- package/data/pages/configuration.md +210 -0
- package/data/pages/contribution.md +20 -0
- package/data/pages/customicons.md +20 -0
- package/data/pages/faq.md +20 -0
- package/data/pages/icons.md +66 -0
- package/data/pages/installation.md +71 -0
- package/data/pages/llms.md +61 -0
- package/data/pages/passthrough.md +32 -0
- package/data/pages/philosophy.md +28 -0
- package/data/pages/primeflex.md +20 -0
- package/data/pages/rtl.md +12 -0
- package/data/pages/styled.md +132 -0
- package/data/pages/tailwind.md +40 -0
- package/data/pages/unstyled.md +39 -0
- package/data/snapshot.json +9 -0
- package/dist/index.d.mts +448 -0
- package/dist/index.mjs +2501 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +67 -3
|
@@ -0,0 +1,945 @@
|
|
|
1
|
+
# Angular SplitButton Component
|
|
2
|
+
|
|
3
|
+
SplitButton groups a set of commands in an overlay with a default action item.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader SplitButton component renders two native button elements, main button uses the label property to define aria-label by default which can be customized with buttonProps . Dropdown button requires an explicit definition to describe it using menuButtonProps option and also includes aria-haspopup , aria-expanded for states along with aria-controls to define the relation between the popup and the button. The popup overlay uses menu role on the list and each action item has a menuitem role with an aria-label as the menuitem label. The id of the menu refers to the aria-controls of the dropdown button.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
SplitButton has a default action button and a collection of additional options defined by the model property based on MenuModel API.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component, inject } from '@angular/core';
|
|
15
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
16
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
17
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
template: `
|
|
21
|
+
<div class="card flex justify-center">
|
|
22
|
+
<p-toast />
|
|
23
|
+
<p-splitbutton label="Save" (onClick)="save()" [model]="items" />
|
|
24
|
+
</div>
|
|
25
|
+
`,
|
|
26
|
+
standalone: true,
|
|
27
|
+
imports: [SplitButtonModule, ToastModule],
|
|
28
|
+
providers: [MessageService]
|
|
29
|
+
})
|
|
30
|
+
export class SplitbuttonBasicDemo {
|
|
31
|
+
private messageService = inject(MessageService);
|
|
32
|
+
|
|
33
|
+
constructor() {
|
|
34
|
+
this.items = [
|
|
35
|
+
{
|
|
36
|
+
label: 'Update',
|
|
37
|
+
command: () => {
|
|
38
|
+
this.update();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: 'Delete',
|
|
43
|
+
command: () => {
|
|
44
|
+
this.delete();
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
48
|
+
{ separator: true },
|
|
49
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
save() {
|
|
54
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Saved' });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
update() {
|
|
58
|
+
this.messageService.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated' });
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
delete() {
|
|
62
|
+
this.messageService.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted' });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Disabled
|
|
68
|
+
|
|
69
|
+
When the disabled attribute is present, the element is uneditable and unfocused. Additionally, the disabled states of the button and menu button can be handled independently. The button is disabled when buttonDisabled is present, and the menu button is disabled when menuButtonDisabled is present.
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { Component, inject } from '@angular/core';
|
|
73
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
74
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
75
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
76
|
+
|
|
77
|
+
@Component({
|
|
78
|
+
template: `
|
|
79
|
+
<div class="card flex justify-center">
|
|
80
|
+
<p-toast />
|
|
81
|
+
<p-splitbutton label="Save" icon="pi pi-plus" (onClick)="save('info')" [model]="items" [disabled]="true" />
|
|
82
|
+
</div>
|
|
83
|
+
`,
|
|
84
|
+
standalone: true,
|
|
85
|
+
imports: [SplitButtonModule, ToastModule],
|
|
86
|
+
providers: [MessageService]
|
|
87
|
+
})
|
|
88
|
+
export class SplitbuttonDisabledDemo {
|
|
89
|
+
private messageService = inject(MessageService);
|
|
90
|
+
|
|
91
|
+
constructor() {
|
|
92
|
+
this.items = [
|
|
93
|
+
{
|
|
94
|
+
label: 'Update',
|
|
95
|
+
command: () => {
|
|
96
|
+
this.update();
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: 'Delete',
|
|
101
|
+
command: () => {
|
|
102
|
+
this.delete();
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
106
|
+
{ separator: true },
|
|
107
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
save(severity: string) {
|
|
112
|
+
this.messageService.add({ severity: severity, summary: 'Success', detail: 'Data Saved' });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
update() {
|
|
116
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Updated' });
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
delete() {
|
|
120
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Deleted' });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Icons
|
|
126
|
+
|
|
127
|
+
The buttons and menuitems have support to display icons.
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import { Component, inject } from '@angular/core';
|
|
131
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
132
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
133
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
134
|
+
|
|
135
|
+
@Component({
|
|
136
|
+
template: `
|
|
137
|
+
<div class="card flex justify-center">
|
|
138
|
+
<p-toast />
|
|
139
|
+
<p-splitbutton label="Save" icon="pi pi-check" dropdownIcon="pi pi-cog" [model]="items" />
|
|
140
|
+
</div>
|
|
141
|
+
`,
|
|
142
|
+
standalone: true,
|
|
143
|
+
imports: [SplitButtonModule, ToastModule],
|
|
144
|
+
providers: [MessageService]
|
|
145
|
+
})
|
|
146
|
+
export class SplitbuttonIconsDemo {
|
|
147
|
+
private messageService = inject(MessageService);
|
|
148
|
+
items: MenuItem[];
|
|
149
|
+
|
|
150
|
+
constructor() {
|
|
151
|
+
this.items = [
|
|
152
|
+
{
|
|
153
|
+
label: 'Update',
|
|
154
|
+
icon: 'pi pi-refresh',
|
|
155
|
+
command: () => {
|
|
156
|
+
this.messageService.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
label: 'Delete',
|
|
161
|
+
icon: 'pi pi-times',
|
|
162
|
+
command: () => {
|
|
163
|
+
this.messageService.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
separator: true
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
label: 'Quit',
|
|
171
|
+
icon: 'pi pi-power-off',
|
|
172
|
+
command: () => {
|
|
173
|
+
window.open('https://angular.io/', '_blank');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Nested
|
|
182
|
+
|
|
183
|
+
SplitButton has a default action button and a collection of additional options defined by the model property based on MenuModel API.
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
import { Component, inject } from '@angular/core';
|
|
187
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
188
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
189
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
190
|
+
|
|
191
|
+
@Component({
|
|
192
|
+
template: `
|
|
193
|
+
<div class="card flex justify-center">
|
|
194
|
+
<p-toast />
|
|
195
|
+
<p-splitbutton label="Save" (onClick)="save('info')" [model]="items" />
|
|
196
|
+
</div>
|
|
197
|
+
`,
|
|
198
|
+
standalone: true,
|
|
199
|
+
imports: [SplitButtonModule, ToastModule],
|
|
200
|
+
providers: [MessageService]
|
|
201
|
+
})
|
|
202
|
+
export class SplitbuttonNestedDemo {
|
|
203
|
+
private messageService = inject(MessageService);
|
|
204
|
+
items: MenuItem[];
|
|
205
|
+
|
|
206
|
+
constructor() {
|
|
207
|
+
this.items = [
|
|
208
|
+
{
|
|
209
|
+
label: 'File',
|
|
210
|
+
icon: 'pi pi-fw pi-file',
|
|
211
|
+
items: [
|
|
212
|
+
{
|
|
213
|
+
label: 'New',
|
|
214
|
+
icon: 'pi pi-fw pi-plus',
|
|
215
|
+
items: [
|
|
216
|
+
{
|
|
217
|
+
label: 'Bookmark',
|
|
218
|
+
icon: 'pi pi-fw pi-bookmark'
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
label: 'Video',
|
|
222
|
+
icon: 'pi pi-fw pi-video'
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
label: 'Delete',
|
|
228
|
+
icon: 'pi pi-fw pi-trash'
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
separator: true
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
label: 'Export',
|
|
235
|
+
icon: 'pi pi-fw pi-external-link'
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
label: 'Edit',
|
|
241
|
+
icon: 'pi pi-fw pi-pencil',
|
|
242
|
+
items: [
|
|
243
|
+
{
|
|
244
|
+
label: 'Left',
|
|
245
|
+
icon: 'pi pi-fw pi-align-left'
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
label: 'Right',
|
|
249
|
+
icon: 'pi pi-fw pi-align-right'
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
label: 'Center',
|
|
253
|
+
icon: 'pi pi-fw pi-align-center'
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
label: 'Justify',
|
|
257
|
+
icon: 'pi pi-fw pi-align-justify'
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
label: 'Users',
|
|
263
|
+
icon: 'pi pi-fw pi-user',
|
|
264
|
+
items: [
|
|
265
|
+
{
|
|
266
|
+
label: 'New',
|
|
267
|
+
icon: 'pi pi-fw pi-user-plus'
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
label: 'Delete',
|
|
271
|
+
icon: 'pi pi-fw pi-user-minus'
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
label: 'Search',
|
|
275
|
+
icon: 'pi pi-fw pi-users',
|
|
276
|
+
items: [
|
|
277
|
+
{
|
|
278
|
+
label: 'Filter',
|
|
279
|
+
icon: 'pi pi-fw pi-filter',
|
|
280
|
+
items: [
|
|
281
|
+
{
|
|
282
|
+
label: 'Print',
|
|
283
|
+
icon: 'pi pi-fw pi-print'
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
icon: 'pi pi-fw pi-bars',
|
|
289
|
+
label: 'List'
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
label: 'Events',
|
|
297
|
+
icon: 'pi pi-fw pi-calendar',
|
|
298
|
+
items: [
|
|
299
|
+
{
|
|
300
|
+
label: 'Edit',
|
|
301
|
+
icon: 'pi pi-fw pi-pencil',
|
|
302
|
+
items: [
|
|
303
|
+
{
|
|
304
|
+
label: 'Save',
|
|
305
|
+
icon: 'pi pi-fw pi-calendar-plus'
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
label: 'Delete',
|
|
309
|
+
icon: 'pi pi-fw pi-calendar-minus'
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
label: 'Archieve',
|
|
315
|
+
icon: 'pi pi-fw pi-calendar-times',
|
|
316
|
+
items: [
|
|
317
|
+
{
|
|
318
|
+
label: 'Remove',
|
|
319
|
+
icon: 'pi pi-fw pi-calendar-minus'
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
]
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
separator: true
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
label: 'Quit',
|
|
330
|
+
icon: 'pi pi-fw pi-power-off'
|
|
331
|
+
}
|
|
332
|
+
];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
save(severity: string) {
|
|
336
|
+
this.messageService.add({ severity: severity, summary: 'Success', detail: 'Data Saved' });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Outlined
|
|
342
|
+
|
|
343
|
+
Outlined buttons display a border without a background initially.
|
|
344
|
+
|
|
345
|
+
```typescript
|
|
346
|
+
import { Component, inject } from '@angular/core';
|
|
347
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
348
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
349
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
350
|
+
|
|
351
|
+
@Component({
|
|
352
|
+
template: `
|
|
353
|
+
<div class="card flex justify-center flex-wrap gap-4">
|
|
354
|
+
<p-toast />
|
|
355
|
+
<p-splitbutton label="Primary" [model]="items" (onClick)="save('info')" outlined />
|
|
356
|
+
<p-splitbutton label="Secondary" [model]="items" (onClick)="save('info')" outlined severity="secondary" />
|
|
357
|
+
<p-splitbutton label="Success" [model]="items" (onClick)="save('info')" outlined severity="success" />
|
|
358
|
+
<p-splitbutton label="Info" [model]="items" (onClick)="save('info')" outlined severity="info" />
|
|
359
|
+
<p-splitbutton label="Warning" [model]="items" (onClick)="save('info')" outlined severity="warn" />
|
|
360
|
+
<p-splitbutton label="Help" [model]="items" (onClick)="save('info')" outlined severity="help" />
|
|
361
|
+
<p-splitbutton label="Danger" [model]="items" (onClick)="save('info')" outlined severity="danger" />
|
|
362
|
+
<p-splitbutton label="Contrast" [model]="items" (onClick)="save('info')" outlined severity="contrast" />
|
|
363
|
+
</div>
|
|
364
|
+
`,
|
|
365
|
+
standalone: true,
|
|
366
|
+
imports: [SplitButtonModule, ToastModule],
|
|
367
|
+
providers: [MessageService]
|
|
368
|
+
})
|
|
369
|
+
export class SplitbuttonOutlinedDemo {
|
|
370
|
+
private messageService = inject(MessageService);
|
|
371
|
+
items: MenuItem[];
|
|
372
|
+
|
|
373
|
+
constructor() {
|
|
374
|
+
this.items = [
|
|
375
|
+
{
|
|
376
|
+
label: 'Update',
|
|
377
|
+
command: () => {
|
|
378
|
+
this.update();
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
label: 'Delete',
|
|
383
|
+
command: () => {
|
|
384
|
+
this.delete();
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
388
|
+
{ separator: true },
|
|
389
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
390
|
+
];
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
save(severity: string) {
|
|
394
|
+
this.messageService.add({ severity: severity, summary: 'Success', detail: 'Data Saved' });
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
update() {
|
|
398
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Updated' });
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
delete() {
|
|
402
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Deleted' });
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## Raised
|
|
408
|
+
|
|
409
|
+
Raised buttons display a shadow to indicate elevation.
|
|
410
|
+
|
|
411
|
+
```typescript
|
|
412
|
+
import { Component, inject } from '@angular/core';
|
|
413
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
414
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
415
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
416
|
+
|
|
417
|
+
@Component({
|
|
418
|
+
template: `
|
|
419
|
+
<div class="card flex justify-center flex-wrap gap-4">
|
|
420
|
+
<p-toast />
|
|
421
|
+
<p-splitbutton label="Primary" [model]="items" (onClick)="save('info')" raised />
|
|
422
|
+
<p-splitbutton label="Secondary" [model]="items" (onClick)="save('info')" raised severity="secondary" />
|
|
423
|
+
<p-splitbutton label="Success" [model]="items" (onClick)="save('info')" raised severity="success" />
|
|
424
|
+
<p-splitbutton label="Info" [model]="items" (onClick)="save('info')" raised severity="info" />
|
|
425
|
+
<p-splitbutton label="Warning" [model]="items" (onClick)="save('info')" raised severity="warn" />
|
|
426
|
+
<p-splitbutton label="Help" [model]="items" (onClick)="save('info')" raised severity="help" />
|
|
427
|
+
<p-splitbutton label="Danger" [model]="items" (onClick)="save('info')" raised severity="danger" />
|
|
428
|
+
<p-splitbutton label="Contrast" (onClick)="save('info')" [model]="items" severity="contrast" />
|
|
429
|
+
</div>
|
|
430
|
+
`,
|
|
431
|
+
standalone: true,
|
|
432
|
+
imports: [SplitButtonModule, ToastModule],
|
|
433
|
+
providers: [MessageService]
|
|
434
|
+
})
|
|
435
|
+
export class SplitbuttonRaisedDemo {
|
|
436
|
+
private messageService = inject(MessageService);
|
|
437
|
+
items: MenuItem[];
|
|
438
|
+
|
|
439
|
+
constructor() {
|
|
440
|
+
this.items = [
|
|
441
|
+
{
|
|
442
|
+
label: 'Update',
|
|
443
|
+
command: () => {
|
|
444
|
+
this.update();
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
label: 'Delete',
|
|
449
|
+
command: () => {
|
|
450
|
+
this.delete();
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
454
|
+
{ separator: true },
|
|
455
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
456
|
+
];
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
save(severity: string) {
|
|
460
|
+
this.messageService.add({ severity: severity, summary: 'Success', detail: 'Data Saved' });
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
update() {
|
|
464
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Updated' });
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
delete() {
|
|
468
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Deleted' });
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
## Raised Text
|
|
474
|
+
|
|
475
|
+
Text buttons can be displayed as raised as well for elevation.
|
|
476
|
+
|
|
477
|
+
```typescript
|
|
478
|
+
import { Component, inject } from '@angular/core';
|
|
479
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
480
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
481
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
482
|
+
|
|
483
|
+
@Component({
|
|
484
|
+
template: `
|
|
485
|
+
<div class="card flex justify-center flex-wrap gap-4">
|
|
486
|
+
<p-toast />
|
|
487
|
+
<p-splitbutton label="Primary" [model]="items" (onClick)="save('info')" raised text />
|
|
488
|
+
<p-splitbutton label="Secondary" [model]="items" (onClick)="save('info')" raised text severity="secondary" />
|
|
489
|
+
<p-splitbutton label="Success" [model]="items" (onClick)="save('info')" raised text severity="success" />
|
|
490
|
+
<p-splitbutton label="Info" [model]="items" (onClick)="save('info')" raised text severity="info" />
|
|
491
|
+
<p-splitbutton label="Warning" [model]="items" (onClick)="save('info')" raised text severity="warn" />
|
|
492
|
+
<p-splitbutton label="Help" [model]="items" (onClick)="save('info')" raised text severity="help" />
|
|
493
|
+
<p-splitbutton label="Danger" [model]="items" (onClick)="save('info')" raised text severity="danger" />
|
|
494
|
+
<p-splitbutton label="Contrast" [model]="items" (onClick)="save('info')" raised text severity="contrast" />
|
|
495
|
+
</div>
|
|
496
|
+
`,
|
|
497
|
+
standalone: true,
|
|
498
|
+
imports: [SplitButtonModule, ToastModule],
|
|
499
|
+
providers: [MessageService]
|
|
500
|
+
})
|
|
501
|
+
export class SplitbuttonRaisedtextDemo {
|
|
502
|
+
private messageService = inject(MessageService);
|
|
503
|
+
items: MenuItem[];
|
|
504
|
+
|
|
505
|
+
constructor() {
|
|
506
|
+
this.items = [
|
|
507
|
+
{
|
|
508
|
+
label: 'Update',
|
|
509
|
+
command: () => {
|
|
510
|
+
this.update();
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
label: 'Delete',
|
|
515
|
+
command: () => {
|
|
516
|
+
this.delete();
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
520
|
+
{ separator: true },
|
|
521
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
522
|
+
];
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
save(severity: string) {
|
|
526
|
+
this.messageService.add({ severity: severity, summary: 'Success', detail: 'Data Saved' });
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
update() {
|
|
530
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Updated' });
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
delete() {
|
|
534
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Deleted' });
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
## reversedkeys-doc
|
|
540
|
+
|
|
541
|
+
Following keys are reserved in the preset scheme and cannot be used as a token name; primitive , semantic , components , directives , colorscheme , light , dark , common , root , states and extend .
|
|
542
|
+
|
|
543
|
+
## Rounded
|
|
544
|
+
|
|
545
|
+
Rounded buttons have a circular border radius.
|
|
546
|
+
|
|
547
|
+
```typescript
|
|
548
|
+
import { Component, inject } from '@angular/core';
|
|
549
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
550
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
551
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
552
|
+
|
|
553
|
+
@Component({
|
|
554
|
+
template: `
|
|
555
|
+
<div class="card flex justify-center flex-wrap gap-4">
|
|
556
|
+
<p-toast />
|
|
557
|
+
<p-splitbutton label="Primary" [model]="items" (onClick)="save('info')" rounded />
|
|
558
|
+
<p-splitbutton label="Secondary" [model]="items" (onClick)="save('info')" rounded severity="secondary" />
|
|
559
|
+
<p-splitbutton label="Success" [model]="items" (onClick)="save('info')" rounded severity="success" />
|
|
560
|
+
<p-splitbutton label="Info" [model]="items" (onClick)="save('info')" rounded severity="info" />
|
|
561
|
+
<p-splitbutton label="Warning" [model]="items" (onClick)="save('info')" rounded severity="warn" />
|
|
562
|
+
<p-splitbutton label="Help" [model]="items" (onClick)="save('info')" rounded severity="help" />
|
|
563
|
+
<p-splitbutton label="Danger" [model]="items" (onClick)="save('info')" rounded severity="danger" />
|
|
564
|
+
<p-splitbutton label="Contrast" [model]="items" (onClick)="save('info')" rounded severity="contrast" />
|
|
565
|
+
</div>
|
|
566
|
+
`,
|
|
567
|
+
standalone: true,
|
|
568
|
+
imports: [SplitButtonModule, ToastModule],
|
|
569
|
+
providers: [MessageService]
|
|
570
|
+
})
|
|
571
|
+
export class SplitbuttonRoundedDemo {
|
|
572
|
+
private messageService = inject(MessageService);
|
|
573
|
+
items: MenuItem[];
|
|
574
|
+
|
|
575
|
+
constructor() {
|
|
576
|
+
this.items = [
|
|
577
|
+
{
|
|
578
|
+
label: 'Update',
|
|
579
|
+
command: () => {
|
|
580
|
+
this.update();
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
label: 'Delete',
|
|
585
|
+
command: () => {
|
|
586
|
+
this.delete();
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
590
|
+
{ separator: true },
|
|
591
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
592
|
+
];
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
save(severity: string) {
|
|
596
|
+
this.messageService.add({ severity: severity, summary: 'Success', detail: 'Data Saved' });
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
update() {
|
|
600
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Updated' });
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
delete() {
|
|
604
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Deleted' });
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
## Severity
|
|
610
|
+
|
|
611
|
+
The severity property defines the type of button.
|
|
612
|
+
|
|
613
|
+
```typescript
|
|
614
|
+
import { Component, inject } from '@angular/core';
|
|
615
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
616
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
617
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
618
|
+
|
|
619
|
+
@Component({
|
|
620
|
+
template: `
|
|
621
|
+
<div class="card flex justify-center flex-wrap gap-4">
|
|
622
|
+
<p-toast />
|
|
623
|
+
<p-splitbutton label="Save" (onClick)="save()" [model]="items" />
|
|
624
|
+
<p-splitbutton label="Save" (onClick)="save()" [model]="items" severity="secondary" />
|
|
625
|
+
<p-splitbutton label="Save" (onClick)="save()" [model]="items" severity="success" />
|
|
626
|
+
<p-splitbutton label="Save" (onClick)="save()" [model]="items" severity="info" />
|
|
627
|
+
<p-splitbutton label="Save" (onClick)="save()" [model]="items" severity="warn" />
|
|
628
|
+
<p-splitbutton label="Save" (onClick)="save()" [model]="items" severity="help" />
|
|
629
|
+
<p-splitbutton label="Save" (onClick)="save()" [model]="items" severity="danger" />
|
|
630
|
+
<p-splitbutton label="Save" (onClick)="save()" [model]="items" severity="contrast" />
|
|
631
|
+
</div>
|
|
632
|
+
`,
|
|
633
|
+
standalone: true,
|
|
634
|
+
imports: [SplitButtonModule, ToastModule],
|
|
635
|
+
providers: [MessageService]
|
|
636
|
+
})
|
|
637
|
+
export class SplitbuttonSeverityDemo {
|
|
638
|
+
private messageService = inject(MessageService);
|
|
639
|
+
items: MenuItem[];
|
|
640
|
+
|
|
641
|
+
constructor() {
|
|
642
|
+
this.items = [
|
|
643
|
+
{
|
|
644
|
+
label: 'Update',
|
|
645
|
+
command: () => {
|
|
646
|
+
this.update();
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
label: 'Delete',
|
|
651
|
+
command: () => {
|
|
652
|
+
this.delete();
|
|
653
|
+
}
|
|
654
|
+
},
|
|
655
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
656
|
+
{ separator: true },
|
|
657
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
658
|
+
];
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
save() {
|
|
662
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Saved' });
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
update() {
|
|
666
|
+
this.messageService.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated' });
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
delete() {
|
|
670
|
+
this.messageService.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted' });
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
## Sizes
|
|
676
|
+
|
|
677
|
+
SplitButton provides small and large sizes as alternatives to the standard.
|
|
678
|
+
|
|
679
|
+
```typescript
|
|
680
|
+
import { Component, inject } from '@angular/core';
|
|
681
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
682
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
683
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
684
|
+
|
|
685
|
+
@Component({
|
|
686
|
+
template: `
|
|
687
|
+
<div class="card flex flex-wrap justify-center items-center gap-4">
|
|
688
|
+
<p-toast />
|
|
689
|
+
<p-splitbutton label="Small" [model]="items" (onClick)="save('info')" size="small" />
|
|
690
|
+
<p-splitbutton label="Normal" [model]="items" (onClick)="save('info')" />
|
|
691
|
+
<p-splitbutton label="Large" [model]="items" (onClick)="save('info')" size="large" />
|
|
692
|
+
</div>
|
|
693
|
+
`,
|
|
694
|
+
standalone: true,
|
|
695
|
+
imports: [SplitButtonModule, ToastModule],
|
|
696
|
+
providers: [MessageService]
|
|
697
|
+
})
|
|
698
|
+
export class SplitbuttonSizesDemo {
|
|
699
|
+
private messageService = inject(MessageService);
|
|
700
|
+
|
|
701
|
+
constructor() {
|
|
702
|
+
this.items = [
|
|
703
|
+
{
|
|
704
|
+
label: 'Update',
|
|
705
|
+
command: () => {
|
|
706
|
+
this.update();
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
label: 'Delete',
|
|
711
|
+
command: () => {
|
|
712
|
+
this.delete();
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
716
|
+
{ separator: true },
|
|
717
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
718
|
+
];
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
save(severity: string) {
|
|
722
|
+
this.messageService.add({ severity: severity, summary: 'Success', detail: 'Data Saved' });
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
update() {
|
|
726
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Updated' });
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
delete() {
|
|
730
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Deleted' });
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
## Template
|
|
736
|
+
|
|
737
|
+
SplitButton has a default action button and a collection of additional options defined by the model property based on MenuModel API.
|
|
738
|
+
|
|
739
|
+
```typescript
|
|
740
|
+
import { Component, inject } from '@angular/core';
|
|
741
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
742
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
743
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
744
|
+
|
|
745
|
+
@Component({
|
|
746
|
+
template: `
|
|
747
|
+
<div class="card flex justify-center">
|
|
748
|
+
<p-toast />
|
|
749
|
+
<p-splitbutton label="Save" (onClick)="save()" severity="contrast" [model]="items">
|
|
750
|
+
<ng-template #content>
|
|
751
|
+
<span class="flex items-center font-bold">
|
|
752
|
+
<img alt="logo" src="logo-icon.svg" style="height: 1rem; margin-right: 0.5rem" />
|
|
753
|
+
<span>ExhaustiveUI</span>
|
|
754
|
+
</span>
|
|
755
|
+
</ng-template>
|
|
756
|
+
</p-splitbutton>
|
|
757
|
+
</div>
|
|
758
|
+
`,
|
|
759
|
+
standalone: true,
|
|
760
|
+
imports: [SplitButtonModule, ToastModule],
|
|
761
|
+
providers: [MessageService]
|
|
762
|
+
})
|
|
763
|
+
export class SplitbuttonTemplateDemo {
|
|
764
|
+
private messageService = inject(MessageService);
|
|
765
|
+
items: MenuItem[];
|
|
766
|
+
|
|
767
|
+
constructor() {
|
|
768
|
+
this.items = [
|
|
769
|
+
{
|
|
770
|
+
label: 'Update',
|
|
771
|
+
command: () => {
|
|
772
|
+
this.update();
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
label: 'Delete',
|
|
777
|
+
command: () => {
|
|
778
|
+
this.delete();
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
782
|
+
{ separator: true },
|
|
783
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
784
|
+
];
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
save() {
|
|
788
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Saved' });
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
update() {
|
|
792
|
+
this.messageService.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated' });
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
delete() {
|
|
796
|
+
this.messageService.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted' });
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
## Text
|
|
802
|
+
|
|
803
|
+
Text buttons are displayed as textual elements.
|
|
804
|
+
|
|
805
|
+
```typescript
|
|
806
|
+
import { Component, inject } from '@angular/core';
|
|
807
|
+
import { SplitButtonModule } from '@exhaustive-ui/core/splitbutton';
|
|
808
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
809
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
810
|
+
|
|
811
|
+
@Component({
|
|
812
|
+
template: `
|
|
813
|
+
<div class="card flex justify-center flex-wrap gap-4">
|
|
814
|
+
<p-toast />
|
|
815
|
+
<p-splitbutton label="Primary" [model]="items" (onClick)="save('info')" text />
|
|
816
|
+
<p-splitbutton label="Secondary" [model]="items" (onClick)="save('info')" text severity="secondary" />
|
|
817
|
+
<p-splitbutton label="Success" [model]="items" (onClick)="save('info')" text severity="success" />
|
|
818
|
+
<p-splitbutton label="Info" [model]="items" (onClick)="save('info')" text severity="info" />
|
|
819
|
+
<p-splitbutton label="Warning" [model]="items" (onClick)="save('info')" text severity="warn" />
|
|
820
|
+
<p-splitbutton label="Help" [model]="items" (onClick)="save('info')" text severity="help" />
|
|
821
|
+
<p-splitbutton label="Danger" [model]="items" (onClick)="save('info')" text severity="danger" />
|
|
822
|
+
<p-splitbutton label="Contrast" [model]="items" (onClick)="save('info')" text severity="contrast" />
|
|
823
|
+
</div>
|
|
824
|
+
`,
|
|
825
|
+
standalone: true,
|
|
826
|
+
imports: [SplitButtonModule, ToastModule],
|
|
827
|
+
providers: [MessageService]
|
|
828
|
+
})
|
|
829
|
+
export class SplitbuttonTextDemo {
|
|
830
|
+
private messageService = inject(MessageService);
|
|
831
|
+
items: MenuItem[];
|
|
832
|
+
|
|
833
|
+
constructor() {
|
|
834
|
+
this.items = [
|
|
835
|
+
{
|
|
836
|
+
label: 'Update',
|
|
837
|
+
command: () => {
|
|
838
|
+
this.update();
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
label: 'Delete',
|
|
843
|
+
command: () => {
|
|
844
|
+
this.delete();
|
|
845
|
+
}
|
|
846
|
+
},
|
|
847
|
+
{ label: 'Angular.dev', url: 'https://angular.dev' },
|
|
848
|
+
{ separator: true },
|
|
849
|
+
{ label: 'Upload', routerLink: ['/fileupload'] }
|
|
850
|
+
];
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
save(severity: string) {
|
|
854
|
+
this.messageService.add({ severity: severity, summary: 'Success', detail: 'Data Saved' });
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
update() {
|
|
858
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Updated' });
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
delete() {
|
|
862
|
+
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Data Deleted' });
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
```
|
|
866
|
+
|
|
867
|
+
## Split Button
|
|
868
|
+
|
|
869
|
+
SplitButton groups a set of commands in an overlay with a default command.
|
|
870
|
+
|
|
871
|
+
### Props
|
|
872
|
+
|
|
873
|
+
| Name | Type | Default | Description |
|
|
874
|
+
|------|------|---------|-------------|
|
|
875
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
876
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
877
|
+
| pt | InputSignal<SplitButtonPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
878
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
879
|
+
| model | InputSignal<MenuItem[]> | ... | MenuModel instance to define the overlay items. |
|
|
880
|
+
| severity | InputSignal<ButtonSeverity> | ... | Defines the style of the button. |
|
|
881
|
+
| raised | InputSignalWithTransform<boolean, unknown> | ... | Add a shadow to indicate elevation. |
|
|
882
|
+
| rounded | InputSignalWithTransform<boolean, unknown> | ... | Add a circular border radius to the button. |
|
|
883
|
+
| text | InputSignalWithTransform<boolean, unknown> | ... | Add a textual class to the button without a background initially. |
|
|
884
|
+
| outlined | InputSignalWithTransform<boolean, unknown> | ... | Add a border class without a background initially. |
|
|
885
|
+
| size | InputSignal<"small" \| "large"> | ... | Defines the size of the button. |
|
|
886
|
+
| icon | InputSignal<string> | ... | Name of the icon. |
|
|
887
|
+
| iconPos | InputSignal<SplitButtonIconPosition> | ... | Position of the icon. |
|
|
888
|
+
| label | InputSignal<string> | ... | Text of the button. |
|
|
889
|
+
| tooltip | InputSignal<string> | ... | Tooltip for the main button. |
|
|
890
|
+
| tooltipOptions | InputSignal<TooltipOptions> | ... | Tooltip options for the main button. |
|
|
891
|
+
| menuStyle | InputSignal<{ [klass: string]: any }> | ... | Inline style of the overlay menu. |
|
|
892
|
+
| menuStyleClass | InputSignal<string> | ... | Style class of the overlay menu. |
|
|
893
|
+
| dropdownIcon | InputSignal<string> | ... | Name of the dropdown icon. |
|
|
894
|
+
| appendTo | InputSignal<any> | 'body' | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
|
|
895
|
+
| expandAriaLabel | InputSignal<string> | ... | Defines a string that labels the expand button for accessibility. |
|
|
896
|
+
| motionOptions | InputSignal<MotionOptions> | ... | The motion options. |
|
|
897
|
+
| autofocus | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component should automatically get focus on load. |
|
|
898
|
+
| disabled | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the element should be disabled. |
|
|
899
|
+
| tabindex | InputSignalWithTransform<number, unknown> | ... | Index of the element in tabbing order. |
|
|
900
|
+
| menuButtonDisabled | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the menu button element should be disabled. |
|
|
901
|
+
| buttonDisabled | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the button element should be disabled. |
|
|
902
|
+
|
|
903
|
+
### Emits
|
|
904
|
+
|
|
905
|
+
| Name | Parameters | Description |
|
|
906
|
+
|------|------------|-------------|
|
|
907
|
+
| onClick | event: MouseEvent | Callback to invoke when default command button is clicked. |
|
|
908
|
+
| onMenuHide | value: any | Callback to invoke when overlay menu is hidden. |
|
|
909
|
+
| onMenuShow | value: any | Callback to invoke when overlay menu is shown. |
|
|
910
|
+
| onDropdownClick | event: MouseEvent | Callback to invoke when dropdown button is clicked. |
|
|
911
|
+
|
|
912
|
+
### Templates
|
|
913
|
+
|
|
914
|
+
| Name | Type | Description |
|
|
915
|
+
|------|------|-------------|
|
|
916
|
+
| content | TemplateRef<void> | Custom content template. |
|
|
917
|
+
| dropdownicon | TemplateRef<void> | Custom dropdown icon template. |
|
|
918
|
+
|
|
919
|
+
## Pass Through Options
|
|
920
|
+
|
|
921
|
+
| Name | Type | Description |
|
|
922
|
+
|------|------|-------------|
|
|
923
|
+
| root | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the root's DOM element. |
|
|
924
|
+
| pcButton | ButtonPassThrough | Used to pass attributes to the Button component. |
|
|
925
|
+
| pcDropdown | ButtonPassThrough | Used to pass attributes to the dropdown Button component. |
|
|
926
|
+
| pcMenu | MenuPassThrough | Used to pass attributes to the TieredMenu component. |
|
|
927
|
+
|
|
928
|
+
## Theming
|
|
929
|
+
|
|
930
|
+
### CSS Classes
|
|
931
|
+
|
|
932
|
+
| Class | Description |
|
|
933
|
+
|-------|-------------|
|
|
934
|
+
| p-splitbutton | Class name of the root element |
|
|
935
|
+
| p-splitbutton-button | Class name of the button element |
|
|
936
|
+
| p-splitbutton-dropdown | Class name of the dropdown element |
|
|
937
|
+
|
|
938
|
+
### Design Tokens
|
|
939
|
+
|
|
940
|
+
| Token | CSS Variable | Description |
|
|
941
|
+
|-------|--------------|-------------|
|
|
942
|
+
| splitbutton.border.radius | --p-splitbutton-border-radius | Border radius of root |
|
|
943
|
+
| splitbutton.rounded.border.radius | --p-splitbutton-rounded-border-radius | Rounded border radius of root |
|
|
944
|
+
| splitbutton.raised.shadow | --p-splitbutton-raised-shadow | Raised shadow of root |
|
|
945
|
+
|