@skyux/lookup 7.0.0-beta.0 → 7.0.0-beta.2

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.
@@ -25,7 +25,8 @@
25
25
  "SkyAutocompleteSearchFunction": "type-alias-skyautocompletesearchfunction",
26
26
  "SkyAutocompleteSearchFunctionFilter": "type-alias-skyautocompletesearchfunctionfilter",
27
27
  "SkyAutocompleteSearchFunctionResponse": "type-alias-skyautocompletesearchfunctionresponse",
28
- "SkyLookupSelectModeType": "type-alias-skylookupselectmodetype"
28
+ "SkyLookupSelectModeType": "type-alias-skylookupselectmodetype",
29
+ "SkyLookupHarness": "class-skylookupharness"
29
30
  },
30
31
  "typedoc": {
31
32
  "id": 0,
@@ -7105,6 +7106,12 @@
7105
7106
  "type": "array",
7106
7107
  "elementType": {
7107
7108
  "type": "reference",
7109
+ "typeArguments": [
7110
+ {
7111
+ "type": "intrinsic",
7112
+ "name": "any"
7113
+ }
7114
+ ],
7108
7115
  "name": "SkyToken"
7109
7116
  }
7110
7117
  }
@@ -7128,6 +7135,12 @@
7128
7135
  "type": "array",
7129
7136
  "elementType": {
7130
7137
  "type": "reference",
7138
+ "typeArguments": [
7139
+ {
7140
+ "type": "intrinsic",
7141
+ "name": "any"
7142
+ }
7143
+ ],
7131
7144
  "name": "SkyToken"
7132
7145
  }
7133
7146
  }
@@ -7722,6 +7735,12 @@
7722
7735
  "type": "array",
7723
7736
  "elementType": {
7724
7737
  "type": "reference",
7738
+ "typeArguments": [
7739
+ {
7740
+ "type": "intrinsic",
7741
+ "name": "any"
7742
+ }
7743
+ ],
7725
7744
  "name": "SkyToken"
7726
7745
  }
7727
7746
  }
@@ -9413,224 +9432,1332 @@
9413
9432
  }
9414
9433
  ]
9415
9434
  }
