5.10.1 • Published 10 days ago

@overflo-srl/full-table v5.10.1

Weekly downloads
16
License
-
Repository
-
Last release
10 days ago

FullTable

This library let you use the component <lib-full-table> that provides you a sortable, pageable, filterable angular material table which generates automatic queries based on nestjs/crud.

Setup

Add import {FullTableModule} from '@overflo-srl/full-table'; in your module. You also need to add your backend endpoint into FullTableModule.forRoot(*** BASE_URL ***).

Note: you can also add enviromend variable like FullTableModule.forRoot(enviroment.BASE_PATH)

Styling

You can customize some properties of the table by overriding the following scss variables:

  • fulltableHeaderBackgroundColor: background color of the table header
  • fulltableHeaderTextColor: text color of the table header
  • fulltableBorderColor: border color of the table

Example from styles.scss:

:root {
  --fulltableHeaderBackgroundColor: #282828;
  --fulltableHeaderTextColor: white;
  --fulltableBorderColor: #e3e3e3;
}

Parameters

To generate the table you need to enter basic information for your entity:

[PATH]: base path for your nestjs/crud entity ('/book)

[columnList]: description and settings for your columns (ColumnListModel[])

interface ColumnModel {
  def: string;
  name: string;
  value: {type: string, icon: string, filter: ((e: any) => boolean)}[] | ((e: any) => string);
  type?: string;
  /** Attempts to force cell type when exporting. If omitted, property 'type' is used. */
  exportedType?: string;
  filterDefault?: {title: string, value: string}[];
  sort?: boolean;
  hidden?: boolean
  /** Expects a callback function that will be executed when the cell is clicked. */
  click?: any;
  /** Displays a tooltip when the cell is hovered. */
  tooltip?: string;
  /** Accept an array of FilterOptions ({ displayedValue: string; realValue: string | boolean }) to display a select field 
  /** in the filter form for columns where this property is set. The select options will use 'displayedValue' 
  /** as labels and 'realValue' as values. In filter chip lists will be shown 'displayedValue'. 
  /** This feature currently supports only string, boolean or number type columns. 
  filterOptions?: FilterOption[];
}

OPTIONALS:

(data): an event emitter that emits the array of displayed entities every time there is an update in the table

(selectedChange): an event emitter that emits the array containing all the selected elements every time the array changes. If 'isOnlyOneSelectable' is set to true, it will return an array with only one element

[columnMobile]: description and settings for your column responsive mobile column (() => string)

[actions]: action event emitter that emits when there is an event on the table (refresh every time a value is emitted)

[search]: search query based on nestjs/crud

[join]: join query based on nestjs/crud

[defaultSort]: default sort column query based on nestjs/crud

[defaultFilter]: {name: string, operation?: string, value: string | number}[] default filter chip placed at table startup. (can be removed)

[pageSize]: page size number (default: 5)

[isSelectable]: a boolean value that implements elements selection column if set to true (default false)

[selectAllLimit]: a number that sets a limit on the quantity of items that can be selected simultaneously through the checkbox in the column header for selection, and thus disables it in case the total number of items in the table exceeds the set limit (default 1000)

[selectedElements]: an array of already selected elements

[isOnlyOneSelectable]: A boolean value that, when set to true, allows the selection of only one element in the table. If set, it will automatically set 'isSelectable' to true. (default: false)

FUNCTIONS:

export(exportOptions?: ExportOptions): a function that enables exporting the current table content to an Excel file. The optional parameter exportOptions is an object containing these three optional fields as well:

  • fileName?: a string that allows modifying the name of the exported file, which would otherwise default to ' "export_" + new Date().getTime() '.

  • additionalFilters?: an array of DefaultFilter that includes three fields: name (a string-type field containing the name of the field for filtering), operation? (an optional field of type OperatorsEnum), value (an any-type field allowing the insertion of the value on which the filter is to be applied). This list of filters will be added to the already present table filters. If not present, only the currently existing filters in the table will be applied.

  • alternativeColumns?: an array of ColumnModel representing the column list to be displayed in the exported file. If not specified, the current list of columns in the table will be used. """`

5.10.1

10 days ago

5.10.0

16 days ago

5.9.1

4 months ago

5.9.0

4 months ago

5.8.0

5 months ago

5.5.1

7 months ago

5.5.0

7 months ago

5.3.1

7 months ago

5.3.0

8 months ago

5.1.1

8 months ago

5.1.0

8 months ago

5.6.0

7 months ago

5.4.1

7 months ago

5.4.0

7 months ago

5.2.0

8 months ago

5.0.0

10 months ago

5.7.0

6 months ago

4.1.0

12 months ago

4.0.1

1 year ago

4.0.3

12 months ago

4.0.2

1 year ago

4.0.0

1 year ago

3.2.1

1 year ago

3.2.0

2 years ago

3.1.5

2 years ago

3.0.4

2 years ago

3.0.5

2 years ago

3.0.3

2 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago