File

src/lib/search/sz-search/sz-search.component.ts

Description

Provides a search box component that can execute search queries and return results.

Example :
<!-- (WC javascript) SzSearchComponent -->
<sz-wc-search
id="sz-search"
name="Isa Creepr"></sz-wc-search>
<script>
 document.getElementById('sz-search').addEventListener('resultsChange', (results) => {
   console.log('search results: ', results);
 });
</script>
Example :
<!-- (Angular) SzSearchComponent -->
<sz-search
name="Isa Creepr"
(resultsChange)="myResultsHandler($event)"
(searchStart)="showSpinner()"
(searchEnd)="hideSpinner()"></sz-search>
Example :
<!-- (WC javascript) SzSearchComponent and SzSearchResultsComponent combo -->
<sz-wc-search
id="sz-search"
name="Isa Creepr"></sz-wc-search>
<sz-wc-search-results id="sz-search-results"></sz-wc-search-results>
<script>
 var szSearchComponent = document.getElementById('sz-search');
 var szSearchResultsComponent = document.getElementById('sz-search-results');
 szSearchComponent.addEventListener('resultsChange', (evt) => {
   console.log('search results: ', evt);
   szSearchResultsComponent.results = evt.detail;
 });
</script>

Implements

OnInit OnDestroy

Metadata

Index

Properties
Methods
Inputs
Outputs
Accessors

Constructor

constructor(fb: UntypedFormBuilder, configService: ConfigService, cd: ChangeDetectorRef, apiConfigService: SzConfigurationService, prefs: SzPrefsService, searchService: SzSearchService, folios: SzFoliosService, dialog: MatDialog, bottomSheet: MatBottomSheet, breakpointObserver: BreakpointObserver)
Parameters :
Name Type Optional
fb UntypedFormBuilder No
configService ConfigService No
cd ChangeDetectorRef No
apiConfigService SzConfigurationService No
prefs SzPrefsService No
searchService SzSearchService No
folios SzFoliosService No
dialog MatDialog No
bottomSheet MatBottomSheet No
breakpointObserver BreakpointObserver No

Inputs

address
Type : any

sets the value of the address field

Example :
<sz-search address="421 Rawling Str">
allowedTypeAttributes
Type : {}
Default value : [ 'NIN_NUMBER', 'ACCOUNT_NUMBER', 'SSN_NUMBER', 'SSN_LAST4', 'DRIVERS_LICENSE_NUMBER', 'PASSPORT_NUMBER', 'NATIONAL_ID_NUMBER', 'OTHER_ID_NUMBER', 'TAX_ID_NUMBER', 'TRUSTED_ID_NUMBER' ]

collection of which mapping attributes to show in the identifiers pulldown.

attributeTypes
Type : SzAttributeType[]
cancelButtonLabel
Type : string
Default value : "Clear Search Criteria"
cancelButtonLabelShort
Type : string
Default value : "Clear"
disableACCTNUMOption
Type : any

disable the identifier type "ACCOUNT NUMBER" option

disableAddress
Type : any

disable the "Address" field. input cannot be edited.

disableClearButton
Type : any

disable the clear button. button is not clickable.

disableDob
Type : any

disable the "Date of Birth" field. input cannot be edited.

disableDRLICOption
Type : any

disable the identifier type "DRLIC" option

disableEmail
Type : any

disable the "Email" field. input cannot be edited.

disableIdentifier
Type : any

disable the "Identifier" field. input cannot be edited.

disableIdentifierOptions
Type : [] | string

disable a set of identifier type options. format is "SOCIAL_NETWORK, DRIVERS_LICENSE_NUMBER" or array of strings

disableIdentifierType
Type : any

disable the "Identifier Type" field. input cannot be edited.

disableName
Type : any

disable the "Name" field. input cannot be edited.

disableNationalIDOption
Type : any

disable the identifier type "NationalID" option

disableNINNumberOption
Type : any

disable the identifier type "NIN" option

disableOtherIDOption
Type : any

disable the identifier type "Other ID" option

disableOtherTaxIDOption
Type : any

disable the identifier type "Tax ID" option

disablePassportOption
Type : any

disable the identifier type "Passport" option

disablePhone
Type : any

disable the "Phone Number" field. input cannot be edited.

disableResetButton
Type : any

disable the reset button. button is not clickable.

disableSearchButton
Type : any

disable the search button. button is not clickable.

disableSSNLAST4Option
Type : any

disable the identifier type "SSN Last 4" option

disableSSNOption
Type : any

disable the identifier type "SSN" option

disableTrustedIDOption
Type : any

disable the identifier type "Trusted ID" option

dob
Type : any

sets the value of the date of birth form field

email
Type : any

sets the value of the email field.

Example :
<sz-search email="guy.i.am.looking&#64;for.com">
enableACCTNUMOption
Type : any

