@exhaustive-ui/mcp 22.4.0 → 22.6.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/README.md +13 -1
- package/data/cards/accordion.md +91 -0
- package/data/cards/animateonscroll.md +155 -0
- package/data/cards/autocomplete.md +109 -0
- package/data/cards/autofocus.md +36 -0
- package/data/cards/avatar.md +45 -0
- package/data/cards/badge.md +44 -0
- package/data/cards/blockui.md +51 -0
- package/data/cards/breadcrumb.md +56 -0
- package/data/cards/button.md +83 -0
- package/data/cards/card.md +49 -0
- package/data/cards/carousel.md +101 -0
- package/data/cards/cascadeselect.md +77 -0
- package/data/cards/chart.md +105 -0
- package/data/cards/checkbox.md +59 -0
- package/data/cards/chip.md +50 -0
- package/data/cards/classnames.md +91 -0
- package/data/cards/colorpicker.md +52 -0
- package/data/cards/confirmdialog.md +119 -0
- package/data/cards/confirmpopup.md +96 -0
- package/data/cards/contextmenu.md +60 -0
- package/data/cards/dataview.md +134 -0
- package/data/cards/datepicker.md +103 -0
- package/data/cards/dialog.md +89 -0
- package/data/cards/divider.md +55 -0
- package/data/cards/dock.md +106 -0
- package/data/cards/dragdrop.md +106 -0
- package/data/cards/drawer.md +62 -0
- package/data/cards/dynamicdialog.md +103 -0
- package/data/cards/editor.md +55 -0
- package/data/cards/fieldset.md +54 -0
- package/data/cards/fileinput.md +72 -0
- package/data/cards/fileupload.md +88 -0
- package/data/cards/floatlabel.md +41 -0
- package/data/cards/fluid.md +49 -0
- package/data/cards/focustrap.md +64 -0
- package/data/cards/galleria.md +94 -0
- package/data/cards/iconfield.md +45 -0
- package/data/cards/iftalabel.md +38 -0
- package/data/cards/image.md +58 -0
- package/data/cards/imagecompare.md +45 -0
- package/data/cards/inplace.md +56 -0
- package/data/cards/inputgroup.md +77 -0
- package/data/cards/inputmask.md +71 -0
- package/data/cards/inputnumber.md +78 -0
- package/data/cards/inputotp.md +60 -0
- package/data/cards/inputtext.md +41 -0
- package/data/cards/keyfilter.md +49 -0
- package/data/cards/knob.md +55 -0
- package/data/cards/listbox.md +105 -0
- package/data/cards/megamenu.md +96 -0
- package/data/cards/menu.md +64 -0
- package/data/cards/menubar.md +102 -0
- package/data/cards/message.md +51 -0
- package/data/cards/metergroup.md +53 -0
- package/data/cards/multiselect.md +115 -0
- package/data/cards/orderlist.md +96 -0
- package/data/cards/organizationchart.md +84 -0
- package/data/cards/overlay.md +63 -0
- package/data/cards/paginator.md +62 -0
- package/data/cards/panel.md +57 -0
- package/data/cards/panelmenu.md +94 -0
- package/data/cards/password.md +81 -0
- package/data/cards/picklist.md +106 -0
- package/data/cards/popover.md +53 -0
- package/data/cards/progressbar.md +42 -0
- package/data/cards/progressspinner.md +38 -0
- package/data/cards/radiobutton.md +52 -0
- package/data/cards/rating.md +56 -0
- package/data/cards/ripple.md +37 -0
- package/data/cards/scroller.md +32 -0
- package/data/cards/scrollpanel.md +50 -0
- package/data/cards/scrolltop.md +48 -0
- package/data/cards/select.md +108 -0
- package/data/cards/selectbutton.md +64 -0
- package/data/cards/skeleton.md +54 -0
- package/data/cards/slider.md +52 -0
- package/data/cards/speeddial.md +102 -0
- package/data/cards/splitbutton.md +96 -0
- package/data/cards/splitter.md +52 -0
- package/data/cards/stepper.md +125 -0
- package/data/cards/styleclass.md +46 -0
- package/data/cards/table.md +305 -0
- package/data/cards/tabs.md +97 -0
- package/data/cards/tag.md +41 -0
- package/data/cards/terminal.md +76 -0
- package/data/cards/textarea.md +45 -0
- package/data/cards/tieredmenu.md +121 -0
- package/data/cards/timeline.md +58 -0
- package/data/cards/toast.md +58 -0
- package/data/cards/togglebutton.md +59 -0
- package/data/cards/toggleswitch.md +52 -0
- package/data/cards/toolbar.md +74 -0
- package/data/cards/tooltip.md +43 -0
- package/data/cards/tree.md +93 -0
- package/data/cards/treeselect.md +98 -0
- package/data/cards/treetable.md +231 -0
- package/data/components/accordion.md +31 -23
- package/data/components/animateonscroll.md +18 -15
- package/data/components/autocomplete.md +162 -93
- package/data/components/autofocus.md +9 -7
- package/data/components/avatar.md +56 -43
- package/data/components/badge.md +27 -18
- package/data/components/blockui.md +15 -8
- package/data/components/breadcrumb.md +20 -14
- package/data/components/button.md +121 -94
- package/data/components/card.md +12 -10
- package/data/components/carousel.md +75 -53
- package/data/components/cascadeselect.md +271 -238
- package/data/components/chart.md +88 -74
- package/data/components/checkbox.md +107 -97
- package/data/components/chip.md +20 -16
- package/data/components/classnames.md +22 -4
- package/data/components/colorpicker.md +54 -36
- package/data/components/confirmdialog.md +146 -43
- package/data/components/confirmpopup.md +95 -22
- package/data/components/contextmenu.md +110 -39
- package/data/components/dataview.md +176 -83
- package/data/components/datepicker.md +171 -141
- package/data/components/dialog.md +80 -68
- package/data/components/divider.md +17 -12
- package/data/components/dock.md +65 -29
- package/data/components/dragdrop.md +26 -12
- package/data/components/drawer.md +67 -48
- package/data/components/dynamicdialog.md +22 -13
- package/data/components/editor.md +42 -33
- package/data/components/fieldset.md +20 -17
- package/data/components/fileinput.md +92 -35
- package/data/components/fileupload.md +101 -61
- package/data/components/floatlabel.md +20 -11
- package/data/components/fluid.md +11 -9
- package/data/components/focustrap.md +11 -7
- package/data/components/galleria.md +231 -90
- package/data/components/iconfield.md +23 -15
- package/data/components/iftalabel.md +15 -9
- package/data/components/image.md +31 -26
- package/data/components/imagecompare.md +8 -6
- package/data/components/inplace.md +27 -22
- package/data/components/inputgroup.md +53 -29
- package/data/components/inputmask.md +107 -85
- package/data/components/inputnumber.md +128 -90
- package/data/components/inputotp.md +55 -42
- package/data/components/inputtext.md +72 -50
- package/data/components/keyfilter.md +6 -3
- package/data/components/knob.md +70 -58
- package/data/components/listbox.md +171 -141
- package/data/components/llms.md +4 -0
- package/data/components/megamenu.md +24 -23
- package/data/components/menu.md +37 -34
- package/data/components/menubar.md +27 -22
- package/data/components/message.md +44 -32
- package/data/components/metergroup.md +48 -17
- package/data/components/multiselect.md +232 -168
- package/data/components/orderlist.md +55 -48
- package/data/components/organizationchart.md +182 -13
- package/data/components/overlay.md +31 -26
- package/data/components/paginator.md +49 -34
- package/data/components/panel.md +23 -19
- package/data/components/panelmenu.md +51 -25
- package/data/components/password.md +104 -91
- package/data/components/picklist.md +93 -71
- package/data/components/popover.md +68 -46
- package/data/components/progressbar.md +28 -22
- package/data/components/progressspinner.md +13 -11
- package/data/components/radiobutton.md +69 -35
- package/data/components/rating.md +48 -40
- package/data/components/ripple.md +8 -6
- package/data/components/scroller.md +29 -29
- package/data/components/scrollpanel.md +9 -7
- package/data/components/scrolltop.md +20 -18
- package/data/components/select.md +248 -169
- package/data/components/selectbutton.md +118 -56
- package/data/components/skeleton.md +22 -18
- package/data/components/slider.md +73 -49
- package/data/components/speeddial.md +77 -59
- package/data/components/splitbutton.md +354 -329
- package/data/components/splitter.md +22 -18
- package/data/components/stepper.md +38 -21
- package/data/components/styleclass.md +12 -6
- package/data/components/table.md +524 -315
- package/data/components/tabs.md +44 -26
- package/data/components/tag.md +18 -14
- package/data/components/terminal.md +38 -27
- package/data/components/textarea.md +82 -47
- package/data/components/tieredmenu.md +34 -29
- package/data/components/timeline.md +29 -28
- package/data/components/toast.md +115 -57
- package/data/components/togglebutton.md +53 -39
- package/data/components/toggleswitch.md +41 -28
- package/data/components/toolbar.md +19 -18
- package/data/components/tooltip.md +43 -32
- package/data/components/tree.md +114 -81
- package/data/components/treeselect.md +176 -174
- package/data/components/treetable.md +1250 -1045
- package/data/components.json +4134 -4088
- package/data/llms-full.txt +8979 -6437
- package/data/llms.txt +100 -96
- package/data/manifest.json +183 -15
- package/data/pages/llms.md +29 -0
- package/data/pages/tailwind.md +20 -10
- package/data/snapshot.json +2 -2
- package/dist/index.d.mts +37 -2
- package/dist/index.mjs +1395 -1079
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -12,10 +12,10 @@ ConfirmPopup is defined using p-confirmPopup tag and an instance of Confirmation
|
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { Component, inject } from '@angular/core';
|
|
15
|
-
import {
|
|
15
|
+
import { ConfirmationService, MessageService } from '@exhaustive-ui/core/api';
|
|
16
16
|
import { ConfirmPopupModule } from '@exhaustive-ui/core/confirmpopup';
|
|
17
17
|
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
18
|
-
import {
|
|
18
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
19
19
|
|
|
20
20
|
@Component({
|
|
21
21
|
template: `
|
|
@@ -27,13 +27,35 @@ import { MessageService, ConfirmationService } from '@exhaustive-ui/core/api';
|
|
|
27
27
|
</div>
|
|
28
28
|
`,
|
|
29
29
|
standalone: true,
|
|
30
|
-
imports: [
|
|
30
|
+
imports: [ConfirmPopupModule, ToastModule, ButtonModule],
|
|
31
31
|
providers: [ConfirmationService, MessageService]
|
|
32
32
|
})
|
|
33
33
|
export class ConfirmpopupBasicDemo {
|
|
34
34
|
private confirmationService = inject(ConfirmationService);
|
|
35
35
|
private messageService = inject(MessageService);
|
|
36
36
|
|
|
37
|
+
confirm1(event: Event) {
|
|
38
|
+
this.confirmationService.confirm({
|
|
39
|
+
target: event.currentTarget as EventTarget,
|
|
40
|
+
message: 'Are you sure you want to proceed?',
|
|
41
|
+
icon: 'pi pi-exclamation-triangle',
|
|
42
|
+
rejectButtonProps: {
|
|
43
|
+
label: 'Cancel',
|
|
44
|
+
severity: 'secondary',
|
|
45
|
+
outlined: true
|
|
46
|
+
},
|
|
47
|
+
acceptButtonProps: {
|
|
48
|
+
label: 'Save'
|
|
49
|
+
},
|
|
50
|
+
accept: () => {
|
|
51
|
+
this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'You have accepted', life: 3000 });
|
|
52
|
+
},
|
|
53
|
+
reject: () => {
|
|
54
|
+
this.messageService.add({ severity: 'error', summary: 'Rejected', detail: 'You have rejected', life: 3000 });
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
37
59
|
confirm2(event: Event) {
|
|
38
60
|
this.confirmationService.confirm({
|
|
39
61
|
target: event.currentTarget as EventTarget,
|
|
@@ -168,7 +190,8 @@ import { Component } from '@angular/core';
|
|
|
168
190
|
standalone: true,
|
|
169
191
|
imports: []
|
|
170
192
|
})
|
|
171
|
-
export class ConfirmpopupConfirmationapiDemo {
|
|
193
|
+
export class ConfirmpopupConfirmationapiDemo {
|
|
194
|
+
}
|
|
172
195
|
```
|
|
173
196
|
|
|
174
197
|
## Headless
|
|
@@ -176,11 +199,12 @@ export class ConfirmpopupConfirmationapiDemo {}
|
|
|
176
199
|
Headless mode allows you to customize the entire user interface instead of the default elements.
|
|
177
200
|
|
|
178
201
|
```typescript
|
|
202
|
+
import { CommonModule } from '@angular/common';
|
|
179
203
|
import { Component, inject } from '@angular/core';
|
|
204
|
+
import { ConfirmationService, MessageService } from '@exhaustive-ui/core/api';
|
|
180
205
|
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
181
206
|
import { ConfirmPopupModule } from '@exhaustive-ui/core/confirmpopup';
|
|
182
207
|
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
183
|
-
import { MessageService, ConfirmationService } from '@exhaustive-ui/core/api';
|
|
184
208
|
|
|
185
209
|
@Component({
|
|
186
210
|
template: `
|
|
@@ -201,12 +225,25 @@ import { MessageService, ConfirmationService } from '@exhaustive-ui/core/api';
|
|
|
201
225
|
</div>
|
|
202
226
|
`,
|
|
203
227
|
standalone: true,
|
|
204
|
-
imports: [
|
|
228
|
+
imports: [CommonModule, ConfirmPopupModule, ToastModule, ButtonModule],
|
|
205
229
|
providers: [ConfirmationService, MessageService]
|
|
206
230
|
})
|
|
207
231
|
export class ConfirmpopupHeadlessDemo {
|
|
208
232
|
private confirmationService = inject(ConfirmationService);
|
|
209
233
|
private messageService = inject(MessageService);
|
|
234
|
+
|
|
235
|
+
confirm(event: Event) {
|
|
236
|
+
this.confirmationService.confirm({
|
|
237
|
+
target: event.target as EventTarget,
|
|
238
|
+
message: 'Save your current process?',
|
|
239
|
+
accept: () => {
|
|
240
|
+
this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'You have accepted', life: 3000 });
|
|
241
|
+
},
|
|
242
|
+
reject: () => {
|
|
243
|
+
this.messageService.add({ severity: 'error', summary: 'Rejected', detail: 'You have rejected', life: 3000 });
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
210
247
|
}
|
|
211
248
|
```
|
|
212
249
|
|
|
@@ -259,7 +296,8 @@ import { Component } from '@angular/core';
|
|
|
259
296
|
standalone: true,
|
|
260
297
|
imports: []
|
|
261
298
|
})
|
|
262
|
-
export class ConfirmpopupPropsDemo {
|
|
299
|
+
export class ConfirmpopupPropsDemo {
|
|
300
|
+
}
|
|
263
301
|
```
|
|
264
302
|
|
|
265
303
|
## Template
|
|
@@ -267,11 +305,12 @@ export class ConfirmpopupPropsDemo {}
|
|
|
267
305
|
Content section can be customized using content template.
|
|
268
306
|
|
|
269
307
|
```typescript
|
|
308
|
+
import { CommonModule } from '@angular/common';
|
|
270
309
|
import { Component, inject } from '@angular/core';
|
|
310
|
+
import { ConfirmationService, MessageService } from '@exhaustive-ui/core/api';
|
|
271
311
|
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
272
312
|
import { ConfirmPopupModule } from '@exhaustive-ui/core/confirmpopup';
|
|
273
313
|
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
274
|
-
import { MessageService, ConfirmationService } from '@exhaustive-ui/core/api';
|
|
275
314
|
|
|
276
315
|
@Component({
|
|
277
316
|
template: `
|
|
@@ -289,12 +328,45 @@ import { MessageService, ConfirmationService } from '@exhaustive-ui/core/api';
|
|
|
289
328
|
</div>
|
|
290
329
|
`,
|
|
291
330
|
standalone: true,
|
|
292
|
-
imports: [
|
|
331
|
+
imports: [CommonModule, ConfirmPopupModule, ToastModule, ButtonModule],
|
|
293
332
|
providers: [ConfirmationService, MessageService]
|
|
294
333
|
})
|
|
295
334
|
export class ConfirmpopupTemplateDemo {
|
|
296
335
|
private confirmationService = inject(ConfirmationService);
|
|
297
336
|
private messageService = inject(MessageService);
|
|
337
|
+
|
|
338
|
+
confirm(event: Event) {
|
|
339
|
+
this.confirmationService.confirm({
|
|
340
|
+
target: event.target as EventTarget,
|
|
341
|
+
message: 'Please confirm to proceed moving forward.',
|
|
342
|
+
icon: 'pi pi-exclamation-circle',
|
|
343
|
+
rejectButtonProps: {
|
|
344
|
+
icon: 'pi pi-times',
|
|
345
|
+
label: 'Cancel',
|
|
346
|
+
outlined: true
|
|
347
|
+
},
|
|
348
|
+
acceptButtonProps: {
|
|
349
|
+
icon: 'pi pi-check',
|
|
350
|
+
label: 'Confirm'
|
|
351
|
+
},
|
|
352
|
+
accept: () => {
|
|
353
|
+
this.messageService.add({
|
|
354
|
+
severity: 'info',
|
|
355
|
+
summary: 'Confirmed',
|
|
356
|
+
detail: 'You have accepted',
|
|
357
|
+
life: 3000
|
|
358
|
+
});
|
|
359
|
+
},
|
|
360
|
+
reject: () => {
|
|
361
|
+
this.messageService.add({
|
|
362
|
+
severity: 'error',
|
|
363
|
+
summary: 'Rejected',
|
|
364
|
+
detail: 'You have rejected',
|
|
365
|
+
life: 3000
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
298
370
|
}
|
|
299
371
|
```
|
|
300
372
|
|
|
@@ -329,7 +401,8 @@ import { Component } from '@angular/core';
|
|
|
329
401
|
standalone: true,
|
|
330
402
|
imports: []
|
|
331
403
|
})
|
|
332
|
-
export class ConfirmpopupTemplatesDemo {
|
|
404
|
+
export class ConfirmpopupTemplatesDemo {
|
|
405
|
+
}
|
|
333
406
|
```
|
|
334
407
|
|
|
335
408
|
## Confirm Popup
|
|
@@ -340,18 +413,18 @@ ConfirmPopup displays a confirmation overlay displayed relatively to its target.
|
|
|
340
413
|
|
|
341
414
|
| Name | Type | Default | Description |
|
|
342
415
|
|------|------|---------|-------------|
|
|
343
|
-
| dt |
|
|
344
|
-
| unstyled |
|
|
345
|
-
| pt |
|
|
346
|
-
| ptOptions |
|
|
347
|
-
| key |
|
|
348
|
-
| defaultFocus |
|
|
349
|
-
| autoZIndex |
|
|
350
|
-
| style |
|
|
351
|
-
| styleClass |
|
|
352
|
-
| visible |
|
|
353
|
-
| motionOptions |
|
|
354
|
-
| appendTo |
|
|
416
|
+
| dt | Object | undefined | Defines scoped design tokens of the component. |
|
|
417
|
+
| unstyled | boolean | undefined | Indicates whether the component should be rendered without styles. |
|
|
418
|
+
| pt | ConfirmPopupPassThrough | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
419
|
+
| ptOptions | PassThroughOptions | undefined | Used to configure passthrough(pt) options of the component. |
|
|
420
|
+
| key | string | - | Optional key to match the key of confirm object, necessary to use when component tree has multiple confirm dialogs. |
|
|
421
|
+
| defaultFocus | string | 'accept' | Element to receive the focus when the popup gets visible, valid values are "accept", "reject", and "none". |
|
|
422
|
+
| autoZIndex | boolean | true | Whether to automatically manage layering. |
|
|
423
|
+
| style | { [klass: string]: any } | - | Inline style of the component. |
|
|
424
|
+
| styleClass | string | - | Style class of the component. |
|
|
425
|
+
| visible | boolean | - | Defines if the component is visible. |
|
|
426
|
+
| motionOptions | MotionOptions | - | The motion options. |
|
|
427
|
+
| appendTo | 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). |
|
|
355
428
|
|
|
356
429
|
### Templates
|
|
357
430
|
|
|
@@ -12,9 +12,8 @@ ContextMenu can be attached to a particular element whose local template variabl
|
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { Component, OnInit } from '@angular/core';
|
|
15
|
-
import { ContextMenu, ContextMenuModule } from '@exhaustive-ui/core/contextmenu';
|
|
16
15
|
import { MenuItem } from '@exhaustive-ui/core/api';
|
|
17
|
-
import {
|
|
16
|
+
import { ContextMenuModule } from '@exhaustive-ui/core/contextmenu';
|
|
18
17
|
|
|
19
18
|
@Component({
|
|
20
19
|
template: `
|
|
@@ -43,12 +42,12 @@ export class ContextmenuBasicDemo implements OnInit {
|
|
|
43
42
|
The function to invoke when an item is clicked is defined using the command property.
|
|
44
43
|
|
|
45
44
|
```typescript
|
|
46
|
-
import { Component, OnInit, inject } from '@angular/core';
|
|
45
|
+
import { Component, OnInit, ViewChild, inject } from '@angular/core';
|
|
46
|
+
import { CommonModule } from '@angular/common';
|
|
47
|
+
import { MenuItem, MessageService } from '@exhaustive-ui/core/api';
|
|
47
48
|
import { ContextMenu, ContextMenuModule } from '@exhaustive-ui/core/contextmenu';
|
|
48
|
-
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
49
49
|
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
50
|
-
import {
|
|
51
|
-
import { ContextMenu } from '@exhaustive-ui/core/contextmenu';
|
|
50
|
+
import { Tag } from '@exhaustive-ui/core/tag';
|
|
52
51
|
|
|
53
52
|
interface Users {
|
|
54
53
|
id: number;
|
|
@@ -64,8 +63,8 @@ interface Users {
|
|
|
64
63
|
<ul class="m-0 list-none border border-surface rounded-sm p-4 flex flex-col gap-2 w-full sm:w-96">
|
|
65
64
|
<li
|
|
66
65
|
*ngFor="let user of users"
|
|
67
|
-
class="p-2 hover:bg-emphasis rounded-sm border border-transparent transition-all duration-200 flex items-center justify-
|
|
68
|
-
[ngClass]="{ 'border-primary':
|
|
66
|
+
class="p-2 hover:bg-emphasis rounded-sm border border-transparent transition-all duration-200 flex items-center justify-between"
|
|
67
|
+
[ngClass]="{ 'border-primary': selectedUser?.id === user.id }"
|
|
69
68
|
(contextmenu)="onContextMenu($event, user)"
|
|
70
69
|
>
|
|
71
70
|
<div class="flex flex-1 items-center gap-2">
|
|
@@ -79,13 +78,18 @@ interface Users {
|
|
|
79
78
|
</div>
|
|
80
79
|
`,
|
|
81
80
|
standalone: true,
|
|
82
|
-
imports: [ContextMenuModule,
|
|
81
|
+
imports: [CommonModule, ContextMenuModule, ToastModule, Tag],
|
|
83
82
|
providers: [MessageService]
|
|
84
83
|
})
|
|
85
84
|
export class ContextmenuCommandDemo implements OnInit {
|
|
86
85
|
private messageService = inject(MessageService);
|
|
86
|
+
|
|
87
87
|
items: MenuItem[] | undefined;
|
|
88
|
+
|
|
89
|
+
@ViewChild('cm') cm: ContextMenu;
|
|
90
|
+
|
|
88
91
|
selectedUser: Users;
|
|
92
|
+
|
|
89
93
|
users: Users[];
|
|
90
94
|
|
|
91
95
|
ngOnInit() {
|
|
@@ -96,6 +100,7 @@ export class ContextmenuCommandDemo implements OnInit {
|
|
|
96
100
|
{ id: 3, name: 'Bernardo Dominic', image: 'bernardodominic.png', role: 'Guest' },
|
|
97
101
|
{ id: 4, name: 'Elwin Sharvill', image: 'elwinsharvill.png', role: 'Member' }
|
|
98
102
|
];
|
|
103
|
+
|
|
99
104
|
this.items = [
|
|
100
105
|
{
|
|
101
106
|
label: 'Roles',
|
|
@@ -159,9 +164,8 @@ Setting global property to true attaches the context menu to the document.
|
|
|
159
164
|
|
|
160
165
|
```typescript
|
|
161
166
|
import { Component, OnInit } from '@angular/core';
|
|
162
|
-
import { ContextMenu, ContextMenuModule } from '@exhaustive-ui/core/contextmenu';
|
|
163
167
|
import { MenuItem } from '@exhaustive-ui/core/api';
|
|
164
|
-
import {
|
|
168
|
+
import { ContextMenuModule } from '@exhaustive-ui/core/contextmenu';
|
|
165
169
|
|
|
166
170
|
@Component({
|
|
167
171
|
template: `
|
|
@@ -213,9 +217,10 @@ export class ContextmenuDocumentDemo implements OnInit {
|
|
|
213
217
|
Menu items support navigation via routerLink, programmatic routing using commands, or external URLs.
|
|
214
218
|
|
|
215
219
|
```typescript
|
|
216
|
-
import { Component, OnInit } from '@angular/core';
|
|
217
|
-
import {
|
|
220
|
+
import { Component, OnInit, inject } from '@angular/core';
|
|
221
|
+
import { Router } from '@angular/router';
|
|
218
222
|
import { MenuItem } from '@exhaustive-ui/core/api';
|
|
223
|
+
import { ContextMenuModule } from '@exhaustive-ui/core/contextmenu';
|
|
219
224
|
|
|
220
225
|
@Component({
|
|
221
226
|
template: `
|
|
@@ -253,6 +258,8 @@ import { MenuItem } from '@exhaustive-ui/core/api';
|
|
|
253
258
|
imports: [ContextMenuModule]
|
|
254
259
|
})
|
|
255
260
|
export class ContextmenuRouterDemo implements OnInit {
|
|
261
|
+
private router = inject(Router);
|
|
262
|
+
|
|
256
263
|
items: MenuItem[] | undefined;
|
|
257
264
|
|
|
258
265
|
ngOnInit() {
|
|
@@ -288,13 +295,12 @@ Table has built-in support for ContextMenu, see the ContextMenu demo for an exam
|
|
|
288
295
|
ContextMenu offers item customization with the item template that receives the menuitem instance from the model as a parameter.
|
|
289
296
|
|
|
290
297
|
```typescript
|
|
291
|
-
import {
|
|
298
|
+
import { CommonModule } from '@angular/common';
|
|
299
|
+
import { Component, OnInit, ViewChild } from '@angular/core';
|
|
300
|
+
import { MenuItem } from '@exhaustive-ui/core/api';
|
|
292
301
|
import { BadgeModule } from '@exhaustive-ui/core/badge';
|
|
293
302
|
import { ContextMenu, ContextMenuModule } from '@exhaustive-ui/core/contextmenu';
|
|
294
|
-
import {
|
|
295
|
-
import { MenuItem } from '@exhaustive-ui/core/api';
|
|
296
|
-
import { Product } from '@/domain/product';
|
|
297
|
-
import { ContextMenu } from '@exhaustive-ui/core/contextmenu';
|
|
303
|
+
import { Ripple } from '@exhaustive-ui/core/ripple';
|
|
298
304
|
|
|
299
305
|
@Component({
|
|
300
306
|
template: `
|
|
@@ -333,12 +339,77 @@ import { ContextMenu } from '@exhaustive-ui/core/contextmenu';
|
|
|
333
339
|
</div>
|
|
334
340
|
`,
|
|
335
341
|
standalone: true,
|
|
336
|
-
imports: [
|
|
342
|
+
imports: [CommonModule, ContextMenuModule, BadgeModule, Ripple]
|
|
337
343
|
})
|
|
338
344
|
export class ContextmenuTemplateDemo implements OnInit {
|
|
339
345
|
items: MenuItem[] | undefined;
|
|
346
|
+
|
|
347
|
+
@ViewChild('cm') cm: ContextMenu;
|
|
348
|
+
|
|
340
349
|
selectedId!: string;
|
|
341
|
-
|
|
350
|
+
|
|
351
|
+
data = [
|
|
352
|
+
{
|
|
353
|
+
id: '1000',
|
|
354
|
+
code: 'f230fh0g3',
|
|
355
|
+
name: 'Bamboo Watch',
|
|
356
|
+
description: 'Product Description',
|
|
357
|
+
image: 'bamboo-watch.jpg',
|
|
358
|
+
price: 65,
|
|
359
|
+
category: 'Accessories',
|
|
360
|
+
quantity: 24,
|
|
361
|
+
inventoryStatus: 'INSTOCK',
|
|
362
|
+
rating: 5
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
id: '1001',
|
|
366
|
+
code: 'nvklal433',
|
|
367
|
+
name: 'Black Watch',
|
|
368
|
+
description: 'Product Description',
|
|
369
|
+
image: 'black-watch.jpg',
|
|
370
|
+
price: 72,
|
|
371
|
+
category: 'Accessories',
|
|
372
|
+
quantity: 61,
|
|
373
|
+
inventoryStatus: 'INSTOCK',
|
|
374
|
+
rating: 4
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
id: '1002',
|
|
378
|
+
code: 'zz21cz3c1',
|
|
379
|
+
name: 'Blue Band',
|
|
380
|
+
description: 'Product Description',
|
|
381
|
+
image: 'blue-band.jpg',
|
|
382
|
+
price: 79,
|
|
383
|
+
category: 'Fitness',
|
|
384
|
+
quantity: 2,
|
|
385
|
+
inventoryStatus: 'LOWSTOCK',
|
|
386
|
+
rating: 3
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
id: '1003',
|
|
390
|
+
code: '244wgerg2',
|
|
391
|
+
name: 'Blue T-Shirt',
|
|
392
|
+
description: 'Product Description',
|
|
393
|
+
image: 'blue-t-shirt.jpg',
|
|
394
|
+
price: 29,
|
|
395
|
+
category: 'Clothing',
|
|
396
|
+
quantity: 25,
|
|
397
|
+
inventoryStatus: 'INSTOCK',
|
|
398
|
+
rating: 5
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
id: '1004',
|
|
402
|
+
code: 'h456wer53',
|
|
403
|
+
name: 'Bracelet',
|
|
404
|
+
description: 'Product Description',
|
|
405
|
+
image: 'bracelet.jpg',
|
|
406
|
+
price: 15,
|
|
407
|
+
category: 'Accessories',
|
|
408
|
+
quantity: 73,
|
|
409
|
+
inventoryStatus: 'INSTOCK',
|
|
410
|
+
rating: 4
|
|
411
|
+
}
|
|
412
|
+
];
|
|
342
413
|
|
|
343
414
|
ngOnInit() {
|
|
344
415
|
this.items = [
|
|
@@ -392,25 +463,25 @@ ContextMenu displays an overlay menu on right click of its target. Note that com
|
|
|
392
463
|
|
|
393
464
|
| Name | Type | Default | Description |
|
|
394
465
|
|------|------|---------|-------------|
|
|
395
|
-
| dt |
|
|
396
|
-
| unstyled |
|
|
397
|
-
| pt |
|
|
398
|
-
| ptOptions |
|
|
399
|
-
| model |
|
|
400
|
-
| triggerEvent |
|
|
401
|
-
| target |
|
|
402
|
-
| global |
|
|
403
|
-
| style |
|
|
404
|
-
| styleClass |
|
|
405
|
-
| autoZIndex |
|
|
406
|
-
| baseZIndex |
|
|
407
|
-
| id |
|
|
408
|
-
| breakpoint |
|
|
409
|
-
| ariaLabel |
|
|
410
|
-
| ariaLabelledBy |
|
|
411
|
-
| pressDelay |
|
|
412
|
-
| appendTo |
|
|
413
|
-
| motionOptions |
|
|
466
|
+
| dt | Object | undefined | Defines scoped design tokens of the component. |
|
|
467
|
+
| unstyled | boolean | undefined | Indicates whether the component should be rendered without styles. |
|
|
468
|
+
| pt | ContextMenuPassThrough | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
469
|
+
| ptOptions | PassThroughOptions | undefined | Used to configure passthrough(pt) options of the component. |
|
|
470
|
+
| model | MenuItem[] | - | An array of menuitems. |
|
|
471
|
+
| triggerEvent | string | 'contextmenu' | Event for which the menu must be displayed. |
|
|
472
|
+
| target | string \| HTMLElement | - | Local template variable name of the element to attach the context menu. |
|
|
473
|
+
| global | boolean | - | Attaches the menu to document instead of a particular item. |
|
|
474
|
+
| style | { [klass: string]: any } | - | Inline style of the component. |
|
|
475
|
+
| styleClass | string | - | Style class of the component. |
|
|
476
|
+
| autoZIndex | boolean | true | Whether to automatically manage layering. |
|
|
477
|
+
| baseZIndex | number | 0 | Base zIndex value to use in layering. |
|
|
478
|
+
| id | string | - | Current id state as a string. |
|
|
479
|
+
| breakpoint | string | '960px' | The breakpoint to define the maximum width boundary. |
|
|
480
|
+
| ariaLabel | string | - | Defines a string value that labels an interactive element. |
|
|
481
|
+
| ariaLabelledBy | string | - | Identifier of the underlying input element. |
|
|
482
|
+
| pressDelay | number | 500 | Press delay in touch devices as miliseconds. |
|
|
483
|
+
| appendTo | any | 'self' | 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). |
|
|
484
|
+
| motionOptions | MotionOptions | - | The motion options. |
|
|
414
485
|
|
|
415
486
|
### Emits
|
|
416
487
|
|