9416
- }
9417
- ],
9418
- "groups": [
9435
+ },
9419
9436
  {
9420
- "title": "Modules",
9421
- "kind": 2,
9437
+ "id": 872,
9438
+ "name": "SkyLookupHarness",
9439
+ "kind": 128,
9440
+ "kindString": "Class",
9441
+ "flags": {},
9442
+ "comment": {
9443
+ "shortText": "Harness for interacting with a lookup component in tests."
9444
+ },
9422
9445
  "children": [
9423
- 1,
9424
- 2
9425
- ]
9426
- }
9427
- ]
9428
- },
9429
- "codeExamples": [
9430
- {
9431
- "fileName": "autocomplete-demo.component.html",
9432
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/advanced/autocomplete-demo.component.html",
9433
- "rawContents": "<form novalidate [formGroup]=\"myForm\">\n <div class=\"sky-margin-stacked-lg\">\n The following field:<br />\n <ul>\n <li>utilizes a custom search result template,</li>\n <li>searches against the name and description properties,</li>\n <li>limits the search results to two,</li>\n <li>runs the search if the query is at least three characters long,</li>\n <li>and fires an event when a selection is made.</li>\n </ul>\n </div>\n\n <div class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"planetInput.id\">\n Farthest planet from the sun\n </label>\n <sky-autocomplete\n [data]=\"planets\"\n [propertiesToSearch]=\"['name', 'description']\"\n [searchResultsLimit]=\"2\"\n [searchResultTemplate]=\"planetSearchResultTemplate\"\n [searchTextMinimumCharacters]=\"3\"\n (selectionChange)=\"onPlanetSelection($event)\"\n >\n <input\n formControlName=\"farthestPlanet\"\n skyAutocomplete\n skyId\n type=\"text\"\n #planetInput\n />\n </sky-autocomplete>\n </div>\n <p class=\"sky-font-emphasized\">Form model:</p>\n <pre>{{ myForm.value | json }}</pre>\n</form>\n\n<ng-template let-item=\"item\" #planetSearchResultTemplate>\n <strong>\n {{ item.name }}\n </strong>\n <br />\n {{ item.description }}\n</ng-template>\n"
9434
- },
9435
- {
9436
- "fileName": "autocomplete-demo.component.ts",
9437
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/advanced/autocomplete-demo.component.ts",
9438
- "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';\nimport {\n SkyAutocompleteSearchFunctionFilter,\n SkyAutocompleteSelectionChange,\n} from '@skyux/lookup';\n\n@Component({\n selector: 'app-autocomplete-demo',\n templateUrl: './autocomplete-demo.component.html',\n})\nexport class AutocompleteDemoComponent implements OnInit {\n public farthestPlanet: any;\n\n public myForm: UntypedFormGroup;\n\n public planets: any[] = [\n {\n name: 'Mercury',\n description: 'Mercury is a planet in our solar system.',\n },\n { name: 'Venus', description: 'Venus is a planet in our solar system.' },\n { name: 'Earth', description: 'Earth is a planet in our solar system.' },\n { name: 'Mars', description: 'Mars is a planet in our solar system.' },\n {\n name: 'Jupiter',\n description: 'Jupiter is a planet in our solar system.',\n },\n { name: 'Saturn', description: 'Saturn is a planet in our solar system.' },\n { name: 'Uranus', description: 'Uranus is a planet in our solar system.' },\n {\n name: 'Neptune',\n description: 'Neptune is a planet in our solar system.',\n },\n ];\n\n public searchFilters: SkyAutocompleteSearchFunctionFilter[] = [\n (searchText: string, item: any): boolean => {\n return item.name !== 'Red';\n },\n ];\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n }\n\n public onPlanetSelection(args: SkyAutocompleteSelectionChange): void {\n alert(`You selected ${args.selectedItem.name}`);\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n farthestPlanet: {},\n });\n }\n}\n"
9439
- },
9440
- {
9441
- "fileName": "autocomplete-demo.module.ts",
9442
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/advanced/autocomplete-demo.module.ts",
9443
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyAutocompleteModule } from '@skyux/lookup';\n\nimport { AutocompleteDemoComponent } from './autocomplete-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyAutocompleteModule,\n SkyIconModule,\n ],\n declarations: [AutocompleteDemoComponent],\n exports: [AutocompleteDemoComponent],\n})\nexport class AutocompleteDemoModule {}\n"
9444
- },
9445
- {
9446
- "fileName": "autocomplete-demo.component.html",
9447
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/basic/autocomplete-demo.component.html",
9448
- "rawContents": "<form novalidate [formGroup]=\"myForm\">\n <div class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"favoriteColorInput.id\">\n Favorite color\n </label>\n <sky-autocomplete [data]=\"colors\">\n <input\n formControlName=\"favoriteColor\"\n type=\"text\"\n skyAutocomplete\n skyId\n #favoriteColorInput\n />\n </sky-autocomplete>\n </div>\n <p class=\"sky-font-emphasized\">Form model:</p>\n <pre>{{ myForm.value | json }}</pre>\n</form>\n"
9449
- },
9450
- {
9451
- "fileName": "autocomplete-demo.component.ts",
9452
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/basic/autocomplete-demo.component.ts",
9453
- "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';\n\n@Component({\n selector: 'app-autocomplete-demo',\n templateUrl: './autocomplete-demo.component.html',\n})\nexport class AutocompleteDemoComponent implements OnInit {\n public colors: any[] = [\n { name: 'Red' },\n { name: 'Blue' },\n { name: 'Green' },\n { name: 'Orange' },\n { name: 'Pink' },\n { name: 'Purple' },\n { name: 'Yellow' },\n { name: 'Brown' },\n { name: 'Turquoise' },\n { name: 'White' },\n { name: 'Black' },\n ];\n\n public myForm: UntypedFormGroup;\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n favoriteColor: undefined,\n });\n }\n}\n"
9454
- },
9455
- {
9456
- "fileName": "autocomplete-demo.module.ts",
9457
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/basic/autocomplete-demo.module.ts",
9458
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyAutocompleteModule } from '@skyux/lookup';\n\nimport { AutocompleteDemoComponent } from './autocomplete-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyAutocompleteModule,\n SkyIdModule,\n ],\n declarations: [AutocompleteDemoComponent],\n exports: [AutocompleteDemoComponent],\n})\nexport class AutocompleteDemoModule {}\n"
9459
- },
9460
- {
9461
- "fileName": "autocomplete-demo.component.html",
9462
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/custom-search/autocomplete-demo.component.html",
9463
- "rawContents": "<form novalidate [formGroup]=\"myForm\">\n <p>\n The following field has a preselected value and utilizes a custom search\n function, as well as a custom template for the search results.\n </p>\n <div class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"largestOceanInput.id\">\n Largest ocean\n </label>\n <sky-autocomplete\n descriptorProperty=\"title\"\n [data]=\"oceans\"\n [search]=\"getOceanSearchFunction()\"\n [searchResultTemplate]=\"oceanSearchResultTemplate\"\n >\n <input\n formControlName=\"largestOcean\"\n type=\"text\"\n skyAutocomplete\n skyId\n #largestOceanInput=\"skyId\"\n />\n </sky-autocomplete>\n </div>\n <p class=\"sky-font-emphasized\">Form model:</p>\n <pre>{{ myForm.value | json }}</pre>\n</form>\n\n<ng-template let-item=\"item\" #oceanSearchResultTemplate>\n <sky-icon icon=\"long-arrow-right\"></sky-icon>\n {{ item.title }} &bull; ID {{ item.id }}\n</ng-template>\n"
9464
- },
9465
- {
9466
- "fileName": "autocomplete-demo.component.ts",
9467
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/custom-search/autocomplete-demo.component.ts",
9468
- "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';\nimport {\n SkyAutocompleteSearchFunction,\n SkyAutocompleteSearchFunctionResponse,\n} from '@skyux/lookup';\n\n@Component({\n selector: 'app-autocomplete-demo',\n templateUrl: './autocomplete-demo.component.html',\n})\nexport class AutocompleteDemoComponent implements OnInit {\n public myForm: UntypedFormGroup;\n\n public largestOcean: any;\n\n public oceans: any[] = [\n { title: 'Arctic', id: 1 },\n { title: 'Atlantic', id: 2 },\n { title: 'Indian', id: 3 },\n { title: 'Pacific', id: 4 },\n ];\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n }\n\n public getOceanSearchFunction(): SkyAutocompleteSearchFunction {\n const searchFunction = (\n searchText: string,\n oceans: any[]\n ): SkyAutocompleteSearchFunctionResponse => {\n return new Promise((resolve) => {\n const searchTextLower = searchText.toLowerCase();\n\n const results = oceans.filter((ocean: any) => {\n const val = ocean.title;\n const isMatch =\n val && val.toString().toLowerCase().indexOf(searchTextLower) > -1;\n return isMatch;\n });\n\n // Simulate an async request.\n setTimeout(() => {\n resolve(results);\n }, 500);\n });\n };\n\n return searchFunction;\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n largestOcean: { title: 'Arctic', id: 1 },\n });\n }\n}\n"
9469
- },
9470
- {
9471
- "fileName": "autocomplete-demo.module.ts",
9472
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/custom-search/autocomplete-demo.module.ts",
9473
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyAutocompleteModule } from '@skyux/lookup';\n\nimport { AutocompleteDemoComponent } from './autocomplete-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyAutocompleteModule,\n SkyIconModule,\n SkyIdModule,\n ],\n declarations: [AutocompleteDemoComponent],\n exports: [AutocompleteDemoComponent],\n})\nexport class AutocompleteDemoModule {}\n"
9474
- },
9475
- {
9476
- "fileName": "autocomplete-demo.component.html",
9477
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/search-filters/autocomplete-demo.component.html",
9478
- "rawContents": "<form novalidate [formGroup]=\"myForm\">\n <p>\n The following field provides a custom function that filters the data before\n every search attempt.\n </p>\n <div class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"favoriteColorInput.id\">\n Color (\"Red\" is not available)\n </label>\n <sky-autocomplete [data]=\"colors\" [searchFilters]=\"searchFilters\">\n <input\n formControlName=\"favoriteColor\"\n skyAutocomplete\n skyId\n type=\"text\"\n #favoriteColorInput=\"skyId\"\n />\n </sky-autocomplete>\n </div>\n <p class=\"sky-font-emphasized\">Form model:</p>\n <pre>{{ myForm.value | json }}</pre>\n</form>\n"
9479
- },
9480
- {
9481
- "fileName": "autocomplete-demo.component.ts",
9482
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/search-filters/autocomplete-demo.component.ts",
9483
- "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';\nimport { SkyAutocompleteSearchFunctionFilter } from '@skyux/lookup';\n\n@Component({\n selector: 'app-autocomplete-demo',\n templateUrl: './autocomplete-demo.component.html',\n})\nexport class AutocompleteDemoComponent implements OnInit {\n public colors: any[] = [\n { name: 'Red' },\n { name: 'Blue' },\n { name: 'Green' },\n { name: 'Orange' },\n { name: 'Pink' },\n { name: 'Purple' },\n { name: 'Yellow' },\n { name: 'Brown' },\n { name: 'Turquoise' },\n { name: 'White' },\n { name: 'Black' },\n ];\n\n public myForm: UntypedFormGroup;\n\n public searchFilters: SkyAutocompleteSearchFunctionFilter[] = [\n (searchText: string, item: any): boolean => {\n return item.name !== 'Red';\n },\n ];\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n favoriteColor: undefined,\n });\n }\n}\n"
9484
- },
9485
- {
9486
- "fileName": "autocomplete-demo.module.ts",
9487
- "filePath": "/projects/lookup/documentation/code-examples/autocomplete/search-filters/autocomplete-demo.module.ts",
9488
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyAutocompleteModule } from '@skyux/lookup';\n\nimport { AutocompleteDemoComponent } from './autocomplete-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyAutocompleteModule,\n SkyIdModule,\n ],\n declarations: [AutocompleteDemoComponent],\n exports: [AutocompleteDemoComponent],\n})\nexport class AutocompleteDemoModule {}\n"
9489
- },
9490
- {
9491
- "fileName": "country-field-demo.component.html",
9492
- "filePath": "/projects/lookup/documentation/code-examples/country-field/basic/country-field-demo.component.html",
9493
- "rawContents": "<form [formGroup]=\"countryForm\">\n <sky-input-box>\n <sky-country-field formControlName=\"countryControl\"> </sky-country-field>\n </sky-input-box>\n</form>\n"
9494
- },
9495
- {
9496
- "fileName": "country-field-demo.component.ts",
9497
- "filePath": "/projects/lookup/documentation/code-examples/country-field/basic/country-field-demo.component.ts",
9498
- "rawContents": "import { Component, OnInit } from '@angular/core';\nimport {\n UntypedFormControl,\n UntypedFormGroup,\n Validators,\n} from '@angular/forms';\nimport { SkyCountryFieldCountry } from '@skyux/lookup';\n\n@Component({\n selector: 'app-country-field-demo',\n templateUrl: './country-field-demo.component.html',\n})\nexport class CountryFieldDemoComponent implements OnInit {\n public countryControl: UntypedFormControl;\n\n public countryData: SkyCountryFieldCountry;\n\n public countryForm: UntypedFormGroup;\n\n public ngOnInit(): void {\n this.countryControl = new UntypedFormControl();\n this.countryControl.setValue({\n name: 'Australia',\n iso2: 'au',\n });\n this.countryForm = new UntypedFormGroup({\n countryControl: this.countryControl,\n });\n\n this.countryControl.setValidators([Validators.required]);\n }\n}\n"
9499
- },
9500
- {
9501
- "fileName": "country-field-demo.module.ts",
9502
- "filePath": "/projects/lookup/documentation/code-examples/country-field/basic/country-field-demo.module.ts",
9503
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyCountryFieldModule } from '@skyux/lookup';\n\nimport { CountryFieldDemoComponent } from './country-field-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyCountryFieldModule,\n SkyInputBoxModule,\n ],\n declarations: [CountryFieldDemoComponent],\n exports: [CountryFieldDemoComponent],\n})\nexport class CountryFieldDemoModule {}\n"
9504
- },
9505
- {
9506
- "fileName": "lookup-async-demo.component.html",
9507
- "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.component.html",
9508
- "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"myForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box>\n <label class=\"sky-control-label\" skyId #nameLabel=\"skyId\">\n Favorite name\n </label>\n <sky-lookup\n formControlName=\"name\"\n idProperty=\"name\"\n [ariaLabelledBy]=\"nameLabel.id\"\n [enableShowMore]=\"true\"\n (searchAsync)=\"searchAsync($event)\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ myForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n"
9509
- },
9510
- {
9511
- "fileName": "lookup-async-demo.component.scss",
9512
- "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.component.scss",
9513
- "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
9514
- },
9515
- {
9516
- "fileName": "lookup-async-demo.component.ts",
9517
- "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.component.ts",
9518
- "rawContents": "import { Component, OnInit } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport {\n SkyAutocompleteSearchAsyncArgs,\n SkyAutocompleteSearchAsyncResult,\n} from '@skyux/lookup';\n\nimport { Subject } from 'rxjs';\n\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-async-lookup-demo',\n templateUrl: './lookup-async-demo.component.html',\n styleUrls: ['./lookup-async-demo.component.scss'],\n})\nexport class LookupAsyncDemoComponent implements OnInit {\n public myForm: UntypedFormGroup;\n\n public people: LookupDemoPerson[] = [\n { name: 'Abed' },\n { name: 'Alex' },\n { name: 'Ben' },\n { name: 'Britta' },\n { name: 'Buzz' },\n { name: 'Craig' },\n { name: 'Elroy' },\n { name: 'Garrett' },\n { name: 'Ian' },\n { name: 'Jeff' },\n { name: 'Leonard' },\n { name: 'Neil' },\n { name: 'Pierce' },\n { name: 'Preston' },\n { name: 'Rachel' },\n { name: 'Shirley' },\n { name: 'Todd' },\n { name: 'Troy' },\n { name: 'Vaughn' },\n { name: 'Vicki' },\n ];\n\n public name: LookupDemoPerson[] = [this.people[15]];\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.myForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.myForm.value));\n }\n\n public searchAsync($event: SkyAutocompleteSearchAsyncArgs) {\n const result = new Subject<SkyAutocompleteSearchAsyncResult>();\n $event.result = result;\n setTimeout(() => {\n const searchText = $event.searchText.toLowerCase();\n const items = this.people.filter((person) => {\n return person.name.toLowerCase().includes(searchText);\n });\n result.next({\n hasMore: false,\n items,\n totalCount: items.length,\n });\n }, 800);\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n name: new UntypedFormControl(this.name),\n });\n }\n}\n"
9519
- },
9520
- {
9521
- "fileName": "lookup-async-demo.module.ts",
9522
- "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.module.ts",
9523
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyLookupModule } from '@skyux/lookup';\n\nimport { LookupAsyncDemoComponent } from './lookup-async-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyLookupModule,\n ],\n declarations: [LookupAsyncDemoComponent],\n exports: [LookupAsyncDemoComponent],\n})\nexport class LookupAsyncDemoModule {}\n"
9524
- },
9525
- {
9526
- "fileName": "lookup-demo-person.ts",
9527
- "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-demo-person.ts",
9528
- "rawContents": "export interface LookupDemoPerson {\n name: string;\n}\n"
9529
- },
9530
- {
9531
- "fileName": "lookup-custom-picker-demo-modal.component.html",
9532
- "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo-modal.component.html",
9533
- "rawContents": "<sky-modal>\n <sky-modal-header> Custom picker </sky-modal-header>\n <sky-modal-content>\n This is a custom picker!\n <form [formGroup]=\"myForm\">\n <sky-checkbox formControlName=\"selectLast\">\n <sky-checkbox-label> Select last item </sky-checkbox-label>\n </sky-checkbox>\n </form>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n class=\"sky-btn sky-btn-primary\"\n type=\"button\"\n (click)=\"modalInstance.save(myForm.get('selectLast').value)\"\n >\n Save\n </button>\n </sky-modal-footer>\n</sky-modal>\n"
9534
- },
9535
- {
9536
- "fileName": "lookup-custom-picker-demo-modal.component.ts",
9537
- "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo-modal.component.ts",
9538
- "rawContents": "import { Component, OnInit } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport { SkyLookupShowMoreCustomPickerContext } from '@skyux/lookup';\nimport { SkyModalInstance } from '@skyux/modals';\n\n@Component({\n selector: 'app-lookup-demo-modal',\n templateUrl: './lookup-custom-picker-demo-modal.component.html',\n})\nexport class LookupCustomPickerDemoModalComponent implements OnInit {\n public myForm: UntypedFormGroup;\n\n constructor(\n private formBuilder: UntypedFormBuilder,\n public context: SkyLookupShowMoreCustomPickerContext,\n public modalInstance: SkyModalInstance\n ) {}\n\n public ngOnInit(): void {\n this.myForm = this.formBuilder.group({\n selectLast: new UntypedFormControl(false),\n });\n }\n}\n"
9539
- },
9540
- {
9541
- "fileName": "lookup-custom-picker-demo.component.html",
9542
- "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo.component.html",
9543
- "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"myForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box>\n <label class=\"sky-control-label\" skyId #namesLabel=\"skyId\">\n Favorite names\n </label>\n <sky-lookup\n formControlName=\"names\"\n (addClick)=\"onAddButtonClicked()\"\n [ariaLabelledBy]=\"namesLabel.id\"\n [data]=\"people\"\n [enableShowMore]=\"true\"\n [searchFilters]=\"getSearchFilters()\"\n [showAddButton]=\"true\"\n [showMoreConfig]=\"showMoreConfig\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ myForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n"
9544
- },
9545
- {
9546
- "fileName": "lookup-custom-picker-demo.component.scss",
9547
- "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo.component.scss",
9548
- "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
9549
- },
9550
- {
9551
- "fileName": "lookup-custom-picker-demo.component.ts",
9552
- "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo.component.ts",
9553
- "rawContents": "import { ChangeDetectorRef, Component, OnInit } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport {\n SkyAutocompleteSearchFunctionFilter,\n SkyLookupShowMoreConfig,\n SkyLookupShowMoreCustomPickerContext,\n} from '@skyux/lookup';\nimport { SkyModalCloseArgs, SkyModalService } from '@skyux/modals';\n\nimport { LookupCustomPickerDemoModalComponent } from './lookup-custom-picker-demo-modal.component';\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-lookup-demo',\n templateUrl: './lookup-custom-picker-demo.component.html',\n styleUrls: ['./lookup-custom-picker-demo.component.scss'],\n})\nexport class LookupCustomPickerDemoComponent implements OnInit {\n public showMoreConfig: SkyLookupShowMoreConfig;\n\n public myForm: UntypedFormGroup;\n\n public people: LookupDemoPerson[] = [\n { name: 'Abed' },\n { name: 'Alex' },\n { name: 'Ben' },\n { name: 'Britta' },\n { name: 'Buzz' },\n { name: 'Craig' },\n { name: 'Elroy' },\n { name: 'Garrett' },\n { name: 'Ian' },\n { name: 'Jeff' },\n { name: 'Leonard' },\n { name: 'Neil' },\n { name: 'Pierce' },\n { name: 'Preston' },\n { name: 'Rachel' },\n { name: 'Shirley' },\n { name: 'Todd' },\n { name: 'Troy' },\n { name: 'Vaughn' },\n { name: 'Vicki' },\n ];\n\n public names: LookupDemoPerson[] = [this.people[15]];\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private formBuilder: UntypedFormBuilder,\n private modalService: SkyModalService\n ) {\n this.showMoreConfig = {\n customPicker: {\n open: (context: SkyLookupShowMoreCustomPickerContext) => {\n const instance = this.modalService.open(\n LookupCustomPickerDemoModalComponent,\n {\n providers: [\n {\n provide: SkyLookupShowMoreCustomPickerContext,\n useValue: context,\n },\n ],\n size: 'large',\n }\n );\n\n instance.closed.subscribe((closeArgs: SkyModalCloseArgs) => {\n if (closeArgs.reason === 'save') {\n if (closeArgs.data) {\n this.myForm.setValue({\n names: [this.people[this.people.length - 1]],\n });\n this.changeDetector.markForCheck();\n }\n }\n });\n },\n },\n };\n }\n\n public ngOnInit(): void {\n this.createForm();\n\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.myForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n }\n\n // Only show people in the search results that have not been chosen already.\n public getSearchFilters(): SkyAutocompleteSearchFunctionFilter[] {\n const names: LookupDemoPerson[] = this.myForm.controls.names.value;\n return [\n (searchText: string, item: LookupDemoPerson): boolean => {\n const found = names.find((option) => option.name === item.name);\n return !found;\n },\n ];\n }\n\n public onAddButtonClicked(): void {\n alert('Add button clicked!');\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.myForm.value));\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n names: new UntypedFormControl(this.names),\n });\n }\n}\n"
9554
- },
9555
- {
9556
- "fileName": "lookup-custom-picker-demo.module.ts",
9557
- "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo.module.ts",
9558
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyCheckboxModule, SkyInputBoxModule } from '@skyux/forms';\nimport { SkyLookupModule } from '@skyux/lookup';\nimport { SkyModalModule } from '@skyux/modals';\n\nimport { LookupCustomPickerDemoModalComponent } from './lookup-custom-picker-demo-modal.component';\nimport { LookupCustomPickerDemoComponent } from './lookup-custom-picker-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyCheckboxModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyLookupModule,\n SkyModalModule,\n ],\n declarations: [\n LookupCustomPickerDemoComponent,\n LookupCustomPickerDemoModalComponent,\n ],\n exports: [LookupCustomPickerDemoComponent],\n})\nexport class LookupCustomPickerDemoModule {}\n"
9559
- },
9560
- {
9561
- "fileName": "lookup-demo-person.ts",
9562
- "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-demo-person.ts",
9563
- "rawContents": "export interface LookupDemoPerson {\n name: string;\n}\n"
9564
- },
9565
- {
9566
- "fileName": "lookup-demo-person.ts",
9567
- "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-demo-person.ts",
9568
- "rawContents": "export interface LookupDemoPerson {\n name: string;\n}\n"
9569
- },
9570
- {
9571
- "fileName": "lookup-multiple-demo.component.html",
9572
- "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-multiple-demo.component.html",
9573
- "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"myForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box>\n <label class=\"sky-control-label\" skyId #namesLabel=\"skyId\">\n Favorite names\n </label>\n <sky-lookup\n formControlName=\"names\"\n (addClick)=\"onAddButtonClicked()\"\n [ariaLabelledBy]=\"namesLabel.id\"\n [data]=\"people\"\n [enableShowMore]=\"true\"\n [searchFilters]=\"getSearchFilters()\"\n [showAddButton]=\"true\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ myForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n"
9574
- },
9575
- {
9576
- "fileName": "lookup-multiple-demo.component.scss",
9577
- "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-multiple-demo.component.scss",
9578
- "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
9579
- },
9580
- {
9581
- "fileName": "lookup-multiple-demo.component.ts",
9582
- "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-multiple-demo.component.ts",
9583
- "rawContents": "import { Component, OnInit } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport {\n SkyAutocompleteSearchArgs,\n SkyAutocompleteSearchFunctionFilter,\n} from '@skyux/lookup';\n\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-lookup-demo',\n templateUrl: './lookup-multiple-demo.component.html',\n styleUrls: ['./lookup-multiple-demo.component.scss'],\n})\nexport class LookupMultipleSelectDemoComponent implements OnInit {\n public myForm: UntypedFormGroup;\n\n public people: LookupDemoPerson[] = [\n { name: 'Abed' },\n { name: 'Alex' },\n { name: 'Ben' },\n { name: 'Britta' },\n { name: 'Buzz' },\n { name: 'Craig' },\n { name: 'Elroy' },\n { name: 'Garrett' },\n { name: 'Ian' },\n { name: 'Jeff' },\n { name: 'Leonard' },\n { name: 'Neil' },\n { name: 'Pierce' },\n { name: 'Preston' },\n { name: 'Rachel' },\n { name: 'Shirley' },\n { name: 'Todd' },\n { name: 'Troy' },\n { name: 'Vaughn' },\n { name: 'Vicki' },\n ];\n\n public names: LookupDemoPerson[] = [this.people[15]];\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.myForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n }\n\n /**\n * When in the modal view, show all people in the search results, regardless if they have been chosen already.\n * When in the popover view (or in any other view), show people in the search results that have not been chosen already.\n */\n public getSearchFilters(): SkyAutocompleteSearchFunctionFilter[] {\n const names: LookupDemoPerson[] = this.myForm.controls.names.value;\n return [\n (\n searchText: string,\n item: any,\n args?: SkyAutocompleteSearchArgs\n ): boolean => {\n if (args?.context === 'modal') {\n return true;\n }\n\n const found = names.find((option) => option.name === item.name);\n return !found;\n },\n ];\n }\n\n public onAddButtonClicked(): void {\n alert('Add button clicked!');\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.myForm.value));\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n names: new UntypedFormControl(this.names),\n });\n }\n}\n"
9584
- },
9585
- {
9586
- "fileName": "lookup-multiple-demo.module.ts",
9587
- "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-multiple-demo.module.ts",
9588
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyLookupModule } from '@skyux/lookup';\n\nimport { LookupMultipleSelectDemoComponent } from './lookup-multiple-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyLookupModule,\n ],\n declarations: [LookupMultipleSelectDemoComponent],\n exports: [LookupMultipleSelectDemoComponent],\n})\nexport class LookupMultipleSelectDemoModule {}\n"
9589
- },
9590
- {
9591
- "fileName": "lookup-demo-person.ts",
9592
- "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-demo-person.ts",
9593
- "rawContents": "export interface LookupDemoPerson {\n name: string;\n formal?: string;\n}\n"
9594
- },
9595
- {
9596
- "fileName": "lookup-result-templates-demo.component.html",
9597
- "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-demo.component.html",
9598
- "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"myForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box>\n <label class=\"sky-control-label\" skyId #namesLabel=\"skyId\">\n Favorite names\n </label>\n <sky-lookup\n formControlName=\"names\"\n (addClick)=\"onAddButtonClicked()\"\n [ariaLabelledBy]=\"namesLabel.id\"\n [data]=\"people\"\n [enableShowMore]=\"true\"\n [searchFilters]=\"getSearchFilters()\"\n [searchResultTemplate]=\"dropdownItemTemplate\"\n [showAddButton]=\"true\"\n [showMoreConfig]=\"showMoreConfig\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ myForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n\n<ng-template let-item=\"item\" #dropdownItemTemplate>\n <strong>{{ item.name }}</strong\n ><br />\n {{ item.formal }}\n</ng-template>\n<ng-template let-item=\"item\" #modalItemTemplate>\n {{ item.name }}<br />\n <i>{{ item.formal }}</i>\n</ng-template>\n"
9599
- },
9600
- {
9601
- "fileName": "lookup-result-templates-demo.component.scss",
9602
- "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-demo.component.scss",
9603
- "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
9604
- },
9605
- {
9606
- "fileName": "lookup-result-templates-demo.component.ts",
9607
- "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-demo.component.ts",
9608
- "rawContents": "import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport {\n SkyAutocompleteSearchFunctionFilter,\n SkyLookupShowMoreConfig,\n} from '@skyux/lookup';\n\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-lookup-demo',\n templateUrl: './lookup-result-templates-demo.component.html',\n styleUrls: ['./lookup-result-templates-demo.component.scss'],\n})\nexport class LookupResultTemplatesDemoComponent implements OnInit {\n public myForm: UntypedFormGroup;\n\n public people: LookupDemoPerson[] = [\n {\n name: 'Abed',\n formal: 'Mr. Nadir',\n },\n {\n name: 'Alex',\n formal: 'Mr. Osbourne',\n },\n {\n name: 'Ben',\n formal: 'Mr. Chang',\n },\n {\n name: 'Britta',\n formal: 'Ms. Perry',\n },\n {\n name: 'Buzz',\n formal: 'Mr. Hickey',\n },\n {\n name: 'Craig',\n formal: 'Mr. Pelton',\n },\n {\n name: 'Elroy',\n formal: 'Mr. Patashnik',\n },\n {\n name: 'Garrett',\n formal: 'Mr. Lambert',\n },\n {\n name: 'Ian',\n formal: 'Mr. Duncan',\n },\n {\n name: 'Jeff',\n formal: 'Mr. Winger',\n },\n {\n name: 'Leonard',\n formal: 'Mr. Rodriguez',\n },\n {\n name: 'Neil',\n formal: 'Mr. Neil',\n },\n {\n name: 'Pierce',\n formal: 'Mr. Hawthorne',\n },\n {\n name: 'Preston',\n formal: 'Mr. Koogler',\n },\n {\n name: 'Rachel',\n formal: 'Ms. Rachel',\n },\n {\n name: 'Shirley',\n formal: 'Ms. Bennett',\n },\n {\n name: 'Todd',\n formal: 'Mr. Jacobson',\n },\n {\n name: 'Troy',\n formal: 'Mr. Barnes',\n },\n {\n name: 'Vaughn',\n formal: 'Mr. Miller',\n },\n {\n name: 'Vicki',\n formal: 'Ms. Jenkins',\n },\n ];\n\n public names: LookupDemoPerson[] = [this.people[15]];\n\n public showMoreConfig: SkyLookupShowMoreConfig = {\n nativePickerConfig: {},\n };\n\n @ViewChild('modalItemTemplate')\n public set modalItemTempalte(template: TemplateRef<unknown>) {\n this.showMoreConfig.nativePickerConfig.itemTemplate = template;\n }\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.myForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n }\n\n // Only show people in the search results that have not been chosen already.\n public getSearchFilters(): SkyAutocompleteSearchFunctionFilter[] {\n const names: any[] = this.myForm.controls.names.value;\n return [\n (searchText: string, item: any): boolean => {\n const found = names.find((option) => option.name === item.name);\n return !found;\n },\n ];\n }\n\n public onAddButtonClicked(): void {\n alert('Add button clicked!');\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.myForm.value));\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n names: new UntypedFormControl(this.names),\n });\n }\n}\n"
9609
- },
9610
- {
9611
- "fileName": "lookup-result-templates-demo.module.ts",
9612
- "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-demo.module.ts",
9613
- "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyLookupModule } from '@skyux/lookup';\n\nimport { LookupResultTemplatesDemoComponent } from './lookup-result-templates-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyLookupModule,\n ],\n declarations: [LookupResultTemplatesDemoComponent],\n exports: [LookupResultTemplatesDemoComponent],\n})\nexport class LookupResultTemplatesDemoModule {}\n"
9614
- },
9615
- {
9616
- "fileName": "lookup-demo-person.ts",
9617
- "filePath": "/projects/lookup/documentation/code-examples/lookup/single-select/lookup-demo-person.ts",
9618
- "rawContents": "export interface LookupDemoPerson {\n name: string;\n}\n"
9619
- },
9620
- {
9621
- "fileName": "lookup-single-demo.component.html",
9622
- "filePath": "/projects/lookup/documentation/code-examples/lookup/single-select/lookup-single-demo.component.html",
9623
- "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"myForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box>\n <label class=\"sky-control-label\" skyId #nameLabel=\"skyId\">\n Favorite name\n </label>\n <sky-lookup\n formControlName=\"name\"\n selectMode=\"single\"\n (addClick)=\"onAddButtonClicked()\"\n [ariaLabelledBy]=\"nameLabel.id\"\n [data]=\"people\"\n [enableShowMore]=\"true\"\n [searchFilters]=\"getSearchFilters()\"\n [showAddButton]=\"true\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ myForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n"
9624
- },
9625
- {
9626
- "fileName": "lookup-single-demo.component.scss",
9627
- "filePath": "/projects/lookup/documentation/code-examples/lookup/single-select/lookup-single-demo.component.scss",
9628
- "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
9446
+ {
9447
+ "id": 905,
9448
+ "name": "blur",
9449
+ "kind": 2048,
9450
+ "kindString": "Method",
9451
+ "flags": {
9452
+ "isPublic": true
9453
+ },
9454
+ "sources": [
9455
+ {
9456
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
9457
+ "line": 36,
9458
+ "character": 15
9459
+ }
9460
+ ],
9461
+ "signatures": [
9462
+ {
9463
+ "id": 906,
9464
+ "name": "blur",
9465
+ "kind": 4096,
9466
+ "kindString": "Call signature",
9467
+ "flags": {},
9468
+ "comment": {
9469
+ "shortText": "Blurs the autocomplete input."
9470
+ },
9471
+ "type": {
9472
+ "type": "reference",
9473
+ "typeArguments": [
9474
+ {
9475
+ "type": "intrinsic",
9476
+ "name": "void"
9477
+ }
9478
+ ],
9479
+ "qualifiedName": "Promise",
9480
+ "package": "typescript",
9481
+ "name": "Promise"
9482
+ },
9483
+ "inheritedFrom": {
9484
+ "type": "reference",
9485
+ "name": "SkyAutocompleteHarness.blur"
9486
+ }
9487
+ }
9488
+ ],
9489
+ "inheritedFrom": {
9490
+ "type": "reference",
9491
+ "name": "SkyAutocompleteHarness.blur"
9492
+ }
9493
+ },
9494
+ {
9495
+ "id": 907,
9496
+ "name": "clear",
9497
+ "kind": 2048,
9498
+ "kindString": "Method",
9499
+ "flags": {
9500
+ "isPublic": true
9501
+ },
9502
+ "sources": [
9503
+ {
9504
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
9505
+ "line": 43,
9506
+ "character": 15
9507
+ }
9508
+ ],
9509
+ "signatures": [
9510
+ {
9511
+ "id": 908,
9512
+ "name": "clear",
9513
+ "kind": 4096,
9514
+ "kindString": "Call signature",
9515
+ "flags": {},
9516
+ "comment": {
9517
+ "shortText": "Clears the input value."
9518
+ },
9519
+ "type": {
9520
+ "type": "reference",
9521
+ "typeArguments": [
9522
+ {
9523
+ "type": "intrinsic",
9524
+ "name": "void"
9525
+ }
9526
+ ],
9527
+ "qualifiedName": "Promise",
9528
+ "package": "typescript",
9529
+ "name": "Promise"
9530
+ },
9531
+ "inheritedFrom": {
9532
+ "type": "reference",
9533
+ "name": "SkyAutocompleteHarness.clear"
9534
+ }
9535
+ }
9536
+ ],
9537
+ "inheritedFrom": {
9538
+ "type": "reference",
9539
+ "name": "SkyAutocompleteHarness.clear"
9540
+ }
9541
+ },
9542
+ {
9543
+ "id": 889,
9544
+ "name": "clickAddButton",
9545
+ "kind": 2048,
9546
+ "kindString": "Method",
9547
+ "flags": {
9548
+ "isPublic": true
9549
+ },
9550
+ "sources": [
9551
+ {
9552
+ "fileName": "projects/lookup/src/testing/lookup/lookup-harness.ts",
9553
+ "line": 43,
9554
+ "character": 15
9555
+ }
9556
+ ],
9557
+ "signatures": [
9558
+ {
9559
+ "id": 890,
9560
+ "name": "clickAddButton",
9561
+ "kind": 4096,
9562
+ "kindString": "Call signature",
9563
+ "flags": {},
9564
+ "comment": {
9565
+ "shortText": "Clicks the \"Add\" button on the search results panel."
9566
+ },
9567
+ "type": {
9568
+ "type": "reference",
9569
+ "typeArguments": [
9570
+ {
9571
+ "type": "intrinsic",
9572
+ "name": "void"
9573
+ }
9574
+ ],
9575
+ "qualifiedName": "Promise",
9576
+ "package": "typescript",
9577
+ "name": "Promise"
9578
+ },
9579
+ "overwrites": {
9580
+ "type": "reference",
9581
+ "name": "SkyAutocompleteHarness.clickAddButton"
9582
+ }
9583
+ }
9584
+ ],
9585
+ "overwrites": {
9586
+ "type": "reference",
9587
+ "name": "SkyAutocompleteHarness.clickAddButton"
9588
+ }
9589
+ },
9590
+ {
9591
+ "id": 891,
9592
+ "name": "clickShowMoreButton",
9593
+ "kind": 2048,
9594
+ "kindString": "Method",
9595
+ "flags": {
9596
+ "isPublic": true
9597
+ },
9598
+ "sources": [
9599
+ {
9600
+ "fileName": "projects/lookup/src/testing/lookup/lookup-harness.ts",
9601
+ "line": 51,
9602
+ "character": 15
9603
+ }
9604
+ ],
9605
+ "signatures": [
9606
+ {
9607
+ "id": 892,
9608
+ "name": "clickShowMoreButton",
9609
+ "kind": 4096,
9610
+ "kindString": "Call signature",
9611
+ "flags": {},
9612
+ "comment": {
9613
+ "shortText": "Clicks the \"Show more\" button on the search results panel."
9614
+ },
9615
+ "type": {
9616
+ "type": "reference",
9617
+ "typeArguments": [
9618
+ {
9619
+ "type": "intrinsic",
9620
+ "name": "void"
9621
+ }
9622
+ ],
9623
+ "qualifiedName": "Promise",
9624
+ "package": "typescript",
9625
+ "name": "Promise"
9626
+ },
9627
+ "overwrites": {
9628
+ "type": "reference",
9629
+ "name": "SkyAutocompleteHarness.clickShowMoreButton"
9630
+ }
9631
+ }
9632
+ ],
9633
+ "overwrites": {
9634
+ "type": "reference",
9635
+ "name": "SkyAutocompleteHarness.clickShowMoreButton"
9636
+ }
9637
+ },
9638
+ {
9639
+ "id": 893,
9640
+ "name": "dismissSelections",
9641
+ "kind": 2048,
9642
+ "kindString": "Method",
9643
+ "flags": {
9644
+ "isPublic": true
9645
+ },
9646
+ "sources": [
9647
+ {
9648
+ "fileName": "projects/lookup/src/testing/lookup/lookup-harness.ts",
9649
+ "line": 59,
9650
+ "character": 15
9651
+ }
9652
+ ],
9653
+ "signatures": [
9654
+ {
9655
+ "id": 894,
9656
+ "name": "dismissSelections",
9657
+ "kind": 4096,
9658
+ "kindString": "Call signature",
9659
+ "flags": {},
9660
+ "comment": {
9661
+ "shortText": "Dismisses the selections made with a multiselect lookup."
9662
+ },
9663
+ "type": {
9664
+ "type": "reference",
9665
+ "typeArguments": [
9666
+ {
9667
+ "type": "intrinsic",
9668
+ "name": "void"
9669
+ }
9670
+ ],
9671
+ "qualifiedName": "Promise",
9672
+ "package": "typescript",
9673
+ "name": "Promise"
9674
+ }
9675
+ }
9676
+ ]
9677
+ },
9678
+ {
9679
+ "id": 909,
9680
+ "name": "enterText",
9681
+ "kind": 2048,
9682
+ "kindString": "Method",
9683
+ "flags": {
9684
+ "isPublic": true
9685
+ },
9686
+ "sources": [
9687
+ {
9688
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
9689
+ "line": 50,
9690
+ "character": 15
9691
+ }
9692
+ ],
9693
+ "signatures": [
9694
+ {
9695
+ "id": 910,
9696
+ "name": "enterText",
9697
+ "kind": 4096,
9698
+ "kindString": "Call signature",
9699
+ "flags": {},
9700
+ "comment": {
9701
+ "shortText": "Enters text into the autocomplete input."
9702
+ },
9703
+ "parameters": [
9704
+ {
9705
+ "id": 911,
9706
+ "name": "value",
9707
+ "kind": 32768,
9708
+ "kindString": "Parameter",
9709
+ "flags": {},
9710
+ "type": {
9711
+ "type": "intrinsic",
9712
+ "name": "string"
9713
+ }
9714
+ }
9715
+ ],
9716
+ "type": {
9717
+ "type": "reference",
9718
+ "typeArguments": [
9719
+ {
9720
+ "type": "intrinsic",
9721
+ "name": "void"
9722
+ }
9723
+ ],
9724
+ "qualifiedName": "Promise",
9725
+ "package": "typescript",
9726
+ "name": "Promise"
9727
+ },
9728
+ "inheritedFrom": {
9729
+ "type": "reference",
9730
+ "name": "SkyAutocompleteHarness.enterText"
9731
+ }
9732
+ }
9733
+ ],
9734
+ "inheritedFrom": {
9735
+ "type": "reference",
9736
+ "name": "SkyAutocompleteHarness.enterText"
9737
+ }
9738
+ },
9739
+ {
9740
+ "id": 912,
9741
+ "name": "focus",
9742
+ "kind": 2048,
9743
+ "kindString": "Method",
9744
+ "flags": {
9745
+ "isPublic": true
9746
+ },
9747
+ "sources": [
9748
+ {
9749
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
9750
+ "line": 57,
9751
+ "character": 15
9752
+ }
9753
+ ],
9754
+ "signatures": [
9755
+ {
9756
+ "id": 913,
9757
+ "name": "focus",
9758
+ "kind": 4096,
9759
+ "kindString": "Call signature",
9760
+ "flags": {},
9761
+ "comment": {
9762
+ "shortText": "Focuses the autocomplete input."
9763
+ },
9764
+ "type": {
9765
+ "type": "reference",
9766
+ "typeArguments": [
9767
+ {
9768
+ "type": "intrinsic",
9769
+ "name": "void"
9770
+ }
9771
+ ],
9772
+ "qualifiedName": "Promise",
9773
+ "package": "typescript",
9774
+ "name": "Promise"
9775
+ },
9776
+ "inheritedFrom": {
9777
+ "type": "reference",
9778
+ "name": "SkyAutocompleteHarness.focus"
9779
+ }
9780
+ }
9781
+ ],
9782
+ "inheritedFrom": {
9783
+ "type": "reference",
9784
+ "name": "SkyAutocompleteHarness.focus"
9785
+ }
9786
+ },
9787
+ {
9788
+ "id": 914,
9789
+ "name": "getSearchResults",
9790
+ "kind": 2048,
9791
+ "kindString": "Method",
9792
+ "flags": {
9793
+ "isPublic": true
9794
+ },
9795
+ "sources": [
9796
+ {
9797
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
9798
+ "line": 64,
9799
+ "character": 15
9800
+ }
9801
+ ],
9802
+ "signatures": [
9803
+ {
9804
+ "id": 915,
9805
+ "name": "getSearchResults",
9806
+ "kind": 4096,
9807
+ "kindString": "Call signature",
9808
+ "flags": {},
9809
+ "comment": {
9810
+ "shortText": "Returns search result harnesses."
9811
+ },
9812
+ "parameters": [
9813
+ {
9814
+ "id": 916,
9815
+ "name": "filters",
9816
+ "kind": 32768,
9817
+ "kindString": "Parameter",
9818
+ "flags": {
9819
+ "isOptional": true
9820
+ },
9821
+ "type": {
9822
+ "type": "reference",
9823
+ "name": "SkyAutocompleteSearchResultHarnessFilters"
9824
+ }
9825
+ }
9826
+ ],
9827
+ "type": {
9828
+ "type": "reference",
9829
+ "typeArguments": [
9830
+ {
9831
+ "type": "array",
9832
+ "elementType": {
9833
+ "type": "reference",
9834
+ "name": "SkyAutocompleteSearchResultHarness"
9835
+ }
9836
+ }
9837
+ ],
9838
+ "qualifiedName": "Promise",
9839
+ "package": "typescript",
9840
+ "name": "Promise"
9841
+ },
9842
+ "inheritedFrom": {
9843
+ "type": "reference",
9844
+ "name": "SkyAutocompleteHarness.getSearchResults"
9845
+ }
9846
+ }
9847
+ ],
9848
+ "inheritedFrom": {
9849
+ "type": "reference",
9850
+ "name": "SkyAutocompleteHarness.getSearchResults"
9851
+ }
9852
+ },
9853
+ {
9854
+ "id": 917,
9855
+ "name": "getSearchResultsText",
9856
+ "kind": 2048,
9857
+ "kindString": "Method",
9858
+ "flags": {
9859
+ "isPublic": true
9860
+ },
9861
+ "sources": [
9862
+ {
9863
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
9864
+ "line": 98,
9865
+ "character": 15
9866
+ }
9867
+ ],
9868
+ "signatures": [
9869
+ {
9870
+ "id": 918,
9871
+ "name": "getSearchResultsText",
9872
+ "kind": 4096,
9873
+ "kindString": "Call signature",
9874
+ "flags": {},
9875
+ "comment": {
9876
+ "shortText": "Returns the text content for each search result."
9877
+ },
9878
+ "parameters": [
9879
+ {
9880
+ "id": 919,
9881
+ "name": "filters",
9882
+ "kind": 32768,
9883
+ "kindString": "Parameter",
9884
+ "flags": {
9885
+ "isOptional": true
9886
+ },
9887
+ "type": {
9888
+ "type": "reference",
9889
+ "name": "SkyAutocompleteSearchResultHarnessFilters"
9890
+ }
9891
+ }
9892
+ ],
9893
+ "type": {
9894
+ "type": "reference",
9895
+ "typeArguments": [
9896
+ {
9897
+ "type": "array",
9898
+ "elementType": {
9899
+ "type": "intrinsic",
9900
+ "name": "string"
9901
+ }
9902
+ }
9903
+ ],
9904
+ "qualifiedName": "Promise",
9905
+ "package": "typescript",
9906
+ "name": "Promise"
9907
+ },
9908
+ "inheritedFrom": {
9909
+ "type": "reference",
9910
+ "name": "SkyAutocompleteHarness.getSearchResultsText"
9911
+ }
9912
+ }
9913
+ ],
9914
+ "inheritedFrom": {
9915
+ "type": "reference",
9916
+ "name": "SkyAutocompleteHarness.getSearchResultsText"
9917
+ }
9918
+ },
9919
+ {
9920
+ "id": 897,
9921
+ "name": "getSelections",
9922
+ "kind": 2048,
9923
+ "kindString": "Method",
9924
+ "flags": {
9925
+ "isPublic": true
9926
+ },
9927
+ "sources": [
9928
+ {
9929
+ "fileName": "projects/lookup/src/testing/lookup/lookup-harness.ts",
9930
+ "line": 87,
9931
+ "character": 15
9932
+ }
9933
+ ],
9934
+ "signatures": [
9935
+ {
9936
+ "id": 898,
9937
+ "name": "getSelections",
9938
+ "kind": 4096,
9939
+ "kindString": "Call signature",
9940
+ "flags": {},
9941
+ "comment": {
9942
+ "shortText": "Gets a list of selections made with a multiselect lookup."
9943
+ },
9944
+ "type": {
9945
+ "type": "reference",
9946
+ "typeArguments": [
9947
+ {
9948
+ "type": "array",
9949
+ "elementType": {
9950
+ "type": "reference",
9951
+ "name": "SkyLookupSelectionHarness"
9952
+ }
9953
+ }
9954
+ ],
9955
+ "qualifiedName": "Promise",
9956
+ "package": "typescript",
9957
+ "name": "Promise"
9958
+ }
9959
+ }
9960
+ ]
9961
+ },
9962
+ {
9963
+ "id": 899,
9964
+ "name": "getSelectionsText",
9965
+ "kind": 2048,
9966
+ "kindString": "Method",
9967
+ "flags": {
9968
+ "isPublic": true
9969
+ },
9970
+ "sources": [
9971
+ {
9972
+ "fileName": "projects/lookup/src/testing/lookup/lookup-harness.ts",
9973
+ "line": 94,
9974
+ "character": 15
9975
+ }
9976
+ ],
9977
+ "signatures": [
9978
+ {
9979
+ "id": 900,
9980
+ "name": "getSelectionsText",
9981
+ "kind": 4096,
9982
+ "kindString": "Call signature",
9983
+ "flags": {},
9984
+ "comment": {
9985
+ "shortText": "Gets the text content of all selections made with a multiselect lookup."
9986
+ },
9987
+ "type": {
9988
+ "type": "reference",
9989
+ "typeArguments": [
9990
+ {
9991
+ "type": "array",
9992
+ "elementType": {
9993
+ "type": "intrinsic",
9994
+ "name": "string"
9995
+ }
9996
+ }
9997
+ ],
9998
+ "qualifiedName": "Promise",
9999
+ "package": "typescript",
10000
+ "name": "Promise"
10001
+ }
10002
+ }
10003
+ ]
10004
+ },
10005
+ {
10006
+ "id": 895,
10007
+ "name": "getShowMorePicker",
10008
+ "kind": 2048,
10009
+ "kindString": "Method",
10010
+ "flags": {
10011
+ "isPublic": true
10012
+ },
10013
+ "sources": [
10014
+ {
10015
+ "fileName": "projects/lookup/src/testing/lookup/lookup-harness.ts",
10016
+ "line": 66,
10017
+ "character": 15
10018
+ }
10019
+ ],
10020
+ "signatures": [
10021
+ {
10022
+ "id": 896,
10023
+ "name": "getShowMorePicker",
10024
+ "kind": 4096,
10025
+ "kindString": "Call signature",
10026
+ "flags": {},
10027
+ "comment": {
10028
+ "shortText": "Gets the \"Show more\" picker harness."
10029
+ },
10030
+ "type": {
10031
+ "type": "reference",
10032
+ "typeArguments": [
10033
+ {
10034
+ "type": "reference",
10035
+ "name": "SkyLookupShowMorePickerHarness"
10036
+ }
10037
+ ],
10038
+ "qualifiedName": "Promise",
10039
+ "package": "typescript",
10040
+ "name": "Promise"
10041
+ }
10042
+ }
10043
+ ]
10044
+ },
10045
+ {
10046
+ "id": 920,
10047
+ "name": "getValue",
10048
+ "kind": 2048,
10049
+ "kindString": "Method",
10050
+ "flags": {
10051
+ "isPublic": true
10052
+ },
10053
+ "sources": [
10054
+ {
10055
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
10056
+ "line": 114,
10057
+ "character": 15
10058
+ }
10059
+ ],
10060
+ "signatures": [
10061
+ {
10062
+ "id": 921,
10063
+ "name": "getValue",
10064
+ "kind": 4096,
10065
+ "kindString": "Call signature",
10066
+ "flags": {},
10067
+ "comment": {
10068
+ "shortText": "Gets the value of the autocomplete input."
10069
+ },
10070
+ "type": {
10071
+ "type": "reference",
10072
+ "typeArguments": [
10073
+ {
10074
+ "type": "intrinsic",
10075
+ "name": "string"
10076
+ }
10077
+ ],
10078
+ "qualifiedName": "Promise",
10079
+ "package": "typescript",
10080
+ "name": "Promise"
10081
+ },
10082
+ "inheritedFrom": {
10083
+ "type": "reference",
10084
+ "name": "SkyAutocompleteHarness.getValue"
10085
+ }
10086
+ }
10087
+ ],
10088
+ "inheritedFrom": {
10089
+ "type": "reference",
10090
+ "name": "SkyAutocompleteHarness.getValue"
10091
+ }
10092
+ },
10093
+ {
10094
+ "id": 936,
10095
+ "name": "host",
10096
+ "kind": 2048,
10097
+ "kindString": "Method",
10098
+ "flags": {},
10099
+ "sources": [
10100
+ {
10101
+ "fileName": "node_modules/@angular/cdk/testing/index.d.ts",
10102
+ "line": 40,
10103
+ "character": 4
10104
+ }
10105
+ ],
10106
+ "signatures": [
10107
+ {
10108
+ "id": 937,
10109
+ "name": "host",
10110
+ "kind": 4096,
10111
+ "kindString": "Call signature",
10112
+ "flags": {},
10113
+ "comment": {
10114
+ "shortText": "Gets a `Promise` for the `TestElement` representing the host element of the component."
10115
+ },
10116
+ "type": {
10117
+ "type": "reference",
10118
+ "typeArguments": [
10119
+ {
10120
+ "type": "reference",
10121
+ "qualifiedName": "TestElement",
10122
+ "package": "@angular/cdk",
10123
+ "name": "TestElement"
10124
+ }
10125
+ ],
10126
+ "qualifiedName": "Promise",
10127
+ "package": "typescript",
10128
+ "name": "Promise"
10129
+ },
10130
+ "inheritedFrom": {
10131
+ "type": "reference",
10132
+ "name": "SkyAutocompleteHarness.host"
10133
+ }
10134
+ }
10135
+ ],
10136
+ "inheritedFrom": {
10137
+ "type": "reference",
10138
+ "name": "SkyAutocompleteHarness.host"
10139
+ }
10140
+ },
10141
+ {
10142
+ "id": 922,
10143
+ "name": "isDisabled",
10144
+ "kind": 2048,
10145
+ "kindString": "Method",
10146
+ "flags": {
10147
+ "isPublic": true
10148
+ },
10149
+ "sources": [
10150
+ {
10151
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
10152
+ "line": 121,
10153
+ "character": 15
10154
+ }
10155
+ ],
10156
+ "signatures": [
10157
+ {
10158
+ "id": 923,
10159
+ "name": "isDisabled",
10160
+ "kind": 4096,
10161
+ "kindString": "Call signature",
10162
+ "flags": {},
10163
+ "comment": {
10164
+ "shortText": "Whether the autocomplete input is disabled."
10165
+ },
10166
+ "type": {
10167
+ "type": "reference",
10168
+ "typeArguments": [
10169
+ {
10170
+ "type": "intrinsic",
10171
+ "name": "boolean"
10172
+ }
10173
+ ],
10174
+ "qualifiedName": "Promise",
10175
+ "package": "typescript",
10176
+ "name": "Promise"
10177
+ },
10178
+ "inheritedFrom": {
10179
+ "type": "reference",
10180
+ "name": "SkyAutocompleteHarness.isDisabled"
10181
+ }
10182
+ }
10183
+ ],
10184
+ "inheritedFrom": {
10185
+ "type": "reference",
10186
+ "name": "SkyAutocompleteHarness.isDisabled"
10187
+ }
10188
+ },
10189
+ {
10190
+ "id": 924,
10191
+ "name": "isFocused",
10192
+ "kind": 2048,
10193
+ "kindString": "Method",
10194
+ "flags": {
10195
+ "isPublic": true
10196
+ },
10197
+ "sources": [
10198
+ {
10199
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
10200
+ "line": 128,
10201
+ "character": 15
10202
+ }
10203
+ ],
10204
+ "signatures": [
10205
+ {
10206
+ "id": 925,
10207
+ "name": "isFocused",
10208
+ "kind": 4096,
10209
+ "kindString": "Call signature",
10210
+ "flags": {},
10211
+ "comment": {
10212
+ "shortText": "Whether the autocomplete input is focused."
10213
+ },
10214
+ "type": {
10215
+ "type": "reference",
10216
+ "typeArguments": [
10217
+ {
10218
+ "type": "intrinsic",
10219
+ "name": "boolean"
10220
+ }
10221
+ ],
10222
+ "qualifiedName": "Promise",
10223
+ "package": "typescript",
10224
+ "name": "Promise"
10225
+ },
10226
+ "inheritedFrom": {
10227
+ "type": "reference",
10228
+ "name": "SkyAutocompleteHarness.isFocused"
10229
+ }
10230
+ }
10231
+ ],
10232
+ "inheritedFrom": {
10233
+ "type": "reference",
10234
+ "name": "SkyAutocompleteHarness.isFocused"
10235
+ }
10236
+ },
10237
+ {
10238
+ "id": 901,
10239
+ "name": "isMultiselect",
10240
+ "kind": 2048,
10241
+ "kindString": "Method",
10242
+ "flags": {
10243
+ "isPublic": true
10244
+ },
10245
+ "sources": [
10246
+ {
10247
+ "fileName": "projects/lookup/src/testing/lookup/lookup-harness.ts",
10248
+ "line": 101,
10249
+ "character": 15
10250
+ }
10251
+ ],
10252
+ "signatures": [
10253
+ {
10254
+ "id": 902,
10255
+ "name": "isMultiselect",
10256
+ "kind": 4096,
10257
+ "kindString": "Call signature",
10258
+ "flags": {},
10259
+ "comment": {
10260
+ "shortText": "Whether the lookup allows for multiple selections."
10261
+ },
10262
+ "type": {
10263
+ "type": "reference",
10264
+ "typeArguments": [
10265
+ {
10266
+ "type": "intrinsic",
10267
+ "name": "boolean"
10268
+ }
10269
+ ],
10270
+ "qualifiedName": "Promise",
10271
+ "package": "typescript",
10272
+ "name": "Promise"
10273
+ }
10274
+ }
10275
+ ]
10276
+ },
10277
+ {
10278
+ "id": 926,
10279
+ "name": "isOpen",
10280
+ "kind": 2048,
10281
+ "kindString": "Method",
10282
+ "flags": {
10283
+ "isPublic": true
10284
+ },
10285
+ "sources": [
10286
+ {
10287
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
10288
+ "line": 135,
10289
+ "character": 15
10290
+ }
10291
+ ],
10292
+ "signatures": [
10293
+ {
10294
+ "id": 927,
10295
+ "name": "isOpen",
10296
+ "kind": 4096,
10297
+ "kindString": "Call signature",
10298
+ "flags": {},
10299
+ "comment": {
10300
+ "shortText": "Whether the autocomplete is open."
10301
+ },
10302
+ "type": {
10303
+ "type": "reference",
10304
+ "typeArguments": [
10305
+ {
10306
+ "type": "intrinsic",
10307
+ "name": "boolean"
10308
+ }
10309
+ ],
10310
+ "qualifiedName": "Promise",
10311
+ "package": "typescript",
10312
+ "name": "Promise"
10313
+ },
10314
+ "inheritedFrom": {
10315
+ "type": "reference",
10316
+ "name": "SkyAutocompleteHarness.isOpen"
10317
+ }
10318
+ }
10319
+ ],
10320
+ "inheritedFrom": {
10321
+ "type": "reference",
10322
+ "name": "SkyAutocompleteHarness.isOpen"
10323
+ }
10324
+ },
10325
+ {
10326
+ "id": 928,
10327
+ "name": "selectSearchResult",
10328
+ "kind": 2048,
10329
+ "kindString": "Method",
10330
+ "flags": {
10331
+ "isPublic": true
10332
+ },
10333
+ "sources": [
10334
+ {
10335
+ "fileName": "projects/lookup/src/testing/autocomplete/autocomplete-harness.ts",
10336
+ "line": 143,
10337
+ "character": 15
10338
+ }
10339
+ ],
10340
+ "signatures": [
10341
+ {
10342
+ "id": 929,
10343
+ "name": "selectSearchResult",
10344
+ "kind": 4096,
10345
+ "kindString": "Call signature",
10346
+ "flags": {},
10347
+ "comment": {
10348
+ "shortText": "Selects a search result."
10349
+ },
10350
+ "parameters": [
10351
+ {
10352
+ "id": 930,
10353
+ "name": "filters",
10354
+ "kind": 32768,
10355
+ "kindString": "Parameter",
10356
+ "flags": {},
10357
+ "type": {
10358
+ "type": "reference",
10359
+ "name": "SkyAutocompleteSearchResultHarnessFilters"
10360
+ }
10361
+ }
10362
+ ],
10363
+ "type": {
10364
+ "type": "reference",
10365
+ "typeArguments": [
10366
+ {
10367
+ "type": "intrinsic",
10368
+ "name": "void"
10369
+ }
10370
+ ],
10371
+ "qualifiedName": "Promise",
10372
+ "package": "typescript",
10373
+ "name": "Promise"
10374
+ },
10375
+ "inheritedFrom": {
10376
+ "type": "reference",
10377
+ "name": "SkyAutocompleteHarness.selectSearchResult"
10378
+ }
10379
+ }
10380
+ ],
10381
+ "inheritedFrom": {
10382
+ "type": "reference",
10383
+ "name": "SkyAutocompleteHarness.selectSearchResult"
10384
+ }
10385
+ },
10386
+ {
10387
+ "id": 874,
10388
+ "name": "with",
10389
+ "kind": 2048,
10390
+ "kindString": "Method",
10391
+ "flags": {
10392
+ "isPublic": true,
10393
+ "isStatic": true
10394
+ },
10395
+ "sources": [
10396
+ {
10397
+ "fileName": "projects/lookup/src/testing/lookup/lookup-harness.ts",
10398
+ "line": 34,
10399
+ "character": 16
10400
+ }
10401
+ ],
10402
+ "signatures": [
10403
+ {
10404
+ "id": 875,
10405
+ "name": "with",
10406
+ "kind": 4096,
10407
+ "kindString": "Call signature",
10408
+ "flags": {},
10409
+ "comment": {
10410
+ "shortText": "Gets a `HarnessPredicate` that can be used to search for a\n`SkyLookupHarness` that meets certain criteria."
10411
+ },
10412
+ "parameters": [
10413
+ {
10414
+ "id": 876,
10415
+ "name": "filters",
10416
+ "kind": 32768,
10417
+ "kindString": "Parameter",
10418
+ "flags": {},
10419
+ "type": {
10420
+ "type": "reference",
10421
+ "name": "SkyLookupHarnessFilters"
10422
+ }
10423
+ }
10424
+ ],
10425
+ "type": {
10426
+ "type": "reference",
10427
+ "typeArguments": [
10428
+ {
10429
+ "type": "reference",
10430
+ "id": 872,
10431
+ "name": "SkyLookupHarness"
10432
+ }
10433
+ ],
10434
+ "qualifiedName": "HarnessPredicate",
10435
+ "package": "@angular/cdk",
10436
+ "name": "HarnessPredicate"
10437
+ },
10438
+ "overwrites": {
10439
+ "type": "reference",
10440
+ "name": "SkyAutocompleteHarness.with"
10441
+ }
10442
+ }
10443
+ ],
10444
+ "overwrites": {
10445
+ "type": "reference",
10446
+ "name": "SkyAutocompleteHarness.with"
10447
+ }
10448
+ }
10449
+ ],
10450
+ "groups": [
10451
+ {
10452
+ "title": "Constructors",
10453
+ "kind": 512,
10454
+ "children": [
10455
+ 882
10456
+ ]
10457
+ },
10458
+ {
10459
+ "title": "Methods",
10460
+ "kind": 2048,
10461
+ "children": [
10462
+ 905,
10463
+ 907,
10464
+ 889,
10465
+ 891,
10466
+ 893,
10467
+ 909,
10468
+ 912,
10469
+ 914,
10470
+ 917,
10471
+ 897,
10472
+ 899,
10473
+ 895,
10474
+ 920,
10475
+ 936,
10476
+ 922,
10477
+ 924,
10478
+ 901,
10479
+ 926,
10480
+ 928,
10481
+ 874
10482
+ ]
10483
+ }
10484
+ ],
10485
+ "sources": [
10486
+ {
10487
+ "fileName": "projects/lookup/src/testing/lookup/lookup-harness.ts",
10488
+ "line": 13,
10489
+ "character": 13
10490
+ }
10491
+ ],
10492
+ "extendedTypes": [
10493
+ {
10494
+ "type": "reference",
10495
+ "name": "SkyAutocompleteHarness"
10496
+ }
10497
+ ]
10498
+ }
10499
+ ],
10500
+ "groups": [
10501
+ {
10502
+ "title": "Modules",
10503
+ "kind": 2,
10504
+ "children": [
10505
+ 1,
10506
+ 2
10507
+ ]
10508
+ }
10509
+ ]
10510
+ },
10511
+ "codeExamples": [
10512
+ {
10513
+ "fileName": "autocomplete-demo.component.html",
10514
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/advanced/autocomplete-demo.component.html",
10515
+ "rawContents": "<form novalidate [formGroup]=\"myForm\">\n <div class=\"sky-margin-stacked-lg\">\n The following field:<br />\n <ul>\n <li>utilizes a custom search result template,</li>\n <li>searches against the name and description properties,</li>\n <li>limits the search results to two,</li>\n <li>runs the search if the query is at least three characters long,</li>\n <li>and fires an event when a selection is made.</li>\n </ul>\n </div>\n\n <div class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"planetInput.id\">\n Farthest planet from the sun\n </label>\n <sky-autocomplete\n [data]=\"planets\"\n [propertiesToSearch]=\"['name', 'description']\"\n [searchResultsLimit]=\"2\"\n [searchResultTemplate]=\"planetSearchResultTemplate\"\n [searchTextMinimumCharacters]=\"3\"\n (selectionChange)=\"onPlanetSelection($event)\"\n >\n <input\n formControlName=\"farthestPlanet\"\n skyAutocomplete\n skyId\n type=\"text\"\n #planetInput\n />\n </sky-autocomplete>\n </div>\n <p class=\"sky-font-emphasized\">Form model:</p>\n <pre>{{ myForm.value | json }}</pre>\n</form>\n\n<ng-template let-item=\"item\" #planetSearchResultTemplate>\n <strong>\n {{ item.name }}\n </strong>\n <br />\n {{ item.description }}\n</ng-template>\n"
10516
+ },
10517
+ {
10518
+ "fileName": "autocomplete-demo.component.ts",
10519
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/advanced/autocomplete-demo.component.ts",
10520
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';\nimport {\n SkyAutocompleteSearchFunctionFilter,\n SkyAutocompleteSelectionChange,\n} from '@skyux/lookup';\n\n@Component({\n selector: 'app-autocomplete-demo',\n templateUrl: './autocomplete-demo.component.html',\n})\nexport class AutocompleteDemoComponent implements OnInit {\n public farthestPlanet: any;\n\n public myForm: UntypedFormGroup;\n\n public planets: any[] = [\n {\n name: 'Mercury',\n description: 'Mercury is a planet in our solar system.',\n },\n { name: 'Venus', description: 'Venus is a planet in our solar system.' },\n { name: 'Earth', description: 'Earth is a planet in our solar system.' },\n { name: 'Mars', description: 'Mars is a planet in our solar system.' },\n {\n name: 'Jupiter',\n description: 'Jupiter is a planet in our solar system.',\n },\n { name: 'Saturn', description: 'Saturn is a planet in our solar system.' },\n { name: 'Uranus', description: 'Uranus is a planet in our solar system.' },\n {\n name: 'Neptune',\n description: 'Neptune is a planet in our solar system.',\n },\n ];\n\n public searchFilters: SkyAutocompleteSearchFunctionFilter[] = [\n (searchText: string, item: any): boolean => {\n return item.name !== 'Red';\n },\n ];\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n }\n\n public onPlanetSelection(args: SkyAutocompleteSelectionChange): void {\n alert(`You selected ${args.selectedItem.name}`);\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n farthestPlanet: {},\n });\n }\n}\n"
10521
+ },
10522
+ {
10523
+ "fileName": "autocomplete-demo.module.ts",
10524
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/advanced/autocomplete-demo.module.ts",
10525
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyAutocompleteModule } from '@skyux/lookup';\n\nimport { AutocompleteDemoComponent } from './autocomplete-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyAutocompleteModule,\n SkyIconModule,\n ],\n declarations: [AutocompleteDemoComponent],\n exports: [AutocompleteDemoComponent],\n})\nexport class AutocompleteDemoModule {}\n"
10526
+ },
10527
+ {
10528
+ "fileName": "autocomplete-demo.component.html",
10529
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/basic/autocomplete-demo.component.html",
10530
+ "rawContents": "<form novalidate [formGroup]=\"myForm\">\n <div class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"favoriteColorInput.id\">\n Favorite color\n </label>\n <sky-autocomplete [data]=\"colors\">\n <input\n formControlName=\"favoriteColor\"\n type=\"text\"\n skyAutocomplete\n skyId\n #favoriteColorInput\n />\n </sky-autocomplete>\n </div>\n <p class=\"sky-font-emphasized\">Form model:</p>\n <pre>{{ myForm.value | json }}</pre>\n</form>\n"
10531
+ },
10532
+ {
10533
+ "fileName": "autocomplete-demo.component.ts",
10534
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/basic/autocomplete-demo.component.ts",
10535
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';\n\n@Component({\n selector: 'app-autocomplete-demo',\n templateUrl: './autocomplete-demo.component.html',\n})\nexport class AutocompleteDemoComponent implements OnInit {\n public colors: any[] = [\n { name: 'Red' },\n { name: 'Blue' },\n { name: 'Green' },\n { name: 'Orange' },\n { name: 'Pink' },\n { name: 'Purple' },\n { name: 'Yellow' },\n { name: 'Brown' },\n { name: 'Turquoise' },\n { name: 'White' },\n { name: 'Black' },\n ];\n\n public myForm: UntypedFormGroup;\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n favoriteColor: undefined,\n });\n }\n}\n"
10536
+ },
10537
+ {
10538
+ "fileName": "autocomplete-demo.module.ts",
10539
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/basic/autocomplete-demo.module.ts",
10540
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyAutocompleteModule } from '@skyux/lookup';\n\nimport { AutocompleteDemoComponent } from './autocomplete-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyAutocompleteModule,\n SkyIdModule,\n ],\n declarations: [AutocompleteDemoComponent],\n exports: [AutocompleteDemoComponent],\n})\nexport class AutocompleteDemoModule {}\n"
10541
+ },
10542
+ {
10543
+ "fileName": "autocomplete-demo.component.html",
10544
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/custom-search/autocomplete-demo.component.html",
10545
+ "rawContents": "<form novalidate [formGroup]=\"myForm\">\n <p>\n The following field has a preselected value and utilizes a custom search\n function, as well as a custom template for the search results.\n </p>\n <div class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"largestOceanInput.id\">\n Largest ocean\n </label>\n <sky-autocomplete\n descriptorProperty=\"title\"\n [data]=\"oceans\"\n [search]=\"getOceanSearchFunction()\"\n [searchResultTemplate]=\"oceanSearchResultTemplate\"\n >\n <input\n formControlName=\"largestOcean\"\n type=\"text\"\n skyAutocomplete\n skyId\n #largestOceanInput=\"skyId\"\n />\n </sky-autocomplete>\n </div>\n <p class=\"sky-font-emphasized\">Form model:</p>\n <pre>{{ myForm.value | json }}</pre>\n</form>\n\n<ng-template let-item=\"item\" #oceanSearchResultTemplate>\n <sky-icon icon=\"long-arrow-right\"></sky-icon>\n {{ item.title }} &bull; ID {{ item.id }}\n</ng-template>\n"
10546
+ },
10547
+ {
10548
+ "fileName": "autocomplete-demo.component.ts",
10549
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/custom-search/autocomplete-demo.component.ts",
10550
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';\nimport {\n SkyAutocompleteSearchFunction,\n SkyAutocompleteSearchFunctionResponse,\n} from '@skyux/lookup';\n\n@Component({\n selector: 'app-autocomplete-demo',\n templateUrl: './autocomplete-demo.component.html',\n})\nexport class AutocompleteDemoComponent implements OnInit {\n public myForm: UntypedFormGroup;\n\n public largestOcean: any;\n\n public oceans: any[] = [\n { title: 'Arctic', id: 1 },\n { title: 'Atlantic', id: 2 },\n { title: 'Indian', id: 3 },\n { title: 'Pacific', id: 4 },\n ];\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n }\n\n public getOceanSearchFunction(): SkyAutocompleteSearchFunction {\n const searchFunction = (\n searchText: string,\n oceans: any[]\n ): SkyAutocompleteSearchFunctionResponse => {\n return new Promise((resolve) => {\n const searchTextLower = searchText.toLowerCase();\n\n const results = oceans.filter((ocean: any) => {\n const val = ocean.title;\n const isMatch =\n val && val.toString().toLowerCase().indexOf(searchTextLower) > -1;\n return isMatch;\n });\n\n // Simulate an async request.\n setTimeout(() => {\n resolve(results);\n }, 500);\n });\n };\n\n return searchFunction;\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n largestOcean: { title: 'Arctic', id: 1 },\n });\n }\n}\n"
10551
+ },
10552
+ {
10553
+ "fileName": "autocomplete-demo.module.ts",
10554
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/custom-search/autocomplete-demo.module.ts",
10555
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyAutocompleteModule } from '@skyux/lookup';\n\nimport { AutocompleteDemoComponent } from './autocomplete-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyAutocompleteModule,\n SkyIconModule,\n SkyIdModule,\n ],\n declarations: [AutocompleteDemoComponent],\n exports: [AutocompleteDemoComponent],\n})\nexport class AutocompleteDemoModule {}\n"
10556
+ },
10557
+ {
10558
+ "fileName": "autocomplete-demo.component.html",
10559
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/search-filters/autocomplete-demo.component.html",
10560
+ "rawContents": "<form novalidate [formGroup]=\"myForm\">\n <p>\n The following field provides a custom function that filters the data before\n every search attempt.\n </p>\n <div class=\"sky-form-group\">\n <label class=\"sky-control-label\" [for]=\"favoriteColorInput.id\">\n Color (\"Red\" is not available)\n </label>\n <sky-autocomplete [data]=\"colors\" [searchFilters]=\"searchFilters\">\n <input\n formControlName=\"favoriteColor\"\n skyAutocomplete\n skyId\n type=\"text\"\n #favoriteColorInput=\"skyId\"\n />\n </sky-autocomplete>\n </div>\n <p class=\"sky-font-emphasized\">Form model:</p>\n <pre>{{ myForm.value | json }}</pre>\n</form>\n"
10561
+ },
10562
+ {
10563
+ "fileName": "autocomplete-demo.component.ts",
10564
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/search-filters/autocomplete-demo.component.ts",
10565
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';\nimport { SkyAutocompleteSearchFunctionFilter } from '@skyux/lookup';\n\n@Component({\n selector: 'app-autocomplete-demo',\n templateUrl: './autocomplete-demo.component.html',\n})\nexport class AutocompleteDemoComponent implements OnInit {\n public colors: any[] = [\n { name: 'Red' },\n { name: 'Blue' },\n { name: 'Green' },\n { name: 'Orange' },\n { name: 'Pink' },\n { name: 'Purple' },\n { name: 'Yellow' },\n { name: 'Brown' },\n { name: 'Turquoise' },\n { name: 'White' },\n { name: 'Black' },\n ];\n\n public myForm: UntypedFormGroup;\n\n public searchFilters: SkyAutocompleteSearchFunctionFilter[] = [\n (searchText: string, item: any): boolean => {\n return item.name !== 'Red';\n },\n ];\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n favoriteColor: undefined,\n });\n }\n}\n"
10566
+ },
10567
+ {
10568
+ "fileName": "autocomplete-demo.module.ts",
10569
+ "filePath": "/projects/lookup/documentation/code-examples/autocomplete/search-filters/autocomplete-demo.module.ts",
10570
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyAutocompleteModule } from '@skyux/lookup';\n\nimport { AutocompleteDemoComponent } from './autocomplete-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyAutocompleteModule,\n SkyIdModule,\n ],\n declarations: [AutocompleteDemoComponent],\n exports: [AutocompleteDemoComponent],\n})\nexport class AutocompleteDemoModule {}\n"
10571
+ },
10572
+ {
10573
+ "fileName": "country-field-demo.component.html",
10574
+ "filePath": "/projects/lookup/documentation/code-examples/country-field/basic/country-field-demo.component.html",
10575
+ "rawContents": "<form [formGroup]=\"countryForm\">\n <sky-input-box>\n <sky-country-field formControlName=\"countryControl\"> </sky-country-field>\n </sky-input-box>\n</form>\n"
10576
+ },
10577
+ {
10578
+ "fileName": "country-field-demo.component.ts",
10579
+ "filePath": "/projects/lookup/documentation/code-examples/country-field/basic/country-field-demo.component.ts",
10580
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport {\n UntypedFormControl,\n UntypedFormGroup,\n Validators,\n} from '@angular/forms';\nimport { SkyCountryFieldCountry } from '@skyux/lookup';\n\n@Component({\n selector: 'app-country-field-demo',\n templateUrl: './country-field-demo.component.html',\n})\nexport class CountryFieldDemoComponent implements OnInit {\n public countryControl: UntypedFormControl;\n\n public countryData: SkyCountryFieldCountry;\n\n public countryForm: UntypedFormGroup;\n\n public ngOnInit(): void {\n this.countryControl = new UntypedFormControl();\n this.countryControl.setValue({\n name: 'Australia',\n iso2: 'au',\n });\n this.countryForm = new UntypedFormGroup({\n countryControl: this.countryControl,\n });\n\n this.countryControl.setValidators([Validators.required]);\n }\n}\n"
10581
+ },
10582
+ {
10583
+ "fileName": "country-field-demo.module.ts",
10584
+ "filePath": "/projects/lookup/documentation/code-examples/country-field/basic/country-field-demo.module.ts",
10585
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyCountryFieldModule } from '@skyux/lookup';\n\nimport { CountryFieldDemoComponent } from './country-field-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyCountryFieldModule,\n SkyInputBoxModule,\n ],\n declarations: [CountryFieldDemoComponent],\n exports: [CountryFieldDemoComponent],\n})\nexport class CountryFieldDemoModule {}\n"
10586
+ },
10587
+ {
10588
+ "fileName": "lookup-async-demo-search-results.ts",
10589
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo-search-results.ts",
10590
+ "rawContents": "import { LookupDemoPerson } from './lookup-demo-person';\n\nexport interface LookupAsyncDemoSearchResults {\n hasMore: boolean;\n people: LookupDemoPerson[];\n totalCount: number;\n}\n"
10591
+ },
10592
+ {
10593
+ "fileName": "lookup-async-demo.component.html",
10594
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.component.html",
10595
+ "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"favoritesForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box data-sky-id=\"favorite-names-field\">\n <label class=\"sky-control-label\" skyId #favoriteNamesLabel=\"skyId\">\n Favorite name(s)\n </label>\n <sky-lookup\n formControlName=\"favoriteNames\"\n idProperty=\"name\"\n [ariaLabelledBy]=\"favoriteNamesLabel.id\"\n [enableShowMore]=\"true\"\n (searchAsync)=\"searchAsync($event)\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ favoritesForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n"
10596
+ },
10597
+ {
10598
+ "fileName": "lookup-async-demo.component.scss",
10599
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.component.scss",
10600
+ "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
10601
+ },
10602
+ {
10603
+ "fileName": "lookup-async-demo.component.spec.ts",
10604
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.component.spec.ts",
10605
+ "rawContents": "import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';\nimport { TestBed } from '@angular/core/testing';\nimport { NoopAnimationsModule } from '@angular/platform-browser/animations';\nimport { SkyInputBoxHarness } from '@skyux/forms/testing';\nimport { SkyLookupHarness } from '@skyux/lookup/testing';\n\nimport { of } from 'rxjs';\n\nimport { LookupAsyncDemoComponent } from './lookup-async-demo.component';\nimport { LookupAsyncDemoModule } from './lookup-async-demo.module';\nimport { LookupAsyncDemoService } from './lookup-async-demo.service';\n\ndescribe('Lookup asynchronous search demo', () => {\n let mockSvc!: jasmine.SpyObj<LookupAsyncDemoService>;\n\n async function setupTest() {\n const fixture = TestBed.createComponent(LookupAsyncDemoComponent);\n const loader = TestbedHarnessEnvironment.loader(fixture);\n\n const lookupHarness = await (\n await loader.getHarness(\n SkyInputBoxHarness.with({ dataSkyId: 'favorite-names-field' })\n )\n ).queryHarness(SkyLookupHarness);\n\n return { lookupHarness, fixture };\n }\n\n beforeEach(() => {\n // Create a mock search service. In a real-world application, the search\n // service would make a web request which should be avoided in unit tests.\n mockSvc = jasmine.createSpyObj('LookupAsyncDemoService', ['search']);\n\n TestBed.configureTestingModule({\n imports: [NoopAnimationsModule, LookupAsyncDemoModule],\n providers: [\n {\n provide: LookupAsyncDemoService,\n useValue: mockSvc,\n },\n ],\n });\n });\n\n it('should set the expected initial value', async () => {\n const { lookupHarness } = await setupTest();\n\n await expectAsync(lookupHarness.getSelectionsText()).toBeResolvedTo([\n 'Shirley',\n ]);\n });\n\n it('should update the form control when a favorite name is selected', async () => {\n const { lookupHarness, fixture } = await setupTest();\n\n mockSvc.search.and.callFake((searchText) =>\n of({\n hasMore: false,\n people:\n searchText === 'b'\n ? [\n {\n name: 'Bernard',\n },\n ]\n : [],\n totalCount: 1,\n })\n );\n\n await lookupHarness.enterText('b');\n await lookupHarness.selectSearchResult({\n text: 'Bernard',\n });\n\n expect(fixture.componentInstance.favoritesForm.value.favoriteNames).toEqual(\n [{ name: 'Shirley' }, { name: 'Bernard' }]\n );\n });\n});\n"
10606
+ },
10607
+ {
10608
+ "fileName": "lookup-async-demo.component.ts",
10609
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.component.ts",
10610
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport { SkyAutocompleteSearchAsyncArgs } from '@skyux/lookup';\n\nimport { map } from 'rxjs/operators';\n\nimport { LookupAsyncDemoService } from './lookup-async-demo.service';\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-async-lookup-demo',\n templateUrl: './lookup-async-demo.component.html',\n styleUrls: ['./lookup-async-demo.component.scss'],\n})\nexport class LookupAsyncDemoComponent implements OnInit {\n public favoritesForm: FormGroup<{\n favoriteNames: FormControl<LookupDemoPerson[]>;\n }>;\n\n #searchSvc: LookupAsyncDemoService;\n\n constructor(formBuilder: FormBuilder, searchSvc: LookupAsyncDemoService) {\n this.#searchSvc = searchSvc;\n\n this.favoritesForm = formBuilder.group({\n favoriteNames: [\n [\n {\n name: 'Shirley',\n },\n ],\n ],\n });\n }\n\n public ngOnInit(): void {\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.favoritesForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.favoritesForm.value));\n }\n\n public searchAsync(args: SkyAutocompleteSearchAsyncArgs): void {\n // In a real-world application the search service might return an Observable\n // created by calling HttpClient.get(). Assigning that Observable to the result\n // allows the lookup component to cancel the web request if it does not complete\n // before the user searches again.\n args.result = this.#searchSvc.search(args.searchText).pipe(\n map((result) => ({\n hasMore: result.hasMore,\n items: result.people,\n totalCount: result.totalCount,\n }))\n );\n }\n}\n"
10611
+ },
10612
+ {
10613
+ "fileName": "lookup-async-demo.module.ts",
10614
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.module.ts",
10615
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyLookupModule } from '@skyux/lookup';\n\nimport { LookupAsyncDemoComponent } from './lookup-async-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyLookupModule,\n ],\n declarations: [LookupAsyncDemoComponent],\n exports: [LookupAsyncDemoComponent],\n})\nexport class LookupAsyncDemoModule {}\n"
10616
+ },
10617
+ {
10618
+ "fileName": "lookup-async-demo.service.ts",
10619
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-async-demo.service.ts",
10620
+ "rawContents": "import { Injectable } from '@angular/core';\n\nimport { Observable, of } from 'rxjs';\nimport { delay } from 'rxjs/operators';\n\nimport { LookupAsyncDemoSearchResults } from './lookup-async-demo-search-results';\nimport { LookupDemoPerson } from './lookup-demo-person';\n\nconst people: LookupDemoPerson[] = [\n { name: 'Abed' },\n { name: 'Alex' },\n { name: 'Ben' },\n { name: 'Britta' },\n { name: 'Buzz' },\n { name: 'Craig' },\n { name: 'Elroy' },\n { name: 'Garrett' },\n { name: 'Ian' },\n { name: 'Jeff' },\n { name: 'Leonard' },\n { name: 'Neil' },\n { name: 'Pierce' },\n { name: 'Preston' },\n { name: 'Rachel' },\n { name: 'Shirley' },\n { name: 'Todd' },\n { name: 'Troy' },\n { name: 'Vaughn' },\n { name: 'Vicki' },\n];\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LookupAsyncDemoService {\n public search(searchText: string): Observable<LookupAsyncDemoSearchResults> {\n // Simulate a network call with latency. A real-world application might\n // use Angular's HttpClient to create an Observable from a call to a\n // web service.\n searchText = searchText.toUpperCase();\n\n const matchingPeople = people.filter((person) =>\n person.name.toUpperCase().includes(searchText)\n );\n\n return of({\n hasMore: false,\n people: matchingPeople,\n totalCount: matchingPeople.length,\n }).pipe(delay(800));\n }\n}\n"
10621
+ },
10622
+ {
10623
+ "fileName": "lookup-demo-person.ts",
10624
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/async/lookup-demo-person.ts",
10625
+ "rawContents": "export interface LookupDemoPerson {\n name: string;\n}\n"
10626
+ },
10627
+ {
10628
+ "fileName": "lookup-custom-picker-demo-modal.component.html",
10629
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo-modal.component.html",
10630
+ "rawContents": "<sky-modal class=\"lookup-custom-picker-modal\">\n <sky-modal-header>Names</sky-modal-header>\n <sky-modal-content>\n <form [formGroup]=\"peopleForm\">\n <sky-selection-box-grid>\n <sky-selection-box\n *ngFor=\"\n let personControl of peopleForm.controls.people.controls;\n let i = index\n \"\n [control]=\"checkbox\"\n >\n <sky-icon icon=\"user\" iconType=\"skyux\"></sky-icon>\n <sky-selection-box-header>\n {{ people[i].name }}\n </sky-selection-box-header>\n <sky-selection-box-description>\n {{ people[i].formal }}\n </sky-selection-box-description>\n <sky-checkbox [formControl]=\"personControl\" #checkbox></sky-checkbox>\n </sky-selection-box>\n </sky-selection-box-grid>\n </form>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n class=\"sky-btn sky-btn-primary lookup-custom-picker-save-button\"\n type=\"button\"\n (click)=\"save()\"\n >\n Save\n </button>\n </sky-modal-footer>\n</sky-modal>\n"
10631
+ },
10632
+ {
10633
+ "fileName": "lookup-custom-picker-demo-modal.component.ts",
10634
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo-modal.component.ts",
10635
+ "rawContents": "import { Component } from '@angular/core';\nimport { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport { SkyLookupShowMoreCustomPickerContext } from '@skyux/lookup';\nimport { SkyModalInstance } from '@skyux/modals';\n\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-lookup-demo-modal',\n templateUrl: './lookup-custom-picker-demo-modal.component.html',\n})\nexport class LookupCustomPickerDemoModalComponent {\n public peopleForm: FormGroup<{\n people: FormArray<FormControl<boolean>>;\n }>;\n\n public people: LookupDemoPerson[];\n\n #modalInstance: SkyModalInstance;\n\n constructor(\n context: SkyLookupShowMoreCustomPickerContext,\n modalInstance: SkyModalInstance,\n formBuilder: FormBuilder\n ) {\n this.#modalInstance = modalInstance;\n\n // This list of people will be rendered as selection boxes.\n this.people = context.items;\n\n // Create a control for each selection box.\n this.peopleForm = formBuilder.group({\n people: formBuilder.array(\n context.items.map((item) =>\n formBuilder.control(context.initialValue?.includes(item))\n )\n ),\n });\n }\n\n public save(): void {\n // Return a list of selected people to the lookup component.\n const selectedPeople = this.people.filter(\n (_, index) => this.peopleForm.value.people[index]\n );\n\n this.#modalInstance.save(selectedPeople);\n }\n}\n"
10636
+ },
10637
+ {
10638
+ "fileName": "lookup-custom-picker-demo.component.html",
10639
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo.component.html",
10640
+ "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"favoritesForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box data-sky-id=\"favorite-names-field\">\n <label class=\"sky-control-label\" skyId #namesLabel=\"skyId\">\n Favorite names\n </label>\n <sky-lookup\n formControlName=\"favoriteNames\"\n (addClick)=\"onAddButtonClicked()\"\n [ariaLabelledBy]=\"namesLabel.id\"\n [data]=\"people\"\n [enableShowMore]=\"true\"\n [searchFilters]=\"searchFilters\"\n [showAddButton]=\"true\"\n [showMoreConfig]=\"showMoreConfig\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ favoritesForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n"
10641
+ },
10642
+ {
10643
+ "fileName": "lookup-custom-picker-demo.component.scss",
10644
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo.component.scss",
10645
+ "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
10646
+ },
10647
+ {
10648
+ "fileName": "lookup-custom-picker-demo.component.spec.ts",
10649
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo.component.spec.ts",
10650
+ "rawContents": "import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';\nimport { TestBed } from '@angular/core/testing';\nimport { NoopAnimationsModule } from '@angular/platform-browser/animations';\nimport { SkyInputBoxHarness } from '@skyux/forms/testing';\nimport { SkyLookupHarness } from '@skyux/lookup/testing';\n\nimport { LookupCustomPickerDemoComponent } from './lookup-custom-picker-demo.component';\nimport { LookupCustomPickerDemoModule } from './lookup-custom-picker-demo.module';\nimport { LookupCustomPickerHarness } from './lookup-custom-picker-harness';\n\ndescribe('Lookup custom picker demo', () => {\n async function setupTest() {\n const fixture = TestBed.createComponent(LookupCustomPickerDemoComponent);\n const loader = TestbedHarnessEnvironment.loader(fixture);\n\n const lookupHarness = await (\n await loader.getHarness(\n SkyInputBoxHarness.with({ dataSkyId: 'favorite-names-field' })\n )\n ).queryHarness(SkyLookupHarness);\n\n return { lookupHarness, fixture };\n }\n\n beforeEach(() => {\n TestBed.configureTestingModule({\n imports: [LookupCustomPickerDemoModule, NoopAnimationsModule],\n });\n });\n\n it('should set the expected initial value', async () => {\n const { lookupHarness } = await setupTest();\n\n await expectAsync(lookupHarness.getSelectionsText()).toBeResolvedTo([\n 'Shirley',\n ]);\n });\n\n it('should update the form control when a favorite name is selected', async () => {\n const { lookupHarness, fixture } = await setupTest();\n\n await lookupHarness.enterText('vick');\n\n const firstResultHarness = (await lookupHarness.getSearchResults())[0];\n await firstResultHarness.select();\n\n expect(fixture.componentInstance.favoritesForm.value.favoriteNames).toEqual(\n [\n { name: 'Shirley', formal: 'Ms. Bennett' },\n { name: 'Vicki', formal: 'Ms. Jenkins' },\n ]\n );\n });\n\n it('should use a custom picker', async () => {\n const { lookupHarness, fixture } = await setupTest();\n\n // Show the custom picker.\n await lookupHarness.clickShowMoreButton();\n\n // Use the custom picker harness to validate that selecting/deslecting items\n // updates the lookup form field.\n const loader = TestbedHarnessEnvironment.documentRootLoader(fixture);\n\n const customPickerHarness = await loader.getHarness(\n LookupCustomPickerHarness\n );\n\n await customPickerHarness.checkItemAt(3); // Britta (Ms. Perry)\n await customPickerHarness.checkItemAt(7); // Garret (Mr. Lambert)\n await customPickerHarness.uncheckItemAt(15); // Shirley (Ms. Bennett)\n\n await customPickerHarness.save();\n\n expect(fixture.componentInstance.favoritesForm.value.favoriteNames).toEqual(\n [\n { name: 'Britta', formal: 'Ms. Perry' },\n { name: 'Garrett', formal: 'Mr. Lambert' },\n ]\n );\n });\n});\n"
10651
+ },
10652
+ {
10653
+ "fileName": "lookup-custom-picker-demo.component.ts",
10654
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo.component.ts",
10655
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport {\n SkyAutocompleteSearchFunctionFilter,\n SkyLookupShowMoreConfig,\n SkyLookupShowMoreCustomPickerContext,\n} from '@skyux/lookup';\nimport { SkyModalService } from '@skyux/modals';\n\nimport { LookupCustomPickerDemoModalComponent } from './lookup-custom-picker-demo-modal.component';\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-lookup-demo',\n templateUrl: './lookup-custom-picker-demo.component.html',\n styleUrls: ['./lookup-custom-picker-demo.component.scss'],\n})\nexport class LookupCustomPickerDemoComponent implements OnInit {\n public favoritesForm: FormGroup<{\n favoriteNames: FormControl<LookupDemoPerson[]>;\n }>;\n\n public showMoreConfig: SkyLookupShowMoreConfig;\n public searchFilters: SkyAutocompleteSearchFunctionFilter[];\n\n public people: LookupDemoPerson[] = [\n {\n name: 'Abed',\n formal: 'Mr. Nadir',\n },\n {\n name: 'Alex',\n formal: 'Mr. Osbourne',\n },\n {\n name: 'Ben',\n formal: 'Mr. Chang',\n },\n {\n name: 'Britta',\n formal: 'Ms. Perry',\n },\n {\n name: 'Buzz',\n formal: 'Mr. Hickey',\n },\n {\n name: 'Craig',\n formal: 'Mr. Pelton',\n },\n {\n name: 'Elroy',\n formal: 'Mr. Patashnik',\n },\n {\n name: 'Garrett',\n formal: 'Mr. Lambert',\n },\n {\n name: 'Ian',\n formal: 'Mr. Duncan',\n },\n {\n name: 'Jeff',\n formal: 'Mr. Winger',\n },\n {\n name: 'Leonard',\n formal: 'Mr. Rodriguez',\n },\n {\n name: 'Neil',\n formal: 'Mr. Neil',\n },\n {\n name: 'Pierce',\n formal: 'Mr. Hawthorne',\n },\n {\n name: 'Preston',\n formal: 'Mr. Koogler',\n },\n {\n name: 'Rachel',\n formal: 'Ms. Rachel',\n },\n {\n name: 'Shirley',\n formal: 'Ms. Bennett',\n },\n {\n name: 'Todd',\n formal: 'Mr. Jacobson',\n },\n {\n name: 'Troy',\n formal: 'Mr. Barnes',\n },\n {\n name: 'Vaughn',\n formal: 'Mr. Miller',\n },\n {\n name: 'Vicki',\n formal: 'Ms. Jenkins',\n },\n ];\n\n constructor(formBuilder: FormBuilder, modalService: SkyModalService) {\n this.favoritesForm = formBuilder.group({\n favoriteNames: [[this.people[15]]],\n });\n\n this.searchFilters = [\n (_, item) => {\n const names = this.favoritesForm.value.favoriteNames;\n\n // Only show people in the search results that have not been chosen already.\n return !names.some((option) => option.name === item.name);\n },\n ];\n\n this.showMoreConfig = {\n customPicker: {\n open: (context) => {\n const instance = modalService.open(\n LookupCustomPickerDemoModalComponent,\n {\n providers: [\n {\n provide: SkyLookupShowMoreCustomPickerContext,\n useValue: context,\n },\n ],\n size: 'large',\n }\n );\n\n instance.closed.subscribe((closeArgs) => {\n if (closeArgs.reason === 'save') {\n this.favoritesForm.controls.favoriteNames.setValue(\n closeArgs.data\n );\n }\n });\n },\n },\n };\n }\n\n public ngOnInit(): void {\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.favoritesForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n }\n\n public onAddButtonClicked(): void {\n alert('Add button clicked!');\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.favoritesForm.value));\n }\n}\n"
10656
+ },
10657
+ {
10658
+ "fileName": "lookup-custom-picker-demo.module.ts",
10659
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-demo.module.ts",
10660
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport {\n SkyCheckboxModule,\n SkyInputBoxModule,\n SkySelectionBoxModule,\n} from '@skyux/forms';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyLookupModule } from '@skyux/lookup';\nimport { SkyModalModule } from '@skyux/modals';\n\nimport { LookupCustomPickerDemoModalComponent } from './lookup-custom-picker-demo-modal.component';\nimport { LookupCustomPickerDemoComponent } from './lookup-custom-picker-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyCheckboxModule,\n SkyIconModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyLookupModule,\n SkyModalModule,\n SkySelectionBoxModule,\n ],\n declarations: [\n LookupCustomPickerDemoComponent,\n LookupCustomPickerDemoModalComponent,\n ],\n exports: [LookupCustomPickerDemoComponent],\n})\nexport class LookupCustomPickerDemoModule {}\n"
10661
+ },
10662
+ {
10663
+ "fileName": "lookup-custom-picker-harness.ts",
10664
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-custom-picker-harness.ts",
10665
+ "rawContents": "import { ComponentHarness } from '@angular/cdk/testing';\nimport { SkyCheckboxHarness } from '@skyux/forms/testing';\n\nexport class LookupCustomPickerHarness extends ComponentHarness {\n public static hostSelector = '.lookup-custom-picker-modal';\n\n #getCheckboxes = this.locatorForAll(SkyCheckboxHarness);\n #getSaveButton = this.locatorFor('.lookup-custom-picker-save-button');\n\n public async checkItemAt(index: number): Promise<void> {\n return (await this.#getCheckboxes())[index].check();\n }\n\n public async uncheckItemAt(index: number): Promise<void> {\n return (await this.#getCheckboxes())[index].uncheck();\n }\n\n public async save(): Promise<void> {\n return (await this.#getSaveButton()).click();\n }\n}\n"
10666
+ },
10667
+ {
10668
+ "fileName": "lookup-demo-person.ts",
10669
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/custom-picker/lookup-demo-person.ts",
10670
+ "rawContents": "export interface LookupDemoPerson {\n name: string;\n formal?: string;\n}\n"
10671
+ },
10672
+ {
10673
+ "fileName": "lookup-demo-person.ts",
10674
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-demo-person.ts",
10675
+ "rawContents": "export interface LookupDemoPerson {\n name: string;\n}\n"
10676
+ },
10677
+ {
10678
+ "fileName": "lookup-multiple-demo.component.html",
10679
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-multiple-demo.component.html",
10680
+ "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"favoritesForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box data-sky-id=\"favorite-names-field\">\n <label class=\"sky-control-label\" skyId #favoriteNamesLabel=\"skyId\">\n Favorite names\n </label>\n <sky-lookup\n formControlName=\"favoriteNames\"\n (addClick)=\"onAddButtonClicked()\"\n [ariaLabelledBy]=\"favoriteNamesLabel.id\"\n [data]=\"people\"\n [enableShowMore]=\"true\"\n [searchFilters]=\"searchFilters\"\n [showAddButton]=\"true\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ favoritesForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n"
10681
+ },
10682
+ {
10683
+ "fileName": "lookup-multiple-demo.component.scss",
10684
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-multiple-demo.component.scss",
10685
+ "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
10686
+ },
10687
+ {
10688
+ "fileName": "lookup-multiple-demo.component.spec.ts",
10689
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-multiple-demo.component.spec.ts",
10690
+ "rawContents": "import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';\nimport { TestBed } from '@angular/core/testing';\nimport { NoopAnimationsModule } from '@angular/platform-browser/animations';\nimport { SkyInputBoxHarness } from '@skyux/forms/testing';\nimport { SkyLookupHarness } from '@skyux/lookup/testing';\n\nimport { LookupMultipleSelectDemoComponent } from './lookup-multiple-demo.component';\nimport { LookupMultipleSelectDemoModule } from './lookup-multiple-demo.module';\n\ndescribe('Lookup multi-select demo', () => {\n async function setupTest() {\n const fixture = TestBed.createComponent(LookupMultipleSelectDemoComponent);\n const loader = TestbedHarnessEnvironment.loader(fixture);\n\n const lookupHarness = await (\n await loader.getHarness(\n SkyInputBoxHarness.with({ dataSkyId: 'favorite-names-field' })\n )\n ).queryHarness(SkyLookupHarness);\n\n return { lookupHarness, fixture };\n }\n\n beforeEach(() => {\n TestBed.configureTestingModule({\n imports: [LookupMultipleSelectDemoModule, NoopAnimationsModule],\n });\n });\n\n it('should set the expected initial value', async () => {\n const { lookupHarness } = await setupTest();\n\n await expectAsync(lookupHarness.getSelectionsText()).toBeResolvedTo([\n 'Shirley',\n ]);\n });\n\n it('should update the form control when a favorite name is selected', async () => {\n const { lookupHarness, fixture } = await setupTest();\n\n await lookupHarness.enterText('vick');\n await lookupHarness.selectSearchResult({\n text: 'Vicki',\n });\n\n expect(\n fixture.componentInstance.favoritesForm.controls.favoriteNames.value\n ).toEqual([{ name: 'Shirley' }, { name: 'Vicki' }]);\n });\n});\n"
10691
+ },
10692
+ {
10693
+ "fileName": "lookup-multiple-demo.component.ts",
10694
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-multiple-demo.component.ts",
10695
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport { SkyAutocompleteSearchFunctionFilter } from '@skyux/lookup';\n\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-lookup-demo',\n templateUrl: './lookup-multiple-demo.component.html',\n styleUrls: ['./lookup-multiple-demo.component.scss'],\n})\nexport class LookupMultipleSelectDemoComponent implements OnInit {\n public favoritesForm: FormGroup<{\n favoriteNames: FormControl<LookupDemoPerson[]>;\n }>;\n\n public searchFilters: SkyAutocompleteSearchFunctionFilter[];\n\n public people: LookupDemoPerson[] = [\n { name: 'Abed' },\n { name: 'Alex' },\n { name: 'Ben' },\n { name: 'Britta' },\n { name: 'Buzz' },\n { name: 'Craig' },\n { name: 'Elroy' },\n { name: 'Garrett' },\n { name: 'Ian' },\n { name: 'Jeff' },\n { name: 'Leonard' },\n { name: 'Neil' },\n { name: 'Pierce' },\n { name: 'Preston' },\n { name: 'Rachel' },\n { name: 'Shirley' },\n { name: 'Todd' },\n { name: 'Troy' },\n { name: 'Vaughn' },\n { name: 'Vicki' },\n ];\n\n constructor(formBuilder: FormBuilder) {\n this.favoritesForm = formBuilder.group({\n favoriteNames: [[this.people[15]]],\n });\n }\n\n public ngOnInit(): void {\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.favoritesForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n\n this.searchFilters = [\n (_, item, args) => {\n // When in the modal view, show all people in the search results, regardless if they have been chosen already.\n if (args.context === 'modal') {\n return true;\n }\n\n const names = this.favoritesForm.value.favoriteNames;\n\n // When in the popover view (or in any other view), show people in the search results that have not been chosen already.\n return !names.some((option) => option.name === item.name);\n },\n ];\n }\n\n public onAddButtonClicked(): void {\n alert('Add button clicked!');\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.favoritesForm.value));\n }\n}\n"
10696
+ },
10697
+ {
10698
+ "fileName": "lookup-multiple-demo.module.ts",
10699
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/multi-select/lookup-multiple-demo.module.ts",
10700
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyLookupModule } from '@skyux/lookup';\n\nimport { LookupMultipleSelectDemoComponent } from './lookup-multiple-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyLookupModule,\n ],\n declarations: [LookupMultipleSelectDemoComponent],\n exports: [LookupMultipleSelectDemoComponent],\n})\nexport class LookupMultipleSelectDemoModule {}\n"
10701
+ },
10702
+ {
10703
+ "fileName": "lookup-demo-person.ts",
10704
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-demo-person.ts",
10705
+ "rawContents": "export interface LookupDemoPerson {\n name: string;\n formal?: string;\n}\n"
10706
+ },
10707
+ {
10708
+ "fileName": "lookup-result-templates-demo.component.html",
10709
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-demo.component.html",
10710
+ "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"favoritesForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box data-sky-id=\"favorite-names-field\">\n <label class=\"sky-control-label\" skyId #favoriteNamesLabel=\"skyId\">\n Favorite names\n </label>\n <sky-lookup\n formControlName=\"favoriteNames\"\n (addClick)=\"onAddButtonClicked()\"\n [ariaLabelledBy]=\"favoriteNamesLabel.id\"\n [data]=\"people\"\n [enableShowMore]=\"true\"\n [searchFilters]=\"searchFilters\"\n [searchResultTemplate]=\"dropdownItemTemplate\"\n [showAddButton]=\"true\"\n [showMoreConfig]=\"showMoreConfig\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ favoritesForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n\n<ng-template let-item=\"item\" #dropdownItemTemplate>\n <span class=\"lookup-demo-template-item\">\n <strong class=\"lookup-demo-template-name\">{{ item.name }}</strong\n ><br />\n <span class=\"lookup-demo-template-formal-name\">\n {{ item.formal }}\n </span>\n </span>\n</ng-template>\n<ng-template let-item=\"item\" #modalItemTemplate>\n <span class=\"lookup-demo-template-item\">\n <span class=\"lookup-demo-template-name\">{{ item.name }}</span\n ><br />\n <i class=\"lookup-demo-template-formal-name\">{{ item.formal }}</i>\n </span>\n</ng-template>\n"
10711
+ },
10712
+ {
10713
+ "fileName": "lookup-result-templates-demo.component.scss",
10714
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-demo.component.scss",
10715
+ "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
10716
+ },
10717
+ {
10718
+ "fileName": "lookup-result-templates-demo.component.spec.ts",
10719
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-demo.component.spec.ts",
10720
+ "rawContents": "import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';\nimport { TestBed } from '@angular/core/testing';\nimport { NoopAnimationsModule } from '@angular/platform-browser/animations';\nimport { SkyInputBoxHarness } from '@skyux/forms/testing';\nimport { SkyLookupHarness } from '@skyux/lookup/testing';\n\nimport { LookupResultTemplatesDemoComponent } from './lookup-result-templates-demo.component';\nimport { LookupResultTemplatesDemoModule } from './lookup-result-templates-demo.module';\nimport { LookupResultTemplatesItemHarness } from './lookup-result-templates-item-harness';\n\ndescribe('Lookup result templates demo', () => {\n async function setupTest() {\n const fixture = TestBed.createComponent(LookupResultTemplatesDemoComponent);\n const loader = TestbedHarnessEnvironment.loader(fixture);\n\n const lookupHarness = await (\n await loader.getHarness(\n SkyInputBoxHarness.with({ dataSkyId: 'favorite-names-field' })\n )\n ).queryHarness(SkyLookupHarness);\n\n return { lookupHarness, fixture };\n }\n\n beforeEach(() => {\n TestBed.configureTestingModule({\n imports: [LookupResultTemplatesDemoModule, NoopAnimationsModule],\n });\n });\n\n it('should set the expected initial value', async () => {\n const { lookupHarness } = await setupTest();\n\n await expectAsync(lookupHarness.getSelectionsText()).toBeResolvedTo([\n 'Shirley',\n ]);\n });\n\n it('should use the expected dropdown item template', async () => {\n const { lookupHarness } = await setupTest();\n\n await lookupHarness.enterText('vick');\n\n const results = await lookupHarness.getSearchResults();\n const templateItemHarness = await results[0].queryHarness(\n LookupResultTemplatesItemHarness\n );\n\n await expectAsync(templateItemHarness.getName()).toBeResolvedTo('Vicki');\n await expectAsync(templateItemHarness.getFormalName()).toBeResolvedTo(\n 'Ms. Jenkins'\n );\n });\n\n it('should use the expected modal item template', async () => {\n const { lookupHarness } = await setupTest();\n\n await lookupHarness.clickShowMoreButton();\n\n const pickerHarness = await lookupHarness.getShowMorePicker();\n await pickerHarness.enterSearchText('vick');\n\n const results = await pickerHarness.getSearchResults();\n const templateItemHarness = await results[0].queryHarness(\n LookupResultTemplatesItemHarness\n );\n\n await expectAsync(templateItemHarness.getName()).toBeResolvedTo('Vicki');\n await expectAsync(templateItemHarness.getFormalName()).toBeResolvedTo(\n 'Ms. Jenkins'\n );\n });\n\n it('should update the form control when a favorite name is selected', async () => {\n const { lookupHarness, fixture } = await setupTest();\n\n await lookupHarness.enterText('vick');\n\n const firstResultHarness = (await lookupHarness.getSearchResults())[0];\n await firstResultHarness.select();\n\n expect(\n fixture.componentInstance.favoritesForm.controls.favoriteNames.value\n ).toEqual([\n { name: 'Shirley', formal: 'Ms. Bennett' },\n { name: 'Vicki', formal: 'Ms. Jenkins' },\n ]);\n });\n});\n"
10721
+ },
10722
+ {
10723
+ "fileName": "lookup-result-templates-demo.component.ts",
10724
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-demo.component.ts",
10725
+ "rawContents": "import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport {\n SkyAutocompleteSearchFunctionFilter,\n SkyLookupShowMoreConfig,\n} from '@skyux/lookup';\n\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-lookup-demo',\n templateUrl: './lookup-result-templates-demo.component.html',\n styleUrls: ['./lookup-result-templates-demo.component.scss'],\n})\nexport class LookupResultTemplatesDemoComponent implements OnInit {\n public favoritesForm: FormGroup<{\n favoriteNames: FormControl<LookupDemoPerson[]>;\n }>;\n\n public searchFilters: SkyAutocompleteSearchFunctionFilter[];\n\n public people: LookupDemoPerson[] = [\n {\n name: 'Abed',\n formal: 'Mr. Nadir',\n },\n {\n name: 'Alex',\n formal: 'Mr. Osbourne',\n },\n {\n name: 'Ben',\n formal: 'Mr. Chang',\n },\n {\n name: 'Britta',\n formal: 'Ms. Perry',\n },\n {\n name: 'Buzz',\n formal: 'Mr. Hickey',\n },\n {\n name: 'Craig',\n formal: 'Mr. Pelton',\n },\n {\n name: 'Elroy',\n formal: 'Mr. Patashnik',\n },\n {\n name: 'Garrett',\n formal: 'Mr. Lambert',\n },\n {\n name: 'Ian',\n formal: 'Mr. Duncan',\n },\n {\n name: 'Jeff',\n formal: 'Mr. Winger',\n },\n {\n name: 'Leonard',\n formal: 'Mr. Rodriguez',\n },\n {\n name: 'Neil',\n formal: 'Mr. Neil',\n },\n {\n name: 'Pierce',\n formal: 'Mr. Hawthorne',\n },\n {\n name: 'Preston',\n formal: 'Mr. Koogler',\n },\n {\n name: 'Rachel',\n formal: 'Ms. Rachel',\n },\n {\n name: 'Shirley',\n formal: 'Ms. Bennett',\n },\n {\n name: 'Todd',\n formal: 'Mr. Jacobson',\n },\n {\n name: 'Troy',\n formal: 'Mr. Barnes',\n },\n {\n name: 'Vaughn',\n formal: 'Mr. Miller',\n },\n {\n name: 'Vicki',\n formal: 'Ms. Jenkins',\n },\n ];\n\n public showMoreConfig: SkyLookupShowMoreConfig = {\n nativePickerConfig: {},\n };\n\n @ViewChild('modalItemTemplate')\n public set modalItemTemplate(template: TemplateRef<unknown>) {\n this.showMoreConfig.nativePickerConfig.itemTemplate = template;\n }\n\n constructor(formBuilder: FormBuilder) {\n this.favoritesForm = formBuilder.group({\n favoriteNames: [[this.people[15]]],\n });\n\n this.searchFilters = [\n (_, item) => {\n const names = this.favoritesForm.value.favoriteNames;\n\n // Only show people in the search results that have not been chosen already.\n return !names.some((option) => option.name === item.name);\n },\n ];\n }\n\n public ngOnInit(): void {\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.favoritesForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n }\n\n public onAddButtonClicked(): void {\n alert('Add button clicked!');\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.favoritesForm.value));\n }\n}\n"
10726
+ },
10727
+ {
10728
+ "fileName": "lookup-result-templates-demo.module.ts",
10729
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-demo.module.ts",
10730
+ "rawContents": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyIdModule } from '@skyux/core';\nimport { SkyInputBoxModule } from '@skyux/forms';\nimport { SkyLookupModule } from '@skyux/lookup';\n\nimport { LookupResultTemplatesDemoComponent } from './lookup-result-templates-demo.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n SkyIdModule,\n SkyInputBoxModule,\n SkyLookupModule,\n ],\n declarations: [LookupResultTemplatesDemoComponent],\n exports: [LookupResultTemplatesDemoComponent],\n})\nexport class LookupResultTemplatesDemoModule {}\n"
10731
+ },
10732
+ {
10733
+ "fileName": "lookup-result-templates-item-harness.ts",
10734
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/result-templates/lookup-result-templates-item-harness.ts",
10735
+ "rawContents": "import { ComponentHarness } from '@angular/cdk/testing';\n\n/**\n * Harness for interacting with a lookup component in tests.\n * @internal\n */\nexport class LookupResultTemplatesItemHarness extends ComponentHarness {\n public static hostSelector = '.lookup-demo-template-item';\n\n #getName = this.locatorFor('.lookup-demo-template-name');\n #getFormalName = this.locatorFor('.lookup-demo-template-formal-name');\n\n public async getName(): Promise<string> {\n return (await this.#getName()).text();\n }\n\n public async getFormalName(): Promise<string> {\n return (await this.#getFormalName()).text();\n }\n}\n"
10736
+ },
10737
+ {
10738
+ "fileName": "lookup-demo-person.ts",
10739
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/single-select/lookup-demo-person.ts",
10740
+ "rawContents": "export interface LookupDemoPerson {\n name: string;\n}\n"
10741
+ },
10742
+ {
10743
+ "fileName": "lookup-single-demo.component.html",
10744
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/single-select/lookup-single-demo.component.html",
10745
+ "rawContents": "<form\n class=\"lookup-demo-form\"\n novalidate\n [formGroup]=\"favoritesForm\"\n (ngSubmit)=\"onSubmit()\"\n>\n <div class=\"sky-form-group\">\n <sky-input-box data-sky-id=\"favorite-name-field\">\n <label class=\"sky-control-label\" skyId #favoriteNameLabel=\"skyId\">\n Favorite name\n </label>\n <sky-lookup\n formControlName=\"favoriteName\"\n selectMode=\"single\"\n (addClick)=\"onAddButtonClicked()\"\n [ariaLabelledBy]=\"favoriteNameLabel.id\"\n [data]=\"people\"\n [enableShowMore]=\"true\"\n [searchFilters]=\"searchFilters\"\n [showAddButton]=\"true\"\n >\n </sky-lookup>\n </sky-input-box>\n </div>\n <div class=\"lookup-demo-alert\">\n <strong>Form model:</strong>\n <pre>{{ favoritesForm.value | json }}</pre>\n </div>\n <button class=\"sky-btn sky-btn-default\" type=\"submit\">Submit</button>\n</form>\n"
10746
+ },
10747
+ {
10748
+ "fileName": "lookup-single-demo.component.scss",
10749
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/single-select/lookup-single-demo.component.scss",
10750
+ "rawContents": ".lookup-demo-alert {\n padding: 10px;\n margin-bottom: 10px;\n border: 1px solid #cdcfd2;\n border-radius: 3px;\n}\n\n.lookup-demo-alert pre {\n margin: 0;\n}\n"
10751
+ },
10752
+ {
10753
+ "fileName": "lookup-single-demo.component.spec.ts",
10754
+ "filePath": "/projects/lookup/documentation/code-examples/lookup/single-select/lookup-single-demo.component.spec.ts",
10755
+ "rawContents": "import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';\nimport { TestBed } from '@angular/core/testing';\nimport { NoopAnimationsModule } from '@angular/platform-browser/animations';\nimport { SkyInputBoxHarness } from '@skyux/forms/testing';\nimport { SkyLookupHarness } from '@skyux/lookup/testing';\n\nimport { LookupSingleSelectDemoComponent } from './lookup-single-demo.component';\nimport { LookupSingleSelectDemoModule } from './lookup-single-demo.module';\n\ndescribe('Lookup single select demo', () => {\n async function setupTest() {\n const fixture = TestBed.createComponent(LookupSingleSelectDemoComponent);\n const loader = TestbedHarnessEnvironment.loader(fixture);\n\n const lookupHarness = await (\n await loader.getHarness(\n SkyInputBoxHarness.with({ dataSkyId: 'favorite-name-field' })\n )\n ).queryHarness(SkyLookupHarness);\n\n return { lookupHarness, fixture };\n }\n\n beforeEach(() => {\n TestBed.configureTestingModule({\n imports: [LookupSingleSelectDemoModule, NoopAnimationsModule],\n });\n });\n\n it('should set the expected initial value', async () => {\n const { lookupHarness } = await setupTest();\n\n await expectAsync(lookupHarness.getValue()).toBeResolvedTo('Shirley');\n });\n\n it('should update the form control when a favorite name is selected', async () => {\n const { lookupHarness, fixture } = await setupTest();\n\n await lookupHarness.enterText('vick');\n await lookupHarness.selectSearchResult({\n text: 'Vicki',\n });\n\n expect(fixture.componentInstance.favoritesForm.value.favoriteName).toEqual([\n { name: 'Vicki' },\n ]);\n });\n});\n"
9629
10756
  },