enable the identifier type "ACCOUNT NUMBER" option

enableDRLICOption
Type : any

enable the identifier type "DRLIC" option

enableIdentifierOptions
Type : [] | string

enable a set of identifier type options. format is "SOCIAL_NETWORK, DRIVERS_LICENSE_NUMBER" or array of strings

enableNationalIDOption
Type : any

enable the identifier type "NationalID" option

enableNINNumberOption
Type : any

enable the identifier type "NIN" option

enableOtherIDOption
Type : any

enable the identifier type "Other ID" option

enableOtherTaxIDOption
Type : any

enable the identifier type "Tax ID" option

enablePassportOption
Type : any

enable the identifier type "Passport" option

enableSSNLAST4Option
Type : any

enable the identifier type "SSN Last 4" option

enableSSNOption
Type : any

enable the identifier type "SSN" option

enableTrustedIDOption
Type : any

enable the identifier type "Trusted ID" option

forceLayout
Type : string | []

Takes a collection or a single value of layout enum css classnames to pass to all children components. this value overrides auto-responsive css adjustments.

Example :
getAttributesOnConfigChange
Type : boolean
Default value : true

whether or not to fetch new attributes from the api server when a configuration change is detected

hideAddress
Type : any

hide the "Address" input field

hideClearButton
Type : any

hide the clear button

hideDob
Type : any

hide the "DOB" input field

hideEmail
Type : any

hide the "Email" input field

hideIdentifier
Type : any

hide the "Identifier" input field

hideIdentifierType
Type : any

hide the "Identifier Type" input field

hideName
Type : any

hide the "Name" input field

hidePhone
Type : any

hide the "Phone Number" input field

hideResetButton
Type : any

hide the reset button

hideSearchButton
Type : any

hide the search button

identifier
Type : any

sets the value of the identifier field

layoutBreakpoints
Type : {}
Default value : [ {cssClass: 'layout-wide', minWidth: 1021 }, {cssClass: 'layout-medium', minWidth: 830, maxWidth: 1120 }, {cssClass: 'layout-narrow', maxWidth: 829 } ]

the width to switch from wide to narrow layout

layoutClasses
Type : [] | string
name
Type : any

the name field of the search form.

Example :
<sz-search name="Good Guy">
phone
Type : any

sets the value of the phone field

searchButtonLabel
Type : string
Default value : "Search"

text that shows up in buttons

searchButtonLabelShort
Type : string
Default value : "Search"
searchValue
Type : SzEntitySearchParams

populate the search fields with an pre-existing set of search parameters.

showIdentifierTypesPicker
Type : any

whether or not to show the identifier types picker button

showSearchLabel
Type : boolean
Default value : true

whether or not to show the search box label

