@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,285 @@
|
|
|
1
|
+
# Angular Drag and Drop Component
|
|
2
|
+
|
|
3
|
+
pDraggable and pDroppable directives apply drag-drop behaviors to any element.
|
|
4
|
+
|
|
5
|
+
## Basic
|
|
6
|
+
|
|
7
|
+
pDraggable and pDroppable are attached to a target element to add drag-drop behavior. The value of a Directive attribute is required and it defines the scope to match draggables with droppables. Droppable scope can also be an array to accept multiple droppables.
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { Component, OnInit } from '@angular/core';
|
|
11
|
+
import { Product } from '@/domain/product';
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
template: `
|
|
15
|
+
<div class="card flex flex-wrap gap-4">
|
|
16
|
+
<div class="p-2 border border-surface rounded-border w-60">
|
|
17
|
+
<ul class="list-none flex flex-col gap-2 p-0 m-0">
|
|
18
|
+
<li *ngFor="let product of availableProducts" class="p-2 rounded-border shadow-sm" pDraggable (onDragStart)="dragStart(product)" (onDragEnd)="dragEnd()">
|
|
19
|
+
{{ product.name }}
|
|
20
|
+
</li>
|
|
21
|
+
</ul>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="p-2 border border-surface rounded-border w-60" pDroppable (onDrop)="drop()">
|
|
24
|
+
<p class="text-center border-surface border-b">Drop Zone</p>
|
|
25
|
+
<ul class="list-none flex flex-col gap-2 p-0 m-0" *ngIf="selectedProducts">
|
|
26
|
+
<li *ngFor="let product of selectedProducts" class="p-2 rounded-border shadow-sm">
|
|
27
|
+
{{ product.name }}
|
|
28
|
+
</li>
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
`,
|
|
33
|
+
standalone: true,
|
|
34
|
+
imports: []
|
|
35
|
+
})
|
|
36
|
+
export class DragdropBasicDemo implements OnInit {
|
|
37
|
+
availableProducts: Product[] | undefined;
|
|
38
|
+
selectedProducts: Product[] | undefined;
|
|
39
|
+
draggedProduct: Product | undefined | null;
|
|
40
|
+
|
|
41
|
+
ngOnInit() {
|
|
42
|
+
this.selectedProducts = [];
|
|
43
|
+
this.availableProducts = [
|
|
44
|
+
{ id: '1', name: 'Black Watch' },
|
|
45
|
+
{ id: '2', name: 'Bamboo Watch' }
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
dragStart(product: Product) {
|
|
50
|
+
this.draggedProduct = product;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
drop() {
|
|
54
|
+
if (this.draggedProduct) {
|
|
55
|
+
let draggedProductIndex = this.findIndex(this.draggedProduct);
|
|
56
|
+
this.selectedProducts = [...(this.selectedProducts as Product[]), this.draggedProduct];
|
|
57
|
+
this.availableProducts = this.availableProducts?.filter((val, i) => i != draggedProductIndex);
|
|
58
|
+
this.draggedProduct = null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
dragEnd() {
|
|
63
|
+
this.draggedProduct = null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
findIndex(product: Product) {
|
|
67
|
+
let index = -1;
|
|
68
|
+
for (let i = 0; i < (this.availableProducts as Product[]).length; i++) {
|
|
69
|
+
if (product.id === (this.availableProducts as Product[])[i].id) {
|
|
70
|
+
index = i;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return index;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## DataTable
|
|
80
|
+
|
|
81
|
+
Drag and Drop to Table
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { Component, OnInit, inject } from '@angular/core';
|
|
85
|
+
import { Table, TableModule } from '@exhaustive-ui/core/table';
|
|
86
|
+
import { TagModule } from '@exhaustive-ui/core/tag';
|
|
87
|
+
import { ProductService } from '@/service/productservice';
|
|
88
|
+
import { Product } from '@/domain/product';
|
|
89
|
+
|
|
90
|
+
@Component({
|
|
91
|
+
template: `
|
|
92
|
+
<div class="card grid grid-cols-12 gap-4 grid-nogutter">
|
|
93
|
+
<div class="col-span-12 md:col-span-6 drag-column">
|
|
94
|
+
<div *ngFor="let product of availableProducts">
|
|
95
|
+
<div class="product-item" pDraggable="products" (onDragStart)="dragStart(product)" (onDragEnd)="dragEnd()">
|
|
96
|
+
<div class="image-container">
|
|
97
|
+
<img src="https://exhaustive-ui.e-xiste.com/demo/product/{{ product.image }}" [alt]="product.name" class="product-image" />
|
|
98
|
+
</div>
|
|
99
|
+
<div class="product-list-detail">
|
|
100
|
+
<h5 class="mb-2">{{ product.name }}</h5>
|
|
101
|
+
<i class="pi pi-tag product-category-icon"></i>
|
|
102
|
+
<span class="product-category">{{ product.category }}</span>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="product-list-action">
|
|
105
|
+
<h6 class="mb-2">{{ product.price }}</h6>
|
|
106
|
+
<p-tag [value]="product.inventoryStatus" [severity]="getSeverity(product.inventoryStatus)" />
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="col-span-12 md:col-span-6 drop-column" pDroppable="products" (onDrop)="drop()">
|
|
112
|
+
<p-table [value]="selectedProducts">
|
|
113
|
+
<ng-template pTemplate="header">
|
|
114
|
+
<tr>
|
|
115
|
+
<th>ID</th>
|
|
116
|
+
<th>Category</th>
|
|
117
|
+
<th>Name</th>
|
|
118
|
+
<th>Price</th>
|
|
119
|
+
</tr>
|
|
120
|
+
</ng-template>
|
|
121
|
+
<ng-template pTemplate="body" let-product>
|
|
122
|
+
<tr>
|
|
123
|
+
<td>{{ product.id }}</td>
|
|
124
|
+
<td>{{ product.category }}</td>
|
|
125
|
+
<td>{{ product.name }}</td>
|
|
126
|
+
<td>{{ product.price }}</td>
|
|
127
|
+
</tr>
|
|
128
|
+
</ng-template>
|
|
129
|
+
</p-table>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
`,
|
|
133
|
+
standalone: true,
|
|
134
|
+
imports: [TableModule, TagModule],
|
|
135
|
+
providers: [ProductService]
|
|
136
|
+
})
|
|
137
|
+
export class DragdropDatatableDemo implements OnInit {
|
|
138
|
+
private productService = inject(ProductService);
|
|
139
|
+
availableProducts: Product[] | undefined;
|
|
140
|
+
selectedProducts: Product[] | undefined;
|
|
141
|
+
draggedProduct: Product | undefined | null;
|
|
142
|
+
|
|
143
|
+
ngOnInit() {
|
|
144
|
+
this.selectedProducts = [];
|
|
145
|
+
this.productService.getProductsSmall().then((products) => (this.availableProducts = products));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
dragStart(product: Product) {
|
|
149
|
+
this.draggedProduct = product;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
drop() {
|
|
153
|
+
if (this.draggedProduct) {
|
|
154
|
+
let draggedProductIndex = this.findIndex(this.draggedProduct);
|
|
155
|
+
this.selectedProducts = [...(this.selectedProducts as Product[]), this.draggedProduct];
|
|
156
|
+
this.availableProducts = this.availableProducts?.filter((val, i) => i != draggedProductIndex);
|
|
157
|
+
this.draggedProduct = null;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
dragEnd() {
|
|
162
|
+
this.draggedProduct = null;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
findIndex(product: Product) {
|
|
166
|
+
let index = -1;
|
|
167
|
+
for (let i = 0; i < (this.availableProducts as Product[]).length; i++) {
|
|
168
|
+
if (product.id === (this.availableProducts as Product[])[i].id) {
|
|
169
|
+
index = i;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return index;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
getSeverity(status: string) {
|
|
177
|
+
switch (status) {
|
|
178
|
+
case 'INSTOCK':
|
|
179
|
+
return 'success';
|
|
180
|
+
case 'LOWSTOCK':
|
|
181
|
+
return 'warn';
|
|
182
|
+
case 'OUTOFSTOCK':
|
|
183
|
+
return 'danger';
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Drag Handle
|
|
190
|
+
|
|
191
|
+
dragHandle is used to restrict dragging unless mousedown occurs on the specified element. Panel below can only be dragged using its header.
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
import { Component } from '@angular/core';
|
|
195
|
+
import { PanelModule } from '@exhaustive-ui/core/panel';
|
|
196
|
+
import { Product } from '@/domain/product';
|
|
197
|
+
|
|
198
|
+
@Component({
|
|
199
|
+
template: `
|
|
200
|
+
<div class="card">
|
|
201
|
+
<div pDraggable dragHandle=".p-panel-header" class="w-60">
|
|
202
|
+
<p-panel header="Drag Header"> Content </p-panel>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
`,
|
|
206
|
+
standalone: true,
|
|
207
|
+
imports: [PanelModule]
|
|
208
|
+
})
|
|
209
|
+
export class DragdropDraghandleDemo {}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Drop Indicator
|
|
213
|
+
|
|
214
|
+
When a suitable draggable enters a droppable area, the area gets p-draggable-enter class that can be used to style the droppable section.
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
import { Component, OnInit } from '@angular/core';
|
|
218
|
+
import { Product } from '@/domain/product';
|
|
219
|
+
|
|
220
|
+
@Component({
|
|
221
|
+
template: `
|
|
222
|
+
<div class="card flex flex-wrap gap-4">
|
|
223
|
+
<div class="p-2 border border-surface rounded-border w-60 h-40">
|
|
224
|
+
<ul class="list-none flex flex-col gap-2 p-0 m-0">
|
|
225
|
+
<li *ngFor="let product of availableProducts" class="p-2 rounded-border shadow-sm" pDraggable (onDragStart)="dragStart(product)" (onDragEnd)="dragEnd()">
|
|
226
|
+
{{ product.name }}
|
|
227
|
+
</li>
|
|
228
|
+
</ul>
|
|
229
|
+
</div>
|
|
230
|
+
<div class="p-2 w-60 h-40 drop-column" pDroppable (onDrop)="drop()">
|
|
231
|
+
<p class="text-center border-surface border-b">Drop Zone</p>
|
|
232
|
+
<ul class="list-none flex flex-col gap-2 p-0 m-0" *ngIf="selectedProducts">
|
|
233
|
+
<li *ngFor="let product of selectedProducts" class="p-2 rounded-border shadow-sm">
|
|
234
|
+
{{ product.name }}
|
|
235
|
+
</li>
|
|
236
|
+
</ul>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
`,
|
|
240
|
+
standalone: true,
|
|
241
|
+
imports: []
|
|
242
|
+
})
|
|
243
|
+
export class DragdropDropindicatorDemo implements OnInit {
|
|
244
|
+
availableProducts: Product[] | undefined;
|
|
245
|
+
selectedProducts: Product[] | undefined;
|
|
246
|
+
draggedProduct: Product | undefined | null;
|
|
247
|
+
|
|
248
|
+
ngOnInit() {
|
|
249
|
+
this.selectedProducts = [];
|
|
250
|
+
this.availableProducts = [
|
|
251
|
+
{ id: '1', name: 'Black Watch' },
|
|
252
|
+
{ id: '2', name: 'Bamboo Watch' }
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
dragStart(product: Product) {
|
|
257
|
+
this.draggedProduct = product;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
drop() {
|
|
261
|
+
if (this.draggedProduct) {
|
|
262
|
+
let draggedProductIndex = this.findIndex(this.draggedProduct);
|
|
263
|
+
this.selectedProducts = [...(this.selectedProducts as Product[]), this.draggedProduct];
|
|
264
|
+
this.availableProducts = this.availableProducts?.filter((val, i) => i != draggedProductIndex);
|
|
265
|
+
this.draggedProduct = null;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
dragEnd() {
|
|
270
|
+
this.draggedProduct = null;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
findIndex(product: Product) {
|
|
274
|
+
let index = -1;
|
|
275
|
+
for (let i = 0; i < (this.availableProducts as Product[]).length; i++) {
|
|
276
|
+
if (product.id === (this.availableProducts as Product[])[i].id) {
|
|
277
|
+
index = i;
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return index;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|