spiderly 19.8.7 → 19.8.8

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.
@@ -109,6 +109,8 @@ export declare class SpiderlyDataTableComponent implements OnInit, AfterViewInit
109
109
  isDropOrMulti(filterType: string): boolean;
110
110
  navigateToDetails(rowId: number): void;
111
111
  onRowClick(row: any): void;
112
+ onCellClick(col: Column, rowData: any, event: MouseEvent): void;
113
+ private buildClickEvent;
112
114
  deleteObject(rowId: number): void;
113
115
  deleteSelectedObjects(): void;
114
116
  private openDeleteConfirmation;
@@ -174,7 +176,17 @@ export declare class Column<T = any> {
174
176
  showTime?: boolean;
175
177
  decimalPlaces?: number;
176
178
  sortable?: boolean;
177
- constructor({ name, field, filterField, filterType, filterPlaceholder, showMatchModes, showAddButton, dropdownOrMultiselectValues, actions, editable, showTime, decimalPlaces, sortable, }?: {
179
+ /**
180
+ * Fired when this column's cell is clicked. Receives a {@link CellClickEvent} with the row id,
181
+ * the column field, the full row, the raw and formatted cell value, the clicked `<td>` element
182
+ * (use it to anchor an overlay/popover), and the original `MouseEvent`.
183
+ *
184
+ * Setting this makes the cell visibly clickable (cursor + hover) and the click no longer bubbles
185
+ * up to row navigation. The mirror of {@link Action.onClick}, but for plain value cells.
186
+ * Not applied to editable cells — those belong to their inline input.
187
+ */
188
+ onCellClick?: (event: CellClickEvent) => void;
189
+ constructor({ name, field, filterField, filterType, filterPlaceholder, showMatchModes, showAddButton, dropdownOrMultiselectValues, actions, editable, showTime, decimalPlaces, sortable, onCellClick, }?: {
178
190
  name?: string;
179
191
  field?: string & keyof T;
180
192
  filterField?: string & keyof T;
@@ -188,6 +200,7 @@ export declare class Column<T = any> {
188
200
  showTime?: boolean;
189
201
  decimalPlaces?: number;
190
202
  sortable?: boolean;
203
+ onCellClick?: (event: CellClickEvent) => void;
191
204
  });
192
205
  }
193
206
  /**
@@ -208,6 +221,19 @@ export interface ActionClickEvent {
208
221
  /** The original DOM click event. */
209
222
  originalEvent: MouseEvent;
210
223
  }
224
+ /**
225
+ * Payload passed to {@link Column.onCellClick} when a cell is clicked. A superset of
226
+ * {@link ActionClickEvent} (same `id` / `row` / `element` / `originalEvent`) plus the cell's
227
+ * column and value. Every field is populated by the data table.
228
+ */
229
+ export interface CellClickEvent extends ActionClickEvent {
230
+ /** The clicked column's `field`. */
231
+ field: string;
232
+ /** The cell's raw value (`row[field]`). */
233
+ value: any;
234
+ /** The formatted value shown in the cell (what the table renders via `getRowData`). */
235
+ displayValue: string;
236
+ }
211
237
  export declare class RowClickEvent {
212
238
  index?: number;
213
239
  id?: number;
@@ -26,6 +26,7 @@ export declare function getFileNameFromContentDisposition(resp: HttpResponse<Blo
26
26
  export declare function toCommaSeparatedString<T>(input: T[]): string;
27
27
  export declare function isFileImageType(mimeType: string): boolean;
28
28
  export declare function isExcelFileType(mimeType: string): boolean;
29
+ export declare function saveResponseAsFile(res: HttpResponse<Blob>, fallbackName: string): void;
29
30
  export declare function exportListToExcel(exportListToExcelObservableMethod: (filter: Filter) => Observable<any>, filter: Filter): void;
30
31
  export declare function getPrimengNamebookOptions(namebookList: Namebook[]): PrimengOption[];
31
32
  export declare function getPrimengDropdownNamebookOptions(getDropdownListObservable: (parentEntityId?: number) => Observable<Namebook[]>, parentEntityId?: number): Observable<PrimengOption[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spiderly",
3
- "version": "19.8.7",
3
+ "version": "19.8.8",
4
4
  "author": "Filip Trivan",
5
5
  "license": "MIT",
6
6
  "description": "Spiderly Angular Library to use in combination with Spiderly.",
@@ -34,6 +34,15 @@
34
34
  }
35
35
 
36
36
  :host {
37
+ // The `.clickable` affordance is shared: clickable rows (navigateOnRowClick) and opt-in cells
38
+ // (Column.onCellClick) both get a pointer cursor; cells additionally underline on hover.
39
+ ::ng-deep .clickable {
40
+ cursor: pointer;
41
+ }
42
+ ::ng-deep td.clickable:hover {
43
+ text-decoration: underline;
44
+ }
45
+
37
46
  ::ng-deep {
38
47
  .p-datatable-thead {
39
48
  position: unset !important;
File without changes
File without changes
File without changes
File without changes
File without changes