@eqproject/eqp-attachments 3.1.3 → 3.1.5
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 +31 -4
- package/esm2022/lib/eqp-attachments.component.mjs +293 -86
- package/esm2022/lib/interfaces/IAttachment.mjs +1 -1
- package/fesm2022/eqproject-eqp-attachments.mjs +292 -85
- package/fesm2022/eqproject-eqp-attachments.mjs.map +1 -1
- package/lib/eqp-attachments.component.d.ts +28 -7
- package/lib/interfaces/IAttachment.d.ts +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -115,15 +115,15 @@ For the best icon display, include Font Awesome in your project's styles, for ex
|
|
|
115
115
|
| `customCardHeightPx` | `number` | `180` | Sets the custom card height in pixels when `cardSize`is `'custom'`. |
|
|
116
116
|
| `showMatCard` | `boolean` | `true` | If `true`(and in table mode), the component is rendered inside a `mat-card`. |
|
|
117
117
|
| `cropDialogClass` | `string` | `undefined` | Assigns a custom CSS class to the image cropper dialog panel. |
|
|
118
|
-
|
|
118
|
+
| `showUploadTitle` | `boolean` | `true` | If `true`, will show title over dropbox |
|
|
119
119
|
---
|
|
120
120
|
|
|
121
121
|
#### **Table View Configuration**
|
|
122
122
|
|
|
123
123
|
| Input | Type | Default | Description |
|
|
124
124
|
| ---------------------- | ----------- | ------------- | -------------------------------------------------------------------------------- |
|
|
125
|
-
| `customColumns` | `'AttachmentFieldColumn'` | `[]` | Array to add custom columns to the table view. |
|
|
126
|
-
|
|
125
|
+
| `customColumns` | `'AttachmentFieldColumn[]'` | `[]` | Array to add custom columns to the table view. |
|
|
126
|
+
| `customMenuActions` | `'AttachmentMenuAction[]'` | `[]` | Array to add custom actions to the table's "more options" (...) menu.
|
|
127
127
|
---
|
|
128
128
|
|
|
129
129
|
#### **Functional Configuration**
|
|
@@ -231,6 +231,16 @@ For the best icon display, include Font Awesome in your project's styles, for ex
|
|
|
231
231
|
| `class` | `string` | A custom CSS class to add to the column's cells. |
|
|
232
232
|
---
|
|
233
233
|
|
|
234
|
+
#### `AttachmentMenuAction` Interface
|
|
235
|
+
|
|
236
|
+
| Property | Type | Description |
|
|
237
|
+
| ----------------------- | ------------------- | ------------------------------------------------------ |
|
|
238
|
+
| `icon` | `string` | mat-icon name to display (e.g., 'share'). |
|
|
239
|
+
| `name` | `string` | Text to show in the menu item.object |
|
|
240
|
+
| `fn` | `(att: IAttachmentDTO) => void` | Function to execute when the item is clicked. |
|
|
241
|
+
| `disabled` | `(att: IAttachmentDTO) => boolean` | Function to dynamically disable the action for a specific row. |
|
|
242
|
+
| `position` | `number` | Display order. Preview is 10, Delete is 100. Use a number in between (e.g., 20) to add an action. |
|
|
243
|
+
---
|
|
234
244
|
|
|
235
245
|
|
|
236
246
|
#### **AttachmentCardSize Type**
|
|
@@ -343,7 +353,8 @@ export class MyComponent {
|
|
|
343
353
|
[headerTitle]="'Project Documents'"
|
|
344
354
|
[showSummary]="true"
|
|
345
355
|
(localEditedAttachments)="onAttachmentsChange($event)"
|
|
346
|
-
[customColumns]="myCustomColumns"
|
|
356
|
+
[customColumns]="myCustomColumns"
|
|
357
|
+
[customMenuActions]="myCustomActions">
|
|
347
358
|
</eqp-attachments>
|
|
348
359
|
|
|
349
360
|
<ng-template #statusTemplate let-att>
|
|
@@ -378,6 +389,7 @@ export class MyComponent {
|
|
|
378
389
|
}
|
|
379
390
|
];
|
|
380
391
|
myCustomColumns: AttachmentFieldColumn[] = [];
|
|
392
|
+
myCustomActions: AttachmentMenuAction[] = [];
|
|
381
393
|
|
|
382
394
|
ngOnInit() {
|
|
383
395
|
this.myCustomColumns = [
|
|
@@ -397,6 +409,21 @@ export class MyComponent {
|
|
|
397
409
|
position: 30 // Shows after "Uploaded By" (20)
|
|
398
410
|
}
|
|
399
411
|
];
|
|
412
|
+
|
|
413
|
+
this.myCustomActions = [
|
|
414
|
+
{
|
|
415
|
+
icon: 'share',
|
|
416
|
+
label: 'Share',
|
|
417
|
+
onClick: (item) => this.shareAttachment(item),
|
|
418
|
+
position: 25 // Show after "Preview" (10) and before "Delete" (100)
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
icon: 'edit',
|
|
422
|
+
label: 'Edit Name',
|
|
423
|
+
onClick: (item) => this.renameAttachment(item),
|
|
424
|
+
position: 26
|
|
425
|
+
}
|
|
426
|
+
];
|
|
400
427
|
}
|
|
401
428
|
```
|
|
402
429
|
|