Update doc (#8085)

This commit is contained in:
Eugenio Romano
2023-01-02 15:00:01 +01:00
committed by GitHub
parent 093b1e8a67
commit 00dfd7c5d9
158 changed files with 758 additions and 928 deletions

View File

@@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2018-05-08
---
# [Card View Item interface](lib/core/src/lib/card-view/interfaces/card-view-item.interface.ts "Defined in card-view-item.interface.ts")
# [Card View Item interface](../../../lib/core/src/lib/card-view/interfaces/card-view-item.interface.ts "Defined in card-view-item.interface.ts")
Defines the implementation of an item in a [Card View component](../components/card-view.component.md).
@@ -50,8 +50,8 @@ Picard's birthday (47457.1):
1. Define the model for the custom type.
Your model must extend the [`CardViewBaseItemModel`](lib/core/src/lib/card-view/models/card-view-baseitem.model.ts) class and implement the [`CardViewItem`](lib/core/src/lib/card-view/interfaces/card-view-item.interface.ts)
and [`DynamicComponentModel`](lib/core/src/lib/services/dynamic-component-mapper.service.ts) interfaces. See the
Your model must extend the [`CardViewBaseItemModel`](../../../lib/core/src/lib/card-view/models/card-view-baseitem.model.ts) class and implement the [`CardViewItem`](../../../lib/core/src/lib/card-view/interfaces/card-view-item.interface.ts)
and [`DynamicComponentModel`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) interfaces. See the
[Card View Text Item model source](https://github.com/Alfresco/alfresco-ng2-components/blob/develop/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.ts)
for an example of how to do this.

View File

@@ -4,7 +4,7 @@ Added: v2.0.0
Status: Active
---
# [DataTableAdapter interface](lib/core/src/lib/datatable/data/datatable-adapter.ts "Defined in datatable-adapter.ts")
# [DataTableAdapter interface](../../../lib/core/src/lib/datatable/data/datatable-adapter.ts "Defined in datatable-adapter.ts")
Defines how table data is supplied to [DataTable](../components/datatable.component.md) and [Tasklist](../../process-services/components/task-list.component.md) components.
@@ -12,28 +12,28 @@ Defines how table data is supplied to [DataTable](../components/datatable.compon
| Name | Type | Description |
| ---- | ---- | ----------- |
| selectedRow | [`DataRow`](lib/core/src/lib/datatable/data/data-row.model.ts) | The data for the currently selected row. |
| selectedRow | [`DataRow`](../../../lib/core/src/lib/datatable/data/data-row.model.ts) | The data for the currently selected row. |
## Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| rowsChanged | [`Subject<Array<DataRow>>`](lib/core/src/lib/datatable/data/data-row.model.ts) | Raised when data adapter gets new rows. |
| rowsChanged | [`Subject<Array<DataRow>>`](../../../lib/core/src/lib/datatable/data/data-row.model.ts) | Raised when data adapter gets new rows. |
## Methods
[`getRows(): Array<DataRow>;`](lib/core/src/lib/datatable/data/data-row.model.ts)<br/>
[`setRows(rows: Array<DataRow>): void;`](lib/core/src/lib/datatable/data/data-row.model.ts)<br/>
[`getRows(): Array<DataRow>;`](../../../lib/core/src/lib/datatable/data/data-row.model.ts)<br/>
[`setRows(rows: Array<DataRow>): void;`](../../../lib/core/src/lib/datatable/data/data-row.model.ts)<br/>
Get/set the values for display in the table using an array of rows.
[`getColumns(): Array<DataColumn>;`](lib/core/src/lib/datatable/data/data-column.model.ts)<br/>
[`setColumns(columns: Array<DataColumn>): void;`](lib/core/src/lib/datatable/data/data-column.model.ts)<br/>
[`getColumns(): Array<DataColumn>;`](../../../lib/core/src/lib/datatable/data/data-column.model.ts)<br/>
[`setColumns(columns: Array<DataColumn>): void;`](../../../lib/core/src/lib/datatable/data/data-column.model.ts)<br/>
Get/set an array of column specifications.
`getValue(row:`[`DataRow,`](lib/core/src/lib/datatable/data/data-row.model.ts)`col: DataColumn): any;`<br/>
Get the data value from a specific table cell.
`getSorting():`[`DataSorting`](lib/core/src/lib/datatable/data/data-sorting.model.ts)`;`<br/>
`getSorting():`[`DataSorting`](../../../lib/core/src/lib/datatable/data/data-sorting.model.ts)`;`<br/>
`setSorting(sorting: DataSorting): void;`<br/>
Get/set the sorting key and direction (ascending or descending).
@@ -42,22 +42,22 @@ Sort the table with a specified key and direction (ascending or descending).
## Details
You can implement [`DataTableAdapter`](lib/core/src/lib/datatable/data/datatable-adapter.ts) in your own class to display your data with the [DataTable](../components/datatable.component.md)
You can implement [`DataTableAdapter`](../../../lib/core/src/lib/datatable/data/datatable-adapter.ts) in your own class to display your data with the [DataTable](../components/datatable.component.md)
and [Tasklist](../../process-services/components/task-list.component.md) components.
This interface (along with other interfaces for column and row data) hides the details of your class from the caller, so you can store your data internally however you like. The DataTable library implements the interface in the [`ObjectDataTableAdapter`](lib/core/src/lib/datatable/data/object-datatable-adapter.ts) class which is the standard adapter for the Datatable component.
This interface (along with other interfaces for column and row data) hides the details of your class from the caller, so you can store your data internally however you like. The DataTable library implements the interface in the [`ObjectDataTableAdapter`](../../../lib/core/src/lib/datatable/data/object-datatable-adapter.ts) class which is the standard adapter for the Datatable component.
The basic idea of [`DataTableAdapter`](lib/core/src/lib/datatable/data/datatable-adapter.ts) is that the caller can request your class to return an array of column
The basic idea of [`DataTableAdapter`](../../../lib/core/src/lib/datatable/data/datatable-adapter.ts) is that the caller can request your class to return an array of column
definition objects. Each of these objects specifies the unique key, name, type and other properties of a single column.
The caller can also request the data values for the table as an array of row objects. The caller accesses the data from a row using a `getValue` method that returns the data from a specified column. This column is identified by the unique key that was set during the column definition.
The data-hiding works the other way around when the caller needs to set data in the [`DataTableAdapter`](lib/core/src/lib/datatable/data/datatable-adapter.ts) class - the internal
The data-hiding works the other way around when the caller needs to set data in the [`DataTableAdapter`](../../../lib/core/src/lib/datatable/data/datatable-adapter.ts) class - the internal
details of the caller's storage are hidden by the column and row interfaces. When the `setColumns` and `setRows` methods are
called on the adapter, it can simply query the column/row objects it receives and then store the data in its own format.
### Columns and rows
Columns are defined by the [`DataColumn`](lib/core/src/lib/datatable/data/data-column.model.ts) interface:
Columns are defined by the [`DataColumn`](../../../lib/core/src/lib/datatable/data/data-column.model.ts) interface:
```ts
interface DataColumn {
@@ -76,7 +76,7 @@ interface DataColumn {
An array of these objects is passed to your object when the `setColumns` method is called. The `key` property is used to identify columns and so each column's key should be unique. The `type` string can have a value of 'text', 'image' or 'date'.
An array of [`DataRow`](lib/core/src/lib/datatable/data/data-row.model.ts) objects is passed to your object when the `setRows` method is called:
An array of [`DataRow`](../../../lib/core/src/lib/datatable/data/data-row.model.ts) objects is passed to your object when the `setRows` method is called:
```ts
interface DataRow {
@@ -93,7 +93,7 @@ Each row contains a set of values. An item in the set is retrieved by passing it
### ObjectDataTableAdapter
The DataTable library provides a implementation of [DataTableAdapter,](lib/core/src/lib/datatable/data/datatable-adapter.ts) called
[`ObjectDataTableAdapter`](lib/core/src/lib/datatable/data/object-datatable-adapter.ts). This is a simple adapter that binds to object arrays and turns object fields into columns:
[`ObjectDataTableAdapter`](../../../lib/core/src/lib/datatable/data/object-datatable-adapter.ts). This is a simple adapter that binds to object arrays and turns object fields into columns:
```ts
let data = new ObjectDataTableAdapter(

View File

@@ -4,7 +4,7 @@ Added: v2.0.0
Status: Active
---
# [FormFieldValidator interface](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts "Defined in form-field-validator.ts")
# [FormFieldValidator interface](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts "Defined in form-field-validator.ts")
Defines how the input fields of [`Form`](../../../lib/process-services/src/lib/task-list/models/form.model.ts) and Task Details components are validated.
@@ -62,16 +62,16 @@ Several validator classes are predefined for you to use:
| Validator name | Checks that: |
| -------------- | ------------ |
| [`RequiredFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field is not left blank |
| [`NumberFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field contains numeric data |
| [`MinLengthFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field text has at least a minimum number of characters |
| [`MaxLengthFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field text has no more than a maximum number of characters |
| [`MinValueFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Numeric field's value is greater than a lower limit |
| [`MaxValueFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Numeric field's vaue is less than an upper limit |
| [`RegExFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field text matches a regular expression |
| [`DateFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field contains a date in the correct format |
| [`MinDateFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Date within a field occurs after a certain starting point |
| [`MaxDateFieldValidator`](lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Date within a field occurs before a certain end point |
| [`RequiredFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field is not left blank |
| [`NumberFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field contains numeric data |
| [`MinLengthFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field text has at least a minimum number of characters |
| [`MaxLengthFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field text has no more than a maximum number of characters |
| [`MinValueFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Numeric field's value is greater than a lower limit |
| [`MaxValueFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Numeric field's vaue is less than an upper limit |
| [`RegExFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field text matches a regular expression |
| [`DateFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Field contains a date in the correct format |
| [`MinDateFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Date within a field occurs after a certain starting point |
| [`MaxDateFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) | Date within a field occurs before a certain end point |
The `FORM_FIELD_VALIDATORS` array contains an instance of each of these classes. You can assign this to the `fieldValidators` property of a [`Form`](../../../lib/process-services/src/lib/task-list/models/form.model.ts) or [Task Details component](../../process-services/components/task-details.component.md) to enable standard validation.
@@ -83,7 +83,7 @@ the form (currency values adding up to a given total, say).
The `type` property of [`FormFieldModel`](../../core/models/form-field.model.md) is often used in the `isSupported` function, since
validation methods typically apply only to specific types of data.
The [`FormFieldTypes`](lib/core/src/lib/form/components/widgets/core/form-field-types.ts)
The [`FormFieldTypes`](../../../lib/core/src/lib/form/components/widgets/core/form-field-types.ts)
class defines convenient constants for the type strings.
The validator in the example

View File

@@ -4,7 +4,7 @@ Added: v2.1.0
Status: Active
---
# [Search Configuration interface](lib/core/src/lib/interface/search-configuration.interface.ts "Defined in search-configuration.interface.ts")
# [Search Configuration interface](../../../lib/core/src/lib/interface/search-configuration.interface.ts "Defined in search-configuration.interface.ts")
Provides fine control of parameters to a search.