@exhaustive-ui/mcp 0.0.0-stage → 22.0.0-alpha.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/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,378 @@
|
|
|
1
|
+
# Angular Popover Component
|
|
2
|
+
|
|
3
|
+
Popover is a container component that can overlay other components on page.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader Popover component uses dialog role and since any attribute is passed to the root element you may define attributes like aria-label or aria-labelledby to describe the popup contents. In addition aria-modal is added since focus is kept within the popup. It is recommended to use a trigger component that can be accessed with keyboard such as a button, if not adding tabIndex would be necessary. Popover adds aria-expanded state attribute and aria-controls to the trigger so that the relation between the trigger and the popup is defined. Popover Keyboard Support When the popup gets opened, the first focusable element receives the focus and this can be customized by adding autofocus to an element within the popup. Key Function tab Moves focus to the next the focusable element within the popup. shift + tab Moves focus to the previous the focusable element within the popup. escape Closes the popup and moves focus to the trigger. Close Button Keyboard Support Key Function enter Closes the popup and moves focus to the trigger. space Closes the popup and moves focus to the trigger.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
Popover is accessed via its reference and visibility is controlled using toggle , show and hide methods with an event of the target.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component } from '@angular/core';
|
|
15
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
16
|
+
import { InputGroupModule } from '@exhaustive-ui/core/inputgroup';
|
|
17
|
+
import { PopoverModule } from '@exhaustive-ui/core/popover';
|
|
18
|
+
import { InputTextModule } from '@exhaustive-ui/core/inputtext';
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
template: `
|
|
22
|
+
<div class="card flex justify-center">
|
|
23
|
+
<p-button (click)="op.toggle($event)" icon="pi pi-share-alt" label="Share" />
|
|
24
|
+
<p-popover #op>
|
|
25
|
+
<div class="flex flex-col gap-4 w-[25rem]">
|
|
26
|
+
<div>
|
|
27
|
+
<span class="font-medium text-surface-900 dark:text-surface-0 block mb-2">Share this document</span>
|
|
28
|
+
<p-inputgroup>
|
|
29
|
+
<input pInputText value="https://exhaustive-ui.e-xiste.com/s/12323ff26t2g243g423g234gg52hy25XADXAG3" readonly class="w-[25rem]" />
|
|
30
|
+
<p-inputgroup-addon>
|
|
31
|
+
<i class="pi pi-copy"></i>
|
|
32
|
+
</p-inputgroup-addon>
|
|
33
|
+
</p-inputgroup>
|
|
34
|
+
</div>
|
|
35
|
+
<div>
|
|
36
|
+
<span class="font-medium text-surface-900 dark:text-surface-0 block mb-2">Invite Member</span>
|
|
37
|
+
<div class="flex">
|
|
38
|
+
<p-inputgroup>
|
|
39
|
+
<input pInputText disabled />
|
|
40
|
+
<button pButton label="Invite" icon="pi pi-users"></button>
|
|
41
|
+
</p-inputgroup>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
<span class="font-medium text-surface-900 dark:text-surface-0 block mb-2">Team Members</span>
|
|
46
|
+
<ul class="list-none p-0 m-0 flex flex-col gap-4">
|
|
47
|
+
@for (member of members; track member) {
|
|
48
|
+
<li class="flex items-center gap-2">
|
|
49
|
+
<img [src]="'https://exhaustive-ui.e-xiste.com/demo/avatar/' + member.image" style="width: 32px" />
|
|
50
|
+
<div>
|
|
51
|
+
<span class="font-medium">{{ member.name }}</span>
|
|
52
|
+
<div class="text-sm text-muted-color">{{ member.email }}</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="flex items-center gap-2 text-muted-color ml-auto text-sm">
|
|
55
|
+
<span>{{ member.role }}</span>
|
|
56
|
+
<i class="pi pi-angle-down"></i>
|
|
57
|
+
</div>
|
|
58
|
+
</li>
|
|
59
|
+
}
|
|
60
|
+
</ul>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</p-popover>
|
|
64
|
+
</div>
|
|
65
|
+
`,
|
|
66
|
+
standalone: true,
|
|
67
|
+
imports: [ButtonModule, InputGroupModule, PopoverModule, InputTextModule]
|
|
68
|
+
})
|
|
69
|
+
export class PopoverBasicDemo {
|
|
70
|
+
members: any[];
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## DataTable
|
|
75
|
+
|
|
76
|
+
Place the Popover outside of the data iteration components to avoid rendering it multiple times.
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { Component, OnInit, inject, signal } from '@angular/core';
|
|
80
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
81
|
+
import { Popover, PopoverModule } from '@exhaustive-ui/core/popover';
|
|
82
|
+
import { TableModule } from '@exhaustive-ui/core/table';
|
|
83
|
+
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
84
|
+
import { ProductService } from '@/service/productservice';
|
|
85
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
86
|
+
import { Product } from '@/domain/product';
|
|
87
|
+
|
|
88
|
+
@Component({
|
|
89
|
+
template: `
|
|
90
|
+
<div class="card">
|
|
91
|
+
<p-table [value]="products()" [tableStyle]="{ 'min-width': '50rem' }" [paginator]="true" [rows]="5">
|
|
92
|
+
<ng-template #header>
|
|
93
|
+
<tr>
|
|
94
|
+
<th class="w-1/6">Id</th>
|
|
95
|
+
<th class="w-1/6">Code</th>
|
|
96
|
+
<th class="w-1/6">Name</th>
|
|
97
|
+
<th class="w-1/6">Price</th>
|
|
98
|
+
<th class="w-1/6">Image</th>
|
|
99
|
+
<th class="w-1/6">Details</th>
|
|
100
|
+
</tr>
|
|
101
|
+
</ng-template>
|
|
102
|
+
<ng-template #body let-product>
|
|
103
|
+
<tr>
|
|
104
|
+
<td>{{ product.id }}</td>
|
|
105
|
+
<td>{{ product.code }}</td>
|
|
106
|
+
<td>{{ product.name }}</td>
|
|
107
|
+
<td>$ {{ product.price }}</td>
|
|
108
|
+
<td>
|
|
109
|
+
<img [src]="'https://exhaustive-ui.e-xiste.com/demo/product/' + product.image" [alt]="product.image" class="w-16 shadow-sm" />
|
|
110
|
+
</td>
|
|
111
|
+
<td>
|
|
112
|
+
<p-button (onClick)="displayProduct($event, product)" icon="pi pi-search" severity="secondary" rounded />
|
|
113
|
+
</td>
|
|
114
|
+
</tr>
|
|
115
|
+
</ng-template>
|
|
116
|
+
</p-table>
|
|
117
|
+
<p-popover #op (onHide)="selectedProduct.set(null)">
|
|
118
|
+
<ng-template #content>
|
|
119
|
+
<div *ngIf="selectedProduct()" class="rounded flex flex-col">
|
|
120
|
+
<div class="flex justify-center rounded">
|
|
121
|
+
<div class="relative mx-auto">
|
|
122
|
+
<img class="rounded w-44 sm:w-64" [src]="'https://exhaustive-ui.e-xiste.com/demo/product/' + selectedProduct().image" [alt]="selectedProduct().name" />
|
|
123
|
+
<p-tag [value]="selectedProduct().inventoryStatus" [severity]="getSeverity(selectedProduct())" class="absolute dark:!bg-surface-900" [style.left.px]="4" [style.top.px]="4" />
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="pt-4">
|
|
127
|
+
<div class="flex flex-row justify-between items-start gap-2 mb-4">
|
|
128
|
+
<div>
|
|
129
|
+
<span class="font-medium text-surface-500 dark:text-surface-400 text-sm">{{ selectedProduct().category }}</span>
|
|
130
|
+
<div class="text-lg font-medium mt-1">{{ selectedProduct().name }}</div>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="bg-surface-100 p-1" style="border-radius: 30px">
|
|
133
|
+
<div class="bg-surface-0 flex items-center gap-2 justify-center py-1 px-2" style="border-radius: 30px; box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.04), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)">
|
|
134
|
+
<span class="text-surface-900 font-medium text-sm">{{ selectedProduct().rating }}</span>
|
|
135
|
+
<i class="pi pi-star-fill text-yellow-500"></i>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
<div class="flex gap-2">
|
|
140
|
+
<p-button
|
|
141
|
+
icon="pi pi-shopping-cart"
|
|
142
|
+
[label]="'Buy Now | $' + selectedProduct().price"
|
|
143
|
+
[disabled]="selectedProduct().inventoryStatus === 'OUTOFSTOCK'"
|
|
144
|
+
class="flex-auto"
|
|
145
|
+
styleClass="w-full whitespace-nowrap"
|
|
146
|
+
(onClick)="hidePopover()"
|
|
147
|
+
/>
|
|
148
|
+
<p-button icon="pi pi-heart" outlined (onClick)="hidePopover()" />
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</ng-template>
|
|
153
|
+
</p-popover>
|
|
154
|
+
</div>
|
|
155
|
+
`,
|
|
156
|
+
standalone: true,
|
|
157
|
+
imports: [ButtonModule, PopoverModule, TableModule, TagModule],
|
|
158
|
+
providers: [ProductService, MessageService]
|
|
159
|
+
})
|
|
160
|
+
export class PopoverDatatableDemo implements OnInit {
|
|
161
|
+
private productService = inject(ProductService);
|
|
162
|
+
private messageService = inject(MessageService);
|
|
163
|
+
products = signal<Product[]>([]);
|
|
164
|
+
selectedProduct = signal<Product | null>(null);
|
|
165
|
+
|
|
166
|
+
ngOnInit() {
|
|
167
|
+
this.productService.getProductsSmall().then((products) => {
|
|
168
|
+
this.products.set(products);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
displayProduct(event, product) {
|
|
173
|
+
if (this.selectedProduct()?.id === product.id) {
|
|
174
|
+
this.op.hide();
|
|
175
|
+
this.selectedProduct.set(null);
|
|
176
|
+
} else {
|
|
177
|
+
this.selectedProduct.set(product);
|
|
178
|
+
this.op.show(event);
|
|
179
|
+
|
|
180
|
+
if (this.op.container) {
|
|
181
|
+
this.op.align();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
hidePopover() {
|
|
187
|
+
this.op.hide();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
getSeverity(product) {
|
|
191
|
+
switch (product.inventoryStatus) {
|
|
192
|
+
case 'INSTOCK':
|
|
193
|
+
return 'success';
|
|
194
|
+
|
|
195
|
+
case 'LOWSTOCK':
|
|
196
|
+
return 'warn';
|
|
197
|
+
|
|
198
|
+
case 'OUTOFSTOCK':
|
|
199
|
+
return 'danger';
|
|
200
|
+
|
|
201
|
+
default:
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Select Data
|
|
209
|
+
|
|
210
|
+
In this sample, data is retrieved from the content inside the popover.
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
import { Component } from '@angular/core';
|
|
214
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
215
|
+
import { Popover, PopoverModule } from '@exhaustive-ui/core/popover';
|
|
216
|
+
|
|
217
|
+
@Component({
|
|
218
|
+
template: `
|
|
219
|
+
<div class="card flex justify-center">
|
|
220
|
+
<p-button type="button" [label]="selectedMember ? selectedMember.name : 'Select Member'" (onClick)="toggle($event)" styleClass="min-w-48" />
|
|
221
|
+
<p-popover #op>
|
|
222
|
+
<div class="flex flex-col gap-4">
|
|
223
|
+
<div>
|
|
224
|
+
<span class="font-medium block mb-2">Team Members</span>
|
|
225
|
+
<ul class="list-none p-0 m-0 flex flex-col">
|
|
226
|
+
<li *ngFor="let member of members" class="flex items-center gap-2 px-2 py-3 hover:bg-emphasis cursor-pointer rounded-border" (click)="selectMember(member)">
|
|
227
|
+
<img [src]="'https://exhaustive-ui.e-xiste.com/demo/avatar/' + member.image" style="width: 32px" />
|
|
228
|
+
<div>
|
|
229
|
+
<span class="font-medium">{{ member.name }}</span>
|
|
230
|
+
<div class="text-sm text-surface-500 dark:text-surface-400">{{ member.email }}</div>
|
|
231
|
+
</div>
|
|
232
|
+
</li>
|
|
233
|
+
</ul>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</p-popover>
|
|
237
|
+
</div>
|
|
238
|
+
`,
|
|
239
|
+
standalone: true,
|
|
240
|
+
imports: [ButtonModule, PopoverModule]
|
|
241
|
+
})
|
|
242
|
+
export class PopoverSelectdataDemo {
|
|
243
|
+
selectedMember: any = null;
|
|
244
|
+
members: any[];
|
|
245
|
+
|
|
246
|
+
toggle(event) {
|
|
247
|
+
this.op.toggle(event);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
selectMember(member) {
|
|
251
|
+
this.selectedMember = member;
|
|
252
|
+
this.op.hide();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Target
|
|
258
|
+
|
|
259
|
+
show method takes two parameters, first one is the event and it is mandatory. By default the target component to align the overlay is the event target, if you'd like to align it to another element, provide it as the second parameter target .
|
|
260
|
+
|
|
261
|
+
```typescript
|
|
262
|
+
import { Component } from '@angular/core';
|
|
263
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
264
|
+
import { PopoverModule } from '@exhaustive-ui/core/popover';
|
|
265
|
+
|
|
266
|
+
@Component({
|
|
267
|
+
template: `
|
|
268
|
+
<div class="card flex flex-col items-center gap-4">
|
|
269
|
+
<p-button (click)="op.show($event, targetEl)" icon="pi pi-image" label="Show"></p-button>
|
|
270
|
+
<div #targetEl class="mt-8 w-40 h-20 border border-surface rounded-border flex items-center justify-center">
|
|
271
|
+
<span>Target Element</span>
|
|
272
|
+
</div>
|
|
273
|
+
<p-popover #op>
|
|
274
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/product/bamboo-watch.jpg" alt="product" />
|
|
275
|
+
</p-popover>
|
|
276
|
+
</div>
|
|
277
|
+
`,
|
|
278
|
+
standalone: true,
|
|
279
|
+
imports: [ButtonModule, PopoverModule]
|
|
280
|
+
})
|
|
281
|
+
export class PopoverTargetDemo {}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Template
|
|
285
|
+
|
|
286
|
+
Content of the OverlayPanel is defined by content template.
|
|
287
|
+
|
|
288
|
+
```typescript
|
|
289
|
+
import { Component } from '@angular/core';
|
|
290
|
+
import { ButtonModule } from '@exhaustive-ui/core/button';
|
|
291
|
+
import { PopoverModule } from '@exhaustive-ui/core/popover';
|
|
292
|
+
import { OverlayPanel } from '@exhaustive-ui/core/overlaypanel';
|
|
293
|
+
|
|
294
|
+
@Component({
|
|
295
|
+
template: `
|
|
296
|
+
<div class="card flex justify-center">
|
|
297
|
+
<p-popover #op>
|
|
298
|
+
<ng-template #content>
|
|
299
|
+
<h4>Custom Content</h4>
|
|
300
|
+
</ng-template>
|
|
301
|
+
</p-popover>
|
|
302
|
+
<p-button (click)="op.toggle($event)" icon="pi pi-image" label="Show"></p-button>
|
|
303
|
+
</div>
|
|
304
|
+
`,
|
|
305
|
+
standalone: true,
|
|
306
|
+
imports: [ButtonModule, PopoverModule]
|
|
307
|
+
})
|
|
308
|
+
export class PopoverTemplateDemo {}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Popover
|
|
312
|
+
|
|
313
|
+
Popover is a container component that can overlay other components on page.
|
|
314
|
+
|
|
315
|
+
### Props
|
|
316
|
+
|
|
317
|
+
| Name | Type | Default | Description |
|
|
318
|
+
|------|------|---------|-------------|
|
|
319
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
320
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
321
|
+
| pt | InputSignal<PopoverPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
322
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
323
|
+
| ariaLabel | InputSignal<string> | ... | Defines a string that labels the input for accessibility. |
|
|
324
|
+
| ariaLabelledBy | InputSignal<string> | ... | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
|
|
325
|
+
| dismissable | InputSignalWithTransform<boolean, unknown> | ... | Enables to hide the overlay when outside is clicked. |
|
|
326
|
+
| style | InputSignal<{ [klass: string]: any }> | ... | Inline style of the component. |
|
|
327
|
+
| styleClass | InputSignal<string> | ... | Style class of the component. |
|
|
328
|
+
| appendTo | InputSignal<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). |
|
|
329
|
+
| autoZIndex | InputSignalWithTransform<boolean, unknown> | ... | Whether to automatically manage layering. |
|
|
330
|
+
| baseZIndex | InputSignalWithTransform<number, unknown> | ... | Base zIndex value to use in layering. |
|
|
331
|
+
| focusOnShow | InputSignalWithTransform<boolean, unknown> | ... | When enabled, first button receives focus on show. |
|
|
332
|
+
| motionOptions | InputSignal<MotionOptions> | ... | The motion options. |
|
|
333
|
+
|
|
334
|
+
### Emits
|
|
335
|
+
|
|
336
|
+
| Name | Parameters | Description |
|
|
337
|
+
|------|------------|-------------|
|
|
338
|
+
| onShow | value: any | Callback to invoke when an overlay becomes visible. |
|
|
339
|
+
| onHide | value: any | Callback to invoke when an overlay gets hidden. |
|
|
340
|
+
|
|
341
|
+
### Templates
|
|
342
|
+
|
|
343
|
+
| Name | Type | Description |
|
|
344
|
+
|------|------|-------------|
|
|
345
|
+
| content | TemplateRef<PopoverContentTemplateContext> | Custom content template. |
|
|
346
|
+
|
|
347
|
+
### Methods
|
|
348
|
+
|
|
349
|
+
| Name | Parameters | Return Type | Description |
|
|
350
|
+
|------|------------|-------------|-------------|
|
|
351
|
+
| toggle | event: any, target: any | void | Toggles the visibility of the panel. |
|
|
352
|
+
| show | event: any, target: any | void | Displays the panel. |
|
|
353
|
+
| hide | | void | Hides the panel. |
|
|
354
|
+
|
|
355
|
+
## Pass Through Options
|
|
356
|
+
|
|
357
|
+
| Name | Type | Description |
|
|
358
|
+
|------|------|-------------|
|
|
359
|
+
| host | PassThroughOption<HTMLElement, I> | Used to pass attributes to the host's DOM element. |
|
|
360
|
+
| root | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the root's DOM element. |
|
|
361
|
+
| content | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the content's DOM element. |
|
|
362
|
+
| motion | MotionOptions | Used to pass options to the motion component/directive. |
|
|
363
|
+
|
|
364
|
+
## Theming
|
|
365
|
+
|
|
366
|
+
### Design Tokens
|
|
367
|
+
|
|
368
|
+
| Token | CSS Variable | Description |
|
|
369
|
+
|-------|--------------|-------------|
|
|
370
|
+
| popover.background | --p-popover-background | Background of root |
|
|
371
|
+
| popover.border.color | --p-popover-border-color | Border color of root |
|
|
372
|
+
| popover.color | --p-popover-color | Color of root |
|
|
373
|
+
| popover.border.radius | --p-popover-border-radius | Border radius of root |
|
|
374
|
+
| popover.shadow | --p-popover-shadow | Shadow of root |
|
|
375
|
+
| popover.gutter | --p-popover-gutter | Gutter of root |
|
|
376
|
+
| popover.arrow.offset | --p-popover-arrow-offset | Arrow offset of root |
|
|
377
|
+
| popover.content.padding | --p-popover-content-padding | Padding of content |
|
|
378
|
+
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Angular ProgressBar Component
|
|
2
|
+
|
|
3
|
+
ProgressBar is a process status indicator.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader ProgressBar components uses progressbar role along with aria-valuemin , aria-valuemax and aria-valuenow attributes. Value to describe the component can be defined using aria-labelledby and aria-label props.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
ProgressBar is used with the value property.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component } from '@angular/core';
|
|
15
|
+
import { ProgressBarModule } from '@exhaustive-ui/core/progressbar';
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
template: `
|
|
19
|
+
<div class="card">
|
|
20
|
+
<p-progressbar [value]="50" />
|
|
21
|
+
</div>
|
|
22
|
+
`,
|
|
23
|
+
standalone: true,
|
|
24
|
+
imports: [ProgressBarModule]
|
|
25
|
+
})
|
|
26
|
+
export class ProgressbarBasicDemo {}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Dynamic
|
|
30
|
+
|
|
31
|
+
Value is reactive so updating it dynamically changes the bar as well.
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { Component, OnInit, inject } from '@angular/core';
|
|
35
|
+
import { ProgressBarModule } from '@exhaustive-ui/core/progressbar';
|
|
36
|
+
import { ToastModule } from '@exhaustive-ui/core/toast';
|
|
37
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
38
|
+
|
|
39
|
+
@Component({
|
|
40
|
+
template: `
|
|
41
|
+
<div class="card">
|
|
42
|
+
<p-toast />
|
|
43
|
+
<p-progressbar [value]="value" />
|
|
44
|
+
</div>
|
|
45
|
+
`,
|
|
46
|
+
standalone: true,
|
|
47
|
+
imports: [ProgressBarModule, ToastModule],
|
|
48
|
+
providers: [MessageService]
|
|
49
|
+
})
|
|
50
|
+
export class ProgressbarDynamicDemo implements OnInit {
|
|
51
|
+
private messageService = inject(MessageService);
|
|
52
|
+
value: number = 0;
|
|
53
|
+
interval: any;
|
|
54
|
+
|
|
55
|
+
ngOnInit() {
|
|
56
|
+
this.ngZone.runOutsideAngular(() => {
|
|
57
|
+
this.interval = setInterval(() => {
|
|
58
|
+
this.ngZone.run(() => {
|
|
59
|
+
this.value = this.value + Math.floor(Math.random() * 10) + 1;
|
|
60
|
+
if (this.value >= 100) {
|
|
61
|
+
this.value = 100;
|
|
62
|
+
this.messageService.add({ severity: 'info', summary: 'Success', detail: 'Process Completed' });
|
|
63
|
+
clearInterval(this.interval);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}, 2000);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
ngOnDestroy() {
|
|
71
|
+
if (this.interval) {
|
|
72
|
+
clearInterval(this.interval);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Indeterminate
|
|
79
|
+
|
|
80
|
+
For progresses with no value to track, set the mode property to indeterminate .
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { Component, inject } from '@angular/core';
|
|
84
|
+
import { ProgressBarModule } from '@exhaustive-ui/core/progressbar';
|
|
85
|
+
import { MessageService } from '@exhaustive-ui/core/api';
|
|
86
|
+
|
|
87
|
+
@Component({
|
|
88
|
+
template: `
|
|
89
|
+
<div class="card">
|
|
90
|
+
<p-progressbar mode="indeterminate" [style]="{ height: '6px' }" />
|
|
91
|
+
</div>
|
|
92
|
+
`,
|
|
93
|
+
standalone: true,
|
|
94
|
+
imports: [ProgressBarModule],
|
|
95
|
+
providers: [MessageService]
|
|
96
|
+
})
|
|
97
|
+
export class ProgressbarIndeterminateDemo {
|
|
98
|
+
private messageService = inject(MessageService);
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Template
|
|
103
|
+
|
|
104
|
+
content template allows displaying custom content inside the progressbar.
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
import { Component } from '@angular/core';
|
|
108
|
+
import { ProgressBarModule } from '@exhaustive-ui/core/progressbar';
|
|
109
|
+
|
|
110
|
+
@Component({
|
|
111
|
+
template: `
|
|
112
|
+
<div class="card">
|
|
113
|
+
<p-progressbar [value]="50">
|
|
114
|
+
<ng-template #content let-value>
|
|
115
|
+
<span>{{ value }}/100</span>
|
|
116
|
+
</ng-template>
|
|
117
|
+
</p-progressbar>
|
|
118
|
+
</div>
|
|
119
|
+
`,
|
|
120
|
+
standalone: true,
|
|
121
|
+
imports: [ProgressBarModule]
|
|
122
|
+
})
|
|
123
|
+
export class ProgressbarTemplateDemo {}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Progress Bar
|
|
127
|
+
|
|
128
|
+
ProgressBar is a process status indicator.
|
|
129
|
+
|
|
130
|
+
### Props
|
|
131
|
+
|
|
132
|
+
| Name | Type | Default | Description |
|
|
133
|
+
|------|------|---------|-------------|
|
|
134
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
135
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
136
|
+
| pt | InputSignal<ProgressBarPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
137
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
138
|
+
| value | InputSignalWithTransform<number, unknown> | ... | Current value of the progress. |
|
|
139
|
+
| showValue | InputSignalWithTransform<boolean, unknown> | ... | Whether to display the progress bar value. |
|
|
140
|
+
| valueStyleClass | InputSignal<string> | ... | Style class of the value element. |
|
|
141
|
+
| unit | InputSignal<string> | ... | Unit sign appended to the value. |
|
|
142
|
+
| mode | InputSignal<"indeterminate" \| "determinate"> | 'determinate' | Defines the mode of the progress |
|
|
143
|
+
| color | InputSignal<string> | ... | Color for the background of the progress. |
|
|
144
|
+
|
|
145
|
+
### Templates
|
|
146
|
+
|
|
147
|
+
| Name | Type | Description |
|
|
148
|
+
|------|------|-------------|
|
|
149
|
+
| content | TemplateRef<ProgressBarContentTemplateContext> | Template of the content. |
|
|
150
|
+
|
|
151
|
+
## Pass Through Options
|
|
152
|
+
|
|
153
|
+
| Name | Type | Description |
|
|
154
|
+
|------|------|-------------|
|
|
155
|
+
| host | PassThroughOption<HTMLElement, I> | Used to pass attributes to the host's DOM element. |
|
|
156
|
+
| root | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the root's DOM element. |
|
|
157
|
+
| value | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the value's DOM element. |
|
|
158
|
+
| label | PassThroughOption<HTMLDivElement, I> | Used to pass attributes to the label's DOM element. |
|
|
159
|
+
|
|
160
|
+
## Theming
|
|
161
|
+
|
|
162
|
+
### CSS Classes
|
|
163
|
+
|
|
164
|
+
| Class | Description |
|
|
165
|
+
|-------|-------------|
|
|
166
|
+
| p-progressbar | Class name of the root element |
|
|
167
|
+
| p-progressbar-value | Class name of the value element |
|
|
168
|
+
| p-progressbar-label | Class name of the label element |
|
|
169
|
+
|
|
170
|
+
### Design Tokens
|
|
171
|
+
|
|
172
|
+
| Token | CSS Variable | Description |
|
|
173
|
+
|-------|--------------|-------------|
|
|
174
|
+
| progressbar.background | --p-progressbar-background | Background of root |
|
|
175
|
+
| progressbar.border.radius | --p-progressbar-border-radius | Border radius of root |
|
|
176
|
+
| progressbar.height | --p-progressbar-height | Height of root |
|
|
177
|
+
| progressbar.value.background | --p-progressbar-value-background | Background of value |
|
|
178
|
+
| progressbar.label.color | --p-progressbar-label-color | Color of label |
|
|
179
|
+
| progressbar.label.font.size | --p-progressbar-label-font-size | Font size of label |
|
|
180
|
+
| progressbar.label.font.weight | --p-progressbar-label-font-weight | Font weight of label |
|
|
181
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Angular ProgressSpinner Component
|
|
2
|
+
|
|
3
|
+
ProgressSpinner is a process status indicator.
|
|
4
|
+
|
|
5
|
+
## Accessibility
|
|
6
|
+
|
|
7
|
+
Screen Reader ProgressSpinner components uses progressbar role. Value to describe the component can be defined using aria-labelledby and aria-label props.
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
An infinite spin animation is displayed by default.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Component } from '@angular/core';
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
template: `
|
|
18
|
+
<div class="card flex justify-center">
|
|
19
|
+
<p-progress-spinner ariaLabel="loading" />
|
|
20
|
+
</div>
|
|
21
|
+
`,
|
|
22
|
+
standalone: true,
|
|
23
|
+
imports: []
|
|
24
|
+
})
|
|
25
|
+
export class ProgressspinnerBasicDemo {}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Custom
|
|
29
|
+
|
|
30
|
+
ProgressSpinner can be customized with styling property like strokeWidth and fill .
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { Component } from '@angular/core';
|
|
34
|
+
|
|
35
|
+
@Component({
|
|
36
|
+
template: `
|
|
37
|
+
<div class="card flex justify-center">
|
|
38
|
+
<p-progress-spinner strokeWidth="8" fill="transparent" animationDuration=".5s" [style]="{ width: '50px', height: '50px' }" />
|
|
39
|
+
</div>
|
|
40
|
+
`,
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: []
|
|
43
|
+
})
|
|
44
|
+
export class ProgressspinnerCustomDemo {}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Progress Spinner
|
|
48
|
+
|
|
49
|
+
ProgressSpinner is a process status indicator.
|
|
50
|
+
|
|
51
|
+
### Props
|
|
52
|
+
|
|
53
|
+
| Name | Type | Default | Description |
|
|
54
|
+
|------|------|---------|-------------|
|
|
55
|
+
| dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
|
|
56
|
+
| unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
|
|
57
|
+
| pt | InputSignal<ProgressSpinnerPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
|
|
58
|
+
| ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
|
|
59
|
+
| strokeWidth | InputSignal<string> | ... | Width of the circle stroke. |
|
|
60
|
+
| fill | InputSignal<string> | ... | Color for the background of the circle. |
|
|
61
|
+
| animationDuration | InputSignal<string> | ... | Duration of the rotate animation. |
|
|
62
|
+
| ariaLabel | InputSignal<string> | ... | Used to define a aria label attribute the current element. |
|
|
63
|
+
|
|
64
|
+
## Pass Through Options
|
|
65
|
+
|
|
66
|
+
| Name | Type | Description |
|
|
67
|
+
|------|------|-------------|
|
|
68
|
+
| host | PassThroughOption<HTMLElement, I> | Used to pass attributes to the host's DOM element. |
|
|
69
|
+
| root | PassThroughOption<SVGSVGElement, I> | Used to pass attributes to the root's DOM element. |
|
|
70
|
+
| spin | PassThroughOption<SVGSVGElement, I> | Used to pass attributes to the spin's DOM element. |
|
|
71
|
+
| circle | PassThroughOption<SVGCircleElement, I> | Used to pass attributes to the circle's DOM element. |
|
|
72
|
+
|
|
73
|
+
## Theming
|
|
74
|
+
|
|
75
|
+
### CSS Classes
|
|
76
|
+
|
|
77
|
+
| Class | Description |
|
|
78
|
+
|-------|-------------|
|
|
79
|
+
| p-progressspinner | Class name of the root element |
|
|
80
|
+
| p-progressspinner-spin | Class name of the spin element |
|
|
81
|
+
| p-progressspinner-circle | Class name of the circle element |
|
|
82
|
+
|
|
83
|
+
### Design Tokens
|
|
84
|
+
|
|
85
|
+
| Token | CSS Variable | Description |
|
|
86
|
+
|-------|--------------|-------------|
|
|
87
|
+
| progressspinner.color.one | --p-progressspinner-color-one | Color one of root |
|
|
88
|
+
| progressspinner.color.two | --p-progressspinner-color-two | Color two of root |
|
|
89
|
+
| progressspinner.color.three | --p-progressspinner-color-three | Color three of root |
|
|
90
|
+
| progressspinner.color.four | --p-progressspinner-color-four | Color four of root |
|
|
91
|
+
|