updateAttributeTypes
Type : () => void
Default value : (): void => { // get attributes this.configService.getAttributeTypes() .pipe( takeUntil(this.unsubscribe$), map( (resp: SzAttributeTypesResponse) => resp.data.attributeTypes ), first() ) .subscribe((attributeTypes: SzAttributeType[]) => { // yup this.inputAttributeTypes = attributeTypes; this.cd.markForCheck(); this.cd.detectChanges(); }, (err)=> { this.searchException.next( err ); //TODO: remove in breaking change release this.exception.next( err ); }); }

Pull in the list of attribute types from the api server.

waitForConfigChange
Type : any

whether or not to show the wait for the the api conf to change before fetching resources like the identifiers list

Outputs

exception
Type : EventEmitter<Error>

emitted when a search encounters an exception

parameterChange
Type : Subject<SzEntitySearchParams>

emmitted when parameters of the search have been changed.

resultsChange
Type : Subject<SzAttributeSearchResult[]>

emmitted when the search results have been changed.

resultsCleared
Type : EventEmitter<void>

emmitted when the results have been cleared.

searchEnd
Type : EventEmitter<number>

emitted when a search is done being performed.

searchException
Type : EventEmitter<Error>

emitted when a search encounters an exception

searchStart
Type : EventEmitter<SzSearchFormParams>

emitted when a search is being performed.

Methods

Public checkHistoryForMatchOnChange
checkHistoryForMatchOnChange(event)

checks to see if a value in a field just changed due to the user selecting a value from a previous search.

In the case of a "name" select the selection also populates any other parameters that were also in the form at the time of the search.

Parameters :
Name Optional
event No
Returns : void
Public chooseIdentifiers
chooseIdentifiers(event: Event)
Parameters :
Name Type Optional
event Event No
Returns : void
Public clearSearch
clearSearch()

clear the search params and form inputs.

Returns : void
Public getAnyDisabled
getAnyDisabled(keys: string[])
Parameters :
Name Type Optional
keys string[] No
Returns : string
getCssQueryFromCriteria
getCssQueryFromCriteria(minWidth?: number, maxWidth?: number)
Parameters :
Name Type Optional
minWidth number Yes
maxWidth number Yes
Returns : string | undefined
Public getDisabled
getDisabled(key: string)
Parameters :
Name Type Optional
key string No
Returns : string
Public getHistoryOptions
getHistoryOptions(fieldName: string)

reusable method for getting search history lists deduped, ordered, mapped from "search_history" property

Parameters :
Name Type Optional
fieldName string No
Returns : string[]
Public getSearchParams
getSearchParams()

get the current search params from input values

Returns : any
ngOnDestroy
ngOnDestroy()

unsubscribe when component is destroyed

Returns : void
Public onKeyEnter
onKeyEnter()

submits search form on enter press if the submit button is currently hidden

Returns : void
Public submitSearch
submitSearch()

submit current search params to search service. when search service returns a result it publishes the result through the resultsChange event emitter, and any parameter changes through the paramsChange emmitter.

Returns : void

Properties

Public breakpointObserver
Type : BreakpointObserver
Public search_history
Type : SzSearchHistoryFolioItem[]

the folio items that holds last "X" searches performed

Public unsubscribe$
Default value : new Subject<void>()

subscription to notify subscribers to unbind

Accessors

inputIdentifierTypesPicker
setinputIdentifierTypesPicker(value)

whether or not to show the identifier types picker button

Parameters :
Name Optional
value No
Returns : void
showIdentifierTypesPicker
getshowIdentifierTypesPicker()

whether or not to show the identifier types picker button

Returns : boolean
searchHistoryDisabled
getsearchHistoryDisabled()

whether or not to display search history drop downs. set from searchform prefs

Returns : boolean
searchHistoryName
getsearchHistoryName()

all the "Name" field search values from last X searches in history folio.

Returns : string[]
searchHistoryDob
getsearchHistoryDob()

all the "Date of Birth" in the form from last X searches in history folio.

Returns : string[]
searchHistoryIdentifier
getsearchHistoryIdentifier()

all the "Identifier" values in the form from last X searches in history folio.

Returns : string[]
searchHistoryAddress
getsearchHistoryAddress()

all the "Address" values in the form from last X searches in history folio.

Returns : string[]
searchHistoryPhone
getsearchHistoryPhone()

all the "Phone Number" values in the form from last X searches in history folio.

Returns : string[]
searchHistoryEmail
getsearchHistoryEmail()

all the "Date of Birth" values in the form from last X searches in history folio.

Returns : string[]
inputName
setinputName(value)

the name field of the search form.

Example :
<sz-search name="Good Guy">
Parameters :
Name Optional
value No
Example :
<sz-search name="Good Guy">
Returns : void
inputEmail
setinputEmail(value)

sets the value of the email field.

Example :
<sz-search email="guy.i.am.looking&#64;for.com">
Parameters :
Name Optional
value No
Example :
<sz-search email="guy.i.am.looking&#64;for.com">
Returns : void
inputAddress
setinputAddress(value)

sets the value of the address field

Example :
<sz-search address="421 Rawling Str">
Parameters :
Name Optional
value No
Example :
<sz-search address="421 Rawling Str">
Returns : void
inputPhone
setinputPhone(value)

sets the value of the phone field

Parameters :
Name Optional
value No
Returns : void
inputIdentifier
setinputIdentifier(value)

sets the value of the identifier field

Parameters :
Name Optional
value No
Returns : void
inputDob
setinputDob(value)

sets the value of the date of birth form field

Parameters :
Name Optional
value No
Returns : void
hideSearchButton
sethideSearchButton(value: any)

hide the search button

Parameters :
Name Type Optional
value any No
Returns : void
hideResetButton
sethideResetButton(value: any)

hide the reset button

Parameters :
Name Type Optional
value any No
Returns : void
hideClearButton
sethideClearButton(value: any)

hide the clear button

Parameters :
Name Type Optional
value any No
Returns : void
hideName
sethideName(value: any)

hide the "Name" input field

Parameters :
Name Type Optional
value any No
Returns : void
hideDob
sethideDob(value: any)

hide the "DOB" input field

Parameters :
Name Type Optional
value any No
Returns : void
hideIdentifier
sethideIdentifier(value: any)

hide the "Identifier" input field

Parameters :
Name Type Optional
value any No
Returns : void
hideEmail
sethideEmail(value: any)

hide the "Email" input field

Parameters :
Name Type Optional
value any No
Returns : void
hideAddress
sethideAddress(value: any)

hide the "Address" input field

Parameters :
Name Type Optional
value any No
Returns : void
hidePhone
sethidePhone(value: any)

hide the "Phone Number" input field

Parameters :
Name Type Optional
value any No
Returns : void
hideIdentifierType
sethideIdentifierType(value: any)

hide the "Identifier Type" input field

Parameters :
Name Type Optional
value any No
Returns : void
disableSearchButton
setdisableSearchButton(value: any)

disable the search button. button is not clickable.

Parameters :
Name Type Optional
value any No
Returns : void
disableResetButton
setdisableResetButton(value: any)

disable the reset button. button is not clickable.

Parameters :
Name Type Optional
value any No
Returns : void
disableClearButton
setdisableClearButton(value: any)

disable the clear button. button is not clickable.

Parameters :
Name Type Optional
value any No
Returns : void
disableName
setdisableName(value: any)

disable the "Name" field. input cannot be edited.

Parameters :
Name Type Optional
value any No
Returns : void
disableDob
setdisableDob(value: any)

disable the "Date of Birth" field. input cannot be edited.

Parameters :
Name Type Optional
value any No
Returns : void
disableIdentifier
setdisableIdentifier(value: any)

disable the "Identifier" field. input cannot be edited.

Parameters :
Name Type Optional
value any No
Returns : void
disableEmail
setdisableEmail(value: any)

disable the "Email" field. input cannot be edited.

Parameters :
Name Type Optional
value any No
Returns : void
disableAddress
setdisableAddress(value: any)

disable the "Address" field. input cannot be edited.

Parameters :
Name Type Optional
value any No
Returns : void
disablePhone
setdisablePhone(value: any)

disable the "Phone Number" field. input cannot be edited.

Parameters :
Name Type Optional
value any No
Returns : void
disableIdentifierType
setdisableIdentifierType(value: any)

disable the "Identifier Type" field. input cannot be edited.

Parameters :
Name Type Optional
value any No
Returns : void
disableNINNumberOption
setdisableNINNumberOption(value: any)

disable the identifier type "NIN" option

Parameters :
Name Type Optional
value any No
Returns : void
disableACCTNUMOption
setdisableACCTNUMOption(value: any)

disable the identifier type "ACCOUNT NUMBER" option

Parameters :
Name Type Optional
value any No
Returns : void
disableSSNOption
setdisableSSNOption(value: any)

disable the identifier type "SSN" option

Parameters :
Name Type Optional
value any No
Returns : void
disableSSNLAST4Option
setdisableSSNLAST4Option(value: any)

disable the identifier type "SSN Last 4" option

Parameters :
Name Type Optional
value any No
Returns : void
disableDRLICOption
setdisableDRLICOption(value: any)

disable the identifier type "DRLIC" option

Parameters :
Name Type Optional
value any No
Returns : void
disablePassportOption
setdisablePassportOption(value: any)

disable the identifier type "Passport" option

Parameters :
Name Type Optional
value any No
Returns : void
disableNationalIDOption
setdisableNationalIDOption(value: any)

disable the identifier type "NationalID" option

Parameters :
Name Type Optional
value any No
Returns : void
disableOtherIDOption
setdisableOtherIDOption(value: any)

disable the identifier type "Other ID" option

Parameters :
Name Type Optional
value any No
Returns : void
disableOtherTaxIDOption
setdisableOtherTaxIDOption(value: any)

disable the identifier type "Tax ID" option

Parameters :
Name Type Optional
value any No
Returns : void
disableTrustedIDOption
setdisableTrustedIDOption(value: any)

disable the identifier type "Trusted ID" option

Parameters :
Name Type Optional
value any No
Returns : void
enableNINNumberOption
setenableNINNumberOption(value: any)

enable the identifier type "NIN" option

Parameters :
Name Type Optional
value any No
Returns : void
enableACCTNUMOption
setenableACCTNUMOption(value: any)

enable the identifier type "ACCOUNT NUMBER" option

Parameters :
Name Type Optional
value any No
Returns : void
enableSSNOption
setenableSSNOption(value: any)

enable the identifier type "SSN" option

Parameters :
Name Type Optional
value any No
Returns : void
enableSSNLAST4Option
setenableSSNLAST4Option(value: any)

enable the identifier type "SSN Last 4" option

Parameters :
Name Type Optional
value any No
Returns : void
enableDRLICOption
setenableDRLICOption(value: any)

enable the identifier type "DRLIC" option

Parameters :
Name Type Optional
value any No
Returns : void
enablePassportOption
setenablePassportOption(value: any)

enable the identifier type "Passport" option

Parameters :
Name Type Optional
value any No
Returns : void
enableNationalIDOption
setenableNationalIDOption(value: any)

enable the identifier type "NationalID" option

Parameters :
Name Type Optional
value any No
Returns : void
enableOtherIDOption
setenableOtherIDOption(value: any)

enable the identifier type "Other ID" option

Parameters :
Name Type Optional
value any No
Returns : void
enableOtherTaxIDOption
setenableOtherTaxIDOption(value: any)

enable the identifier type "Tax ID" option

Parameters :
Name Type Optional
value any No
Returns : void
enableTrustedIDOption
setenableTrustedIDOption(value: any)

enable the identifier type "Trusted ID" option

Parameters :
Name Type Optional
value any No
Returns : void
enableIdentifierOptions
setenableIdentifierOptions(options: string[] | string)

enable a set of identifier type options. format is "SOCIAL_NETWORK, DRIVERS_LICENSE_NUMBER" or array of strings

Parameters :
Name Type Optional
options string[] | string No
Returns : void
disableIdentifierOptions
setdisableIdentifierOptions(options: string[] | string)

disable a set of identifier type options. format is "SOCIAL_NETWORK, DRIVERS_LICENSE_NUMBER" or array of strings

Parameters :
Name Type Optional
options string[] | string No
Returns : void
forceLayout
setforceLayout(value: string | string[])

Takes a collection or a single value of layout enum css classnames to pass to all children components. this value overrides auto-responsive css adjustments.

Example :
Parameters :
Name Type Optional
value string | string[] No
Example :
forceLayout=&quot;layout-narrow&quot;
Returns : void
layoutClasses
getlayoutClasses()
setlayoutClasses(value: string[] | string)
Parameters :
Name Type Optional
value string[] | string No
Returns : void
inputAttributeTypes
getinputAttributeTypes()
setinputAttributeTypes(value: SzAttributeType[])
Parameters :
Name Type Optional
value SzAttributeType[] No
Returns : void
placeHolderTextForIdentifierField
getplaceHolderTextForIdentifierField()

Returns the placeholder text to show in the "Identifier" field for the selected "Identifier Type".

Returns : string
waitForConfigChange
getwaitForConfigChange()
setwaitForConfigChange(value: any)

whether or not to show the wait for the the api conf to change before fetching resources like the identifiers list

Parameters :
Name Type Optional
value any No
Returns : void

The search box component and the search results component are split up. this is done for some practical reasons. most noteably, so results can be placed wherever it makes sense to put them. This does complicate set up a tiny bit, but the tradeoff in flexibility is well worth it.

So, lets get down to business. lets bind the output of the search component to the input of the search results component.

Angular

first two methods to your component(or app.component.ts) that will handle the output of our search component:

Example :
  public onSearchResults(evt: SzSearchResults) {
    console.log('@senzing/sdk-components-ng/sz-search/searchResults: ', evt);
    // store on current scope
    this.currentSearchResults = evt;
  }

  public onSearchParameterChange(searchParams: SzEntitySearchParams) {
    // store search parameter on current scope
    this.currentSearchParameters = searchParams;
  }

and the property currentSearchResults and import the SzAttributeSearchResult model:

Example :
public currentSearchResults: SzAttributeSearchResult[];

your app.component.ts up to this point should look something like this:

Example :
import {
  SzAttributeSearchResult,
  SzEntitySearchParams,
  SzSearchComponent
} from '@senzing/sdk-components-ng';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements AfterViewInit {
  public currentSearchResults: SzAttributeSearchResult[];
  public currentSearchParameters: SzEntitySearchParams;

  constructor(){}

  public onSearchResults(evt: SzAttributeSearchResult[]){
    // store on current scope
    this.currentSearchResults = evt;
  }

  public onSearchParameterChange(searchParams: SzEntitySearchParams) {
    // store search parameter on current scope
    this.currentSearchParameters = searchParams;
  }
}

now lets add the attrribute search component(sz-search) to the method we just created. Add the following to your app.component.html file:

Example :
<!-- start search box -->
<sz-search 
  (resultsChange)="onSearchResults($event)"
  (parameterChange)="onSearchParameterChange($event)"></sz-search>
<!-- end search box -->

the attribute in parens just tells angular that it's an event and not just an attribute.

Now we should be getting the results of the search, and assigning it to the class property currentSearchResults. The next step is to do something with that data, so add the following to your app.component.html file:

Example :
<!-- start search results -->
<sz-search-results [results]="currentSearchResults" [parameters]="currentSearchParameters"></sz-search-results>
<!-- end search results -->

Web Components


  <!-- @senzing/sdk/search/sz-search -->
  <!--
    NAME_FULL
    DATE_OF_BIRTH
    IDENTIFIER
    IDENTIFIER_TYPE
    ADDR_FULL
    PHONE_NUMBER
    EMAIL_ADDRESS
  -->
  <div class="content" *ngIf="true"
  [ngClass]="_layoutClasses"
  >
      <section class="entity search" (ngSubmit)="submitSearch()">
        <form class="form" [formGroup]="entitySearchForm" novalidate>
          <div class="sz-row">
            <div class="field name" [class.disabled]="disabledFields['name']" *ngIf="!hiddenFields['name']">
              <label for="entity-name">Name</label>
              <input formControlName="NAME_FULL"
                      class="search-input"
                      id="entity-name"
                      type="text"
                      list="search-history-entity-name"
                      [attr.disabled]="getDisabled('name')"
                      (keyup.enter)="onKeyEnter()"
                      placeholder="Search for Name"
                      (input)="checkHistoryForMatchOnChange($event)">
              <datalist *ngIf="searchHistoryName.length > 0 && !searchHistoryDisabled" id="search-history-entity-name">
                <option *ngFor="let item of searchHistoryName" [value]="item">{{item}}</option>
              </datalist>
            </div>
            <div class="field dob" [class.disabled]="disabledFields['dob']" *ngIf="!hiddenFields['dob']">
              <label for="entity-dob">Date of Birth</label>
              <input formControlName="DATE_OF_BIRTH"
                      id="entity-dob"
                      type="text"
                      list="search-history-entity-dob"
                      [attr.disabled]="getDisabled('dob')"
                      (keyup.enter)="onKeyEnter()"
                      placeholder="mm/dd/yyyy">
              <datalist *ngIf="searchHistoryDob.length > 0 && !searchHistoryDisabled" id="search-history-entity-dob">
                <option *ngFor="let item of searchHistoryDob" [value]="item">{{item}}</option>
              </datalist>
            </div>
            <div class="field identifier" [class.disabled]="disabledFields['identifier']" *ngIf="!hiddenFields['identifier']">
              <label for="entity-identifier">Identifier</label>
              <input formControlName="IDENTIFIER"
                      id="entity-identifier"
                      type="text"
                      list="search-history-entity-identifier"
                      [attr.disabled]="getDisabled('identifier')"
                      (keyup.enter)="onKeyEnter()"
                      [placeholder]="placeHolderTextForIdentifierField">
              <datalist *ngIf="searchHistoryIdentifier.length > 0 && !searchHistoryDisabled" id="search-history-entity-identifier">
                <option *ngFor="let item of searchHistoryIdentifier" [value]="item">{{item}}</option>
              </datalist>
            </div>
            <div class="field type" [class.disabled]="disabledFields['identifierType'] || disabledFields['identifier']" *ngIf="!hiddenFields['identifier'] && !hiddenFields['identifierType']">
              <label for="entity-type">Type</label>
              <div class="flex-type-row">
                <mat-icon *ngIf="showIdentifierTypesPicker" class="identifier-type-icon left hide-on-medium hide-on-wide" matTooltipPosition="above" matTooltip="Choose Identifiers in List" aria-hidden="false" aria-label="Choose Identifiers in List" (click)="chooseIdentifiers($event)">filter_list</mat-icon>
                <select formControlName="IDENTIFIER_TYPE"
                        class="identifier-dropdown"
                        [class.filterShowing]="showIdentifierTypesPicker"
                        id="entity-type"
                        [attr.disabled]="getAnyDisabled(['identifierType','identifier'])"
                        name="type">
                  <option [ngValue]="null" disabled>Choose ID type</option>
                  <option *ngFor="let type of orderedAttributes()"
                          [value]="type.attributeCode"
                          [selected]="type.attributeCode === 'PASSPORT_NUMBER'">{{ attributeCodeAsHumanReadable(type.attributeCode) | uppercase }}
                  </option>
                </select>
                <mat-icon *ngIf="showIdentifierTypesPicker" class="identifier-type-icon right  hide-on-narrow" matTooltipPosition="left" matTooltip="Choose Identifiers in List" aria-hidden="false" aria-label="Choose Identifiers in List" (click)="chooseIdentifiers($event)">filter_list</mat-icon>
              </div>
            </div>
            <div class="action-button__wrapper hide-on-narrow" [class.disabled]="disabledFields['searchButton']" *ngIf="!hiddenFields['searchButton']">
              <button mat-button class="button__search-go"
              [attr.disabled]="getDisabled('searchButton')"
              (click)="submitSearch()">{{searchButtonLabel}}</button>
            </div>
          </div>
          <div class="sz-row">
            <div class="field address" [class.disabled]="disabledFields['address']" *ngIf="!hiddenFields['address']">
              <label for="entity-address">Address</label>
              <input formControlName="ADDR_FULL"
                      id="entity-address"
                      type="text"
                      list="search-history-entity-address"
                      [attr.disabled]="getDisabled('address')"
                      (keyup.enter)="onKeyEnter()"
                      placeholder="Search for Address">
              <datalist *ngIf="searchHistoryAddress.length > 0 && !searchHistoryDisabled" id="search-history-entity-address">
                <option *ngFor="let item of searchHistoryAddress" [value]="item">{{item}}</option>
              </datalist>
            </div>
            <div class="field phone" [class.disabled]="disabledFields['phone']" *ngIf="!hiddenFields['phone']">
              <label for="entity-phone">Phone</label>
              <input formControlName="PHONE_NUMBER"
                      id="entity-phone"
                      type="text"
                      list="search-history-entity-phone"
                      [attr.disabled]="getDisabled('phone')"
                      placeholder="Phone #">
              <datalist *ngIf="searchHistoryPhone.length > 0 && !searchHistoryDisabled" id="search-history-entity-phone">
                <option *ngFor="let item of searchHistoryPhone" [value]="item">{{item}}</option>
              </datalist>
            </div>
            <div class="field email" [class.disabled]="disabledFields['email']" *ngIf="!hiddenFields['email']">
              <label for="entity-email">Email</label>
              <input formControlName="EMAIL_ADDRESS"
                      id="entity-email"
                      type="text"
                      list="search-history-entity-email"
                      [attr.disabled]="getDisabled('email')"
                      (keyup.enter)="onKeyEnter()"
                      placeholder="Email Address">
              <datalist *ngIf="searchHistoryEmail.length > 0 && !searchHistoryDisabled" id="search-history-entity-email">
                <option *ngFor="let item of searchHistoryEmail" [value]="item">{{item}}</option>
              </datalist>
            </div>
            <div class="field spacer">

            </div>
            <div class="action-button__wrapper hide-on-narrow" [class.disabled]="disabledFields['resetButton']" *ngIf="!hiddenFields['resetButton']">
              <button mat-button class="button__search-clear"
              [attr.disabled]="getDisabled('resetButton')"
              (click)="clearSearch()">{{cancelButtonLabel}}</button>
            </div>
          </div>
          <div class="sz-row bottom">
            <div class="action-button__wrapper hide-on-medium hide-on-wide" [class.disabled]="disabledFields['resetButton']" *ngIf="!hiddenFields['resetButton']">
              <button mat-button class="button__search-clear"
              [attr.disabled]="getDisabled('resetButton')"
              (click)="clearSearch()">{{cancelButtonLabelShort}}</button>
            </div>
            <div class="action-button__wrapper hide-on-medium hide-on-wide" [class.disabled]="disabledFields['searchButton']" *ngIf="!hiddenFields['searchButton']">
              <button mat-button class="button__search-go"
              [attr.disabled]="getDisabled('searchButton')"
              (click)="submitSearch()">{{searchButtonLabelShort}}</button>
            </div>
          </div>
        </form>
      </section>

    </div>

./sz-search.component.scss

@use "../../scss/colors";

:host {
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;

  font-family: var(--sz-font-family);
  color: var(--sz-font-color);
  font-size: var(--sz-font-size);

  textarea {
    width: 1000px;
    height: 400px;
  }

  .label-title {
    text-transform: uppercase;
  }

  .layout-narrow {
    .hide-on-narrow {
      display: none;
    }

    /* actions buttons are in different spot in narrow layout*/
    .action-button__wrapper {
      width: auto;
      min-width: unset;
      margin: 0 1em 0 0;
    }
    .sz-row {
      flex-wrap: wrap;

      &.bottom {
        justify-content: flex-end;
        flex-flow: row;
      }
    }
    /*.field.email {
      width: unset;
    }*/
    .field.identifier {
      width: 50%;
    }
    .field.type { 
      padding-right: 0px;
      margin-right: 0px;
      width: 45%; 
    }
    .field.email { 
      width: 38%;
      flex-grow: 2; 
      padding-right: 0; 
      margin-right: 10px; 
    }
  }
  .layout-medium {
    .hide-on-medium {
      display: none;
    }
    .field.email {
      width: 40%;
    }
  }
  .layout-wide {
    .hide-on-wide {
      display: none;
    }
    .field.email {
      width: 32%;
    }
  }

  .main-card__label {
    min-height: 150px;
    width: 200px;
    min-width: 200px;
    text-transform: uppercase;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: colors.$white;
    &.search {
      background-color: colors.$green;
    }
    &.insights {
      background-color: colors.$orange;
    }
    &.suggestions {
      background-color: colors.$brown;
    }
    &.data {
      background-color: colors.$dark2;
    }
    &.health {
      background-color: colors.$dark-blue;
    }
  }

  .action-button__wrapper {
    display: flex;
    justify-content: center;
    text-align: center;
    width: 203px;
    //max-width: 145px;
    min-width: 145px;
    margin-right: 10px;

    &.disabled {
      button.button__search-go {
        border-color: var(--sz-search-button-disabled-border-color);
        background-color: var(--sz-search-button-disabled-background-color);
        color: var(--sz-search-button-disabled-color);
      }
      button.button__search-clear {
        border-color: var(--sz-clear-button-disabled-border-color);
        background-color: var(--sz-clear-button-disabled-background-color);
        color: var(--sz-search-clear-button-disabled-color);
      }
    }

    button {
      border: var(--sz-search-button-border);
      border-radius: var(--sz-search-button-border-radius);
      padding: var(--sz-search-button-padding);
      margin: var(--sz-search-button-margin);
      height: 40px;

      &.button__search-go {
        background-color: var(--sz-search-button-submit-background-color);
        color: var(--sz-search-button-submit-color);
        border: var(--sz-search-button-submit-border);
        white-space: nowrap;
        padding: var(--sz-search-button-submit-padding);
        font-family: var(--sz-search-button-submit-font-family);
        font-size: var(--sz-search-button-submit-font-size);
        font-weight: var(--sz-search-button-submit-font-weight);
      }
      &.button__search-clear {
        background-color: var(--sz-search-button-clear-background-color);
        color: var(--sz-search-button-clear-color);
        white-space: nowrap;
        padding: var(--sz-search-button-clear-padding);
        font-family: var(--sz-search-button-clear-font-family);
        font-size: var(--sz-search-button-clear-font-size);
        font-weight: var(--sz-search-button-clear-font-weight);
      }
    }
  }
  .content {
    align-items: center;
    display: flex;
    padding: 0px;
    width: 100%;
  }

  select {
    padding: var(--sz-search-input-padding);
    margin: var(--sz-search-input-margin);
    border: var(--sz-search-input-border);
    border-radius: var(--sz-search-input-border-radius);
    background-color: var(--sz-search-input-background-color);
  }

  input {
    //margin: 0 20px;
    width: calc( 100% - 10px);
    font-size: var(--sz-search-input-font-size);
    color: var(--sz-search-input-color);
    background-color: var(--sz-search-input-background-color);
    line-height: 1.5;
    height: 30px;
    padding: var(--sz-search-input-padding);
    margin: var(--sz-search-input-margin);
    border: var(--sz-search-input-border);
    border-radius: var(--sz-search-input-border-radius);
    box-sizing: unset;

    &:hover, &:focus {
      /* box-shadow: inset 0 -2px #ccc; */
      border: var(--sz-search-input-hover-border);
      border-color: var(colors.$input-active-border-color);
      outline: none;
    }
    &::placeholder {
      color: var(colors.$input-placeholder-color);
      margin-left: 2em;
      transition: opacity 100ms linear;
    }
    &:focus::placeholder {
      opacity: .4;
    }
    &:disabled {
      pointer-events: var(--sz-disabled-input-pointer-events);
      cursor: var(--sz-disabled-input-cursor);
    }
  }

  i.label_icon {
    font-size: 5em;
    position: absolute;
    opacity: 0.1;
    z-index: 2;
  }
  .entity.search {
    width: 100%;
  }
  .sz-row {
    display: flex;
    padding: 10px 0 0 0;
    align-items: flex-end;
    justify-content: flex-start;

    &.bottom {
      padding-bottom: 20px;
    }
  }
  .flex-type-row {
    display: flex;
    flex-direction: row;
    flex-flow: nowrap;
  }
  .identifier-type-icon {
    cursor: pointer;
    align-self: end;
    color: var(--sz-search-button-filter-color);
    background-color: var(--sz-search-button-filter-background-color);
    border-color: var(--sz-search-button-filter-border-color);
    border-style: var(--sz-search-button-filter-border-style);
    border-radius: var(--sz-search-button-filter-border-radius);
    border-width: var(--sz-search-button-filter-border-width);
    font-size: var(--sz-search-button-filter-font-size);
    width: var(--sz-search-button-filter-width);
    height: var(--sz-search-button-filter-height);
    padding: var(--sz-search-button-filter-padding);
    margin-top: var(--sz-search-button-filter-margin-top);
  }
  .field {
    display: inline-block;
    flex-direction: column;
    padding-right: 20px;

    &.hidden {
      display: none;
    }

    &.disabled {
      color: var(--sz-disabled-label-color);
      label {
        color: var(--sz-disabled-label-color);
      }
      input, select {
        border-color: var(--sz-disabled-input-border-color);
        color: var(--sz-disabled-input-color);
        background-color: var(--sz-disabled-input-background-color);
      }
      input::placeholder, select::placeholder {
        color: var(--sz-disabled-input-color);
      }
    }

    label {
      white-space: nowrap;
      display: var(--sz-search-label-display);
      color: var(--sz-search-label-color);
      padding: var(--sz-search-label-padding);
      margin: var(--sz-search-label-margin);
      font-size: var(--sz-search-label-font-size);
    }
    &.name, &.address {
      width: 35%;
      flex-grow: 3;
      min-width: 35%;
    }
    &.dob, &.phone {
      width: 15%;
      max-width: 15%;
    }
    &.identifier {
      width: 20%;
    }
    &.type {
      width: 12%;
      min-width: 160px;
      /*border: 1px solid orange;*/
    }
    &.email {
      width: 31%
    }

    .identifier-dropdown {
      height: 40px;
      width: 100%; //117px;
      &.filter-showing {
        width: calc(100% - 20px);
      }
    }
    ::-webkit-input-placeholder {
      font-size: 13px;
    }
  }
}

results matching ""

    No results matching ""