arlas-web-contributors / Exports / ChipsSearchContributor
Class: ChipsSearchContributor
This contributor must work with SearchContributor and a component to display several chips label from SearchComponent. This class make the brigde between the component which displays the data and the collaborativeSearchService of the Arlas-web-core which retrieve the data from the server.
Hierarchy
Contributor
↳ ChipsSearchContributor
Table of contents
Constructors
Properties
- autocomplete_field
- autocomplete_size
- cacheDuration
- chipMapData
- collaborativeSearcheService
- collection
- collections
- configService
- endCollaborationEvent
- identifier
- isDataUpdating
- lastBackspaceBus
- query
- search_field
Accessors
Methods
- activateLastBackspace
- addWord
- computeData
- fetchData
- getConfigValue
- getFilterDisplayName
- getName
- getPackageName
- removeWord
- setData
- setName
- setSelection
- updateFromCollaboration
- getJsonSchema
Constructors
constructor
• new ChipsSearchContributor(identifier
, collaborativeSearcheService
, configService
, collection
)
Build a new contributor.
Parameters
Name | Type | Description |
---|---|---|
identifier |
string |
Identifier of contributor. |
collaborativeSearcheService |
CollaborativesearchService |
Instance of CollaborativesearchService from Arlas-web-core. |
configService |
ConfigService |
Instance of ConfigService from Arlas-web-core. |
collection |
string |
- |
Overrides
Contributor.constructor
Defined in
src/contributors/ChipsSearchContributor.ts:76
Properties
autocomplete_field
• autocomplete_field: string
Keyword field on which the autocompletion is performed
Defined in
src/contributors/ChipsSearchContributor.ts:51
autocomplete_size
• autocomplete_size: number
Number of suggested keywords by the autocompletion
Defined in
src/contributors/ChipsSearchContributor.ts:56
cacheDuration
• Protected
cacheDuration: number
Inherited from
Contributor.cacheDuration
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:17
chipMapData
• chipMapData: Map
<string
, number
>
Map of string/number, label/count of all chips, use in input of component
Defined in
src/contributors/ChipsSearchContributor.ts:65
collaborativeSearcheService
• collaborativeSearcheService: CollaborativesearchService
Inherited from
Contributor.collaborativeSearcheService
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:9
collection
• collection: string
Inherited from
Contributor.collection
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:14
collections
• collections: CollectionAggField
[]
Inherited from
Contributor.collections
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:15
configService
• configService: ConfigService
Inherited from
Contributor.configService
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:8
endCollaborationEvent
• endCollaborationEvent: Subject
<unknown
>
Inherited from
Contributor.endCollaborationEvent
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:16
identifier
• identifier: string
Inherited from
Contributor.identifier
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:7
isDataUpdating
• isDataUpdating: boolean
Inherited from
Contributor.isDataUpdating
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:13
lastBackspaceBus
• lastBackspaceBus: Subject
<boolean
>
Defined in
src/contributors/ChipsSearchContributor.ts:67
query
• query: string
Global query based on all concatenate chips word
Defined in
src/contributors/ChipsSearchContributor.ts:61
search_field
• search_field: string
Keyword field on which the full text search is applied
Defined in
src/contributors/ChipsSearchContributor.ts:46
Accessors
updateData
• get
updateData(): boolean
Returns
boolean
whether the data of contributor should be updated.
Inherited from
Contributor.updateData
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:43
• set
updateData(value
): void
Parameters
Name | Type | Description |
---|---|---|
value |
boolean |
set if the data of contributor should be updated or not. |
Returns
void
whether the data of contributor should be updated.
Inherited from
Contributor.updateData
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:47
Methods
activateLastBackspace
▸ activateLastBackspace(lastBackspace
): void
Subscribe to the sizeOnSearchBackspaceBus to remove last chip on backspace keyup
Parameters
Name | Type |
---|---|
lastBackspace |
Subject <boolean > |
Returns
void
Defined in
src/contributors/ChipsSearchContributor.ts:214
addWord
▸ addWord(value
): void
Add a new chip with value and count, set filter.
Parameters
Name | Type | Description |
---|---|---|
value |
string |
Label of the chip. |
Returns
void
Defined in
src/contributors/ChipsSearchContributor.ts:178
computeData
▸ computeData(data
): Object
Parameters
Name | Type |
---|---|
data |
Object |
data.hits |
Hits |
data.label |
string |
Returns
Object
Name | Type |
---|---|
hits |
Hits |
label |
string |
Overrides
Contributor.computeData
Defined in
src/contributors/ChipsSearchContributor.ts:145
fetchData
▸ fetchData(collaborationEvent
): Observable
<{ hits
: Hits
; label
: string
}>
Parameters
Name | Type |
---|---|
collaborationEvent |
CollaborationEvent |
Returns
Observable
<{ hits
: Hits
; label
: string
}>
Overrides
Contributor.fetchData
Defined in
src/contributors/ChipsSearchContributor.ts:93
getConfigValue
▸ getConfigValue(key
): any
Parameters
Name | Type | Description |
---|---|---|
key |
string |
a key defined in configuration. |
Returns
any
value of the key
in configuration.
Inherited from
Contributor.getConfigValue
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:31
getFilterDisplayName
▸ getFilterDisplayName(): string
Returns
string
Pretty name of contributor based on query propoerty.
Overrides
Contributor.getFilterDisplayName
Defined in
src/contributors/ChipsSearchContributor.ts:165
getName
▸ getName(): string
Returns
string
name of contributor set in configuration.
Inherited from
Contributor.getName
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:35
getPackageName
▸ getPackageName(): string
Returns
string
Package name for the configuration service.
Overrides
Contributor.getPackageName
Defined in
src/contributors/ChipsSearchContributor.ts:171
removeWord
▸ removeWord(word
): void
Remove a chip , set filter.
Parameters
Name | Type |
---|---|
word |
string |
Returns
void
Defined in
src/contributors/ChipsSearchContributor.ts:204
setData
▸ setData(data
): any
Parameters
Name | Type |
---|---|
data |
Object |
data.hits |
Hits |
data.label |
string |
Returns
any
Overrides
Contributor.setData
Defined in
src/contributors/ChipsSearchContributor.ts:148
setName
▸ setName(name
): void
Parameters
Name | Type |
---|---|
name |
string |
Returns
void
set the name of the contributor
Inherited from
Contributor.setName
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:39
setSelection
▸ setSelection(collaboration
): any
Parameters
Name | Type |
---|---|
collaboration |
Collaboration |
Returns
any
Overrides
Contributor.setSelection
Defined in
src/contributors/ChipsSearchContributor.ts:158
updateFromCollaboration
▸ updateFromCollaboration(collaborationEvent
): void
Parameters
Name | Type |
---|---|
collaborationEvent |
CollaborationEvent |
Returns
void
Inherited from
Contributor.updateFromCollaboration
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:56
getJsonSchema
▸ Static
getJsonSchema(): Object
Returns
Object
Defined in
src/contributors/ChipsSearchContributor.ts:89