9630
10757
  {
9631
10758
  "fileName": "lookup-single-demo.component.ts",
9632
10759
  "filePath": "/projects/lookup/documentation/code-examples/lookup/single-select/lookup-single-demo.component.ts",
9633
- "rawContents": "import { Component, OnInit } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport { SkyAutocompleteSearchFunctionFilter } from '@skyux/lookup';\n\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-single-select-lookup-demo',\n templateUrl: './lookup-single-demo.component.html',\n styleUrls: ['./lookup-single-demo.component.scss'],\n})\nexport class LookupSingleSelectDemoComponent implements OnInit {\n public myForm: UntypedFormGroup;\n\n public people: LookupDemoPerson[] = [\n { name: 'Abed' },\n { name: 'Alex' },\n { name: 'Ben' },\n { name: 'Britta' },\n { name: 'Buzz' },\n { name: 'Craig' },\n { name: 'Elroy' },\n { name: 'Garrett' },\n { name: 'Ian' },\n { name: 'Jeff' },\n { name: 'Leonard' },\n { name: 'Neil' },\n { name: 'Pierce' },\n { name: 'Preston' },\n { name: 'Rachel' },\n { name: 'Shirley' },\n { name: 'Todd' },\n { name: 'Troy' },\n { name: 'Vaughn' },\n { name: 'Vicki' },\n ];\n\n public name: LookupDemoPerson[] = [this.people[15]];\n\n constructor(private formBuilder: UntypedFormBuilder) {}\n\n public ngOnInit(): void {\n this.createForm();\n\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.myForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n }\n\n // Only show people in the search results that have not been chosen already.\n public getSearchFilters(): SkyAutocompleteSearchFunctionFilter[] {\n const name: LookupDemoPerson[] = this.myForm.controls.name.value;\n return [\n (searchText: string, item: LookupDemoPerson): boolean => {\n const found = name.find((option) => option.name === item.name);\n return !found;\n },\n ];\n }\n\n public onAddButtonClicked(): void {\n alert('Add button clicked!');\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.myForm.value));\n }\n\n private createForm(): void {\n this.myForm = this.formBuilder.group({\n name: new UntypedFormControl(this.name),\n });\n }\n}\n"
10760
+ "rawContents": "import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport { SkyAutocompleteSearchFunctionFilter } from '@skyux/lookup';\n\nimport { LookupDemoPerson } from './lookup-demo-person';\n\n@Component({\n selector: 'app-single-select-lookup-demo',\n templateUrl: './lookup-single-demo.component.html',\n styleUrls: ['./lookup-single-demo.component.scss'],\n})\nexport class LookupSingleSelectDemoComponent implements OnInit {\n public favoritesForm: FormGroup<{\n favoriteName: FormControl<LookupDemoPerson[]>;\n }>;\n\n public searchFilters: SkyAutocompleteSearchFunctionFilter[];\n\n public people: LookupDemoPerson[] = [\n { name: 'Abed' },\n { name: 'Alex' },\n { name: 'Ben' },\n { name: 'Britta' },\n { name: 'Buzz' },\n { name: 'Craig' },\n { name: 'Elroy' },\n { name: 'Garrett' },\n { name: 'Ian' },\n { name: 'Jeff' },\n { name: 'Leonard' },\n { name: 'Neil' },\n { name: 'Pierce' },\n { name: 'Preston' },\n { name: 'Rachel' },\n { name: 'Shirley' },\n { name: 'Todd' },\n { name: 'Troy' },\n { name: 'Vaughn' },\n { name: 'Vicki' },\n ];\n\n public name: LookupDemoPerson[] = [this.people[15]];\n\n constructor(formBuilder: FormBuilder) {\n this.favoritesForm = formBuilder.group({\n favoriteName: [[this.people[15]]],\n });\n\n this.searchFilters = [\n (_, item) => {\n const names = this.favoritesForm.value.favoriteName;\n\n // Only show people in the search results that have not been chosen already.\n return !names.some((option) => option.name === item.name);\n },\n ];\n }\n\n public ngOnInit(): void {\n // If you need to execute some logic after the lookup values change,\n // subscribe to Angular's built-in value changes observable.\n this.favoritesForm.valueChanges.subscribe((changes) => {\n console.log('Lookup value changes:', changes);\n });\n }\n\n public onAddButtonClicked(): void {\n alert('Add button clicked!');\n }\n\n public onSubmit(): void {\n alert('Form submitted with: ' + JSON.stringify(this.favoritesForm.value));\n }\n}\n"
9634
10761
  },
9635
10762
  {
9636
10763
  "fileName": "lookup-single-demo.module.ts",