novo-elements 13.1.0-next.1 → 13.1.0-next.3

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.
@@ -11,8 +11,10 @@ import { NovoToastService, ToastOptions } from 'novo-elements/elements/toast';
11
11
  import { BooleanInput } from '@angular/cdk/coercion';
12
12
  import * as i5 from '@angular/forms';
13
13
  import { UntypedFormGroup, FormBuilder, FormControl, ControlValueAccessor, NgForm, FormGroupDirective, NgControl, FormGroup } from '@angular/forms';
14
- import * as i29 from 'novo-elements/elements/common';
15
- import { NovoTemplate, CanUpdateErrorStateCtor, ErrorStateMatcher } from 'novo-elements/elements/common';
14
+ import * as i17 from 'novo-elements/elements/common';
15
+ import { NovoTemplate, NovoOverlayTemplateComponent, CanUpdateErrorStateCtor, ErrorStateMatcher } from 'novo-elements/elements/common';
16
+ import * as i16 from 'novo-elements/elements/places';
17
+ import { PlacesSettings, PlacesListComponent } from 'novo-elements/elements/places';
16
18
  import { FocusKeyManager } from '@angular/cdk/a11y';
17
19
  import * as i13 from '@angular/cdk/drag-drop';
18
20
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
@@ -32,8 +34,8 @@ import * as i10$1 from 'novo-elements/elements/radio';
32
34
  import * as i11$1 from 'novo-elements/elements/tiles';
33
35
  import * as i14$1 from 'novo-elements/elements/chips';
34
36
  import * as i15$1 from 'novo-elements/elements/date-picker';
35
- import * as i16 from 'novo-elements/elements/time-picker';
36
- import * as i17 from 'novo-elements/elements/date-time-picker';
37
+ import * as i16$1 from 'novo-elements/elements/time-picker';
38
+ import * as i17$1 from 'novo-elements/elements/date-time-picker';
37
39
  import * as i18 from 'novo-elements/addons/ckeditor';
38
40
  import * as i20 from 'novo-elements/elements/quick-note';
39
41
  import * as i21 from 'novo-elements/elements/header';
@@ -989,6 +991,31 @@ declare class NovoDynamicFormElement implements OnChanges, OnInit, AfterContentI
989
991
  static ɵcmp: i0.ɵɵComponentDeclaration<NovoDynamicFormElement, "novo-dynamic-form", never, { "controls": { "alias": "controls"; "required": false; }; "fieldsets": { "alias": "fieldsets"; "required": false; }; "form": { "alias": "form"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "hideNonRequiredFields": { "alias": "hideNonRequiredFields"; "required": false; }; "autoFocusFirstField": { "alias": "autoFocusFirstField"; "required": false; }; }, {}, ["customTemplates"], ["form-title", "form-subtitle"], false, never>;
990
992
  }
991
993
 
994
+ interface AddressLookupResult {
995
+ address1?: string;
996
+ address2?: string;
997
+ city?: string;
998
+ state?: string;
999
+ zip?: string;
1000
+ countryName?: string;
1001
+ countryCode?: string;
1002
+ formattedAddress?: string;
1003
+ location?: {
1004
+ latitude: number;
1005
+ longitude: number;
1006
+ };
1007
+ viewport?: {
1008
+ northeast: {
1009
+ latitude: number;
1010
+ longitude: number;
1011
+ };
1012
+ southwest: {
1013
+ latitude: number;
1014
+ longitude: number;
1015
+ };
1016
+ };
1017
+ placeId?: string;
1018
+ }
992
1019
  interface NovoAddressSubfieldConfig {
993
1020
  label: string;
994
1021
  required: boolean;
@@ -1008,18 +1035,19 @@ interface NovoAddressConfig {
1008
1035
  zip?: NovoAddressSubfieldConfig;
1009
1036
  countryID?: NovoAddressSubfieldConfig;
1010
1037
  }
1011
- declare class NovoAddressElement implements ControlValueAccessor, OnInit, DoCheck {
1038
+ declare class NovoAddressElement implements ControlValueAccessor, OnInit, DoCheck, OnDestroy {
1012
1039
  labels: NovoLabelService;
1040
+ addressConfig: PlacesSettings;
1013
1041
  config: NovoAddressConfig;
1014
- private _readOnly;
1015
- set readOnly(readOnly: boolean);
1016
- get readOnly(): boolean;
1017
- private previousRequiredState;
1042
+ address1ElRef: ElementRef;
1043
+ overlay: NovoOverlayTemplateComponent;
1044
+ placesList: PlacesListComponent;
1045
+ debouncedSearch: string;
1046
+ private searchTerms$;
1047
+ private searchSubscription;
1018
1048
  states: Array<any>;
1019
1049
  fieldList: Array<string>;
1020
1050
  model: any;
1021
- onModelChange: Function;
1022
- onModelTouched: Function;
1023
1051
  focused: any;
1024
1052
  invalid: any;
1025
1053
  disabled: any;
@@ -1032,8 +1060,15 @@ declare class NovoAddressElement implements ControlValueAccessor, OnInit, DoChec
1032
1060
  focus: EventEmitter<any>;
1033
1061
  blur: EventEmitter<any>;
1034
1062
  validityChange: EventEmitter<any>;
1035
- constructor(labels: NovoLabelService);
1063
+ private previousRequiredState;
1064
+ constructor(labels: NovoLabelService, addressConfig: PlacesSettings);
1065
+ private _readOnly;
1066
+ get readOnly(): boolean;
1067
+ set readOnly(readOnly: boolean);
1068
+ onModelChange: Function;
1069
+ onModelTouched: Function;
1036
1070
  ngOnInit(): void;
1071
+ ngOnDestroy(): void;
1037
1072
  initConfig(): void;
1038
1073
  ngDoCheck(): void;
1039
1074
  isValid(field: string): void;
@@ -1043,6 +1078,14 @@ declare class NovoAddressElement implements ControlValueAccessor, OnInit, DoChec
1043
1078
  isBlurred(event: Event, field: string): void;
1044
1079
  onCountryChange(evt: any): void;
1045
1080
  onStateChange(evt: any): void;
1081
+ onAddress1Input(event: Event): void;
1082
+ onMatchesUpdated(matches: any[]): void;
1083
+ onAddress1Keydown(event: KeyboardEvent): void;
1084
+ onPlaceSelected(placeDetail: AddressLookupResult & {
1085
+ address_components?: any[];
1086
+ formatted_address?: string;
1087
+ }): void;
1088
+ private parseGooglePlaceDetail;
1046
1089
  setStateLabel(model: any): void;
1047
1090
  updateStates(): void;
1048
1091
  getStateOptions(filter: string, countryID: number): string[];
@@ -1052,7 +1095,7 @@ declare class NovoAddressElement implements ControlValueAccessor, OnInit, DoChec
1052
1095
  registerOnTouched(fn: Function): void;
1053
1096
  private getDefaultStateConfig;
1054
1097
  private getDefaultCountryConfig;
1055
- static ɵfac: i0.ɵɵFactoryDeclaration<NovoAddressElement, never>;
1098
+ static ɵfac: i0.ɵɵFactoryDeclaration<NovoAddressElement, [null, { optional: true; }]>;
1056
1099
  static ɵcmp: i0.ɵɵComponentDeclaration<NovoAddressElement, "novo-address", never, { "config": { "alias": "config"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; }, { "change": "change"; "focus": "focus"; "blur": "blur"; "validityChange": "validityChange"; }, never, never, false, never>;
1057
1100
  }
1058
1101
 
@@ -1230,7 +1273,7 @@ declare class NumberRangeComponent implements OnInit, OnDestroy, ControlValueAcc
1230
1273
 
1231
1274
  declare class NovoFormExtrasModule {
1232
1275
  static ɵfac: i0.ɵɵFactoryDeclaration<NovoFormExtrasModule, never>;
1233
- static ɵmod: i0.ɵɵNgModuleDeclaration<NovoFormExtrasModule, [typeof NovoAddressElement, typeof NovoFileInputElement, typeof NumberRangeComponent], [typeof i4.CommonModule, typeof i5.FormsModule, typeof i6.NovoPipesModule, typeof i7.NovoButtonModule, typeof i8.NovoSelectModule, typeof i9.NovoPickerModule, typeof i10.NovoLoadingModule, typeof i11.NovoTooltipModule, typeof i12.NovoCheckboxModule, typeof i13.DragDropModule, typeof i14.NovoFlexModule, typeof i15.NovoFieldModule, typeof i5.ReactiveFormsModule], [typeof NovoAddressElement, typeof NovoFileInputElement, typeof NumberRangeComponent]>;
1276
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NovoFormExtrasModule, [typeof NovoAddressElement, typeof NovoFileInputElement, typeof NumberRangeComponent], [typeof i4.CommonModule, typeof i5.FormsModule, typeof i6.NovoPipesModule, typeof i7.NovoButtonModule, typeof i8.NovoSelectModule, typeof i9.NovoPickerModule, typeof i10.NovoLoadingModule, typeof i11.NovoTooltipModule, typeof i12.NovoCheckboxModule, typeof i13.DragDropModule, typeof i14.NovoFlexModule, typeof i15.NovoFieldModule, typeof i5.ReactiveFormsModule, typeof i16.GooglePlacesModule, typeof i17.NovoOverlayModule], [typeof NovoAddressElement, typeof NovoFileInputElement, typeof NumberRangeComponent]>;
1234
1277
  static ɵinj: i0.ɵɵInjectorDeclaration<NovoFormExtrasModule>;
1235
1278
  }
1236
1279
 
@@ -1275,7 +1318,7 @@ declare class NovoFormElement implements AfterContentInit, OnInit {
1275
1318
 
1276
1319
  declare class NovoFormModule {
1277
1320
  static ɵfac: i0.ɵɵFactoryDeclaration<NovoFormModule, never>;
1278
- static ɵmod: i0.ɵɵNgModuleDeclaration<NovoFormModule, [typeof NovoAutoSize, typeof NovoControlElement, typeof NovoDynamicFormElement, typeof NovoFormElement, typeof NovoFieldsetElement, typeof NovoFieldsetHeaderElement, typeof ControlConfirmModal, typeof ControlPromptModal, typeof NovoControlGroup, typeof NovoControlTemplates], [typeof i4.CommonModule, typeof i8$1.OverlayModule, typeof i5.ReactiveFormsModule, typeof i10$1.NovoRadioModule, typeof i11$1.NovoTilesModule, typeof i8.NovoSelectModule, typeof i9.NovoPickerModule, typeof i14$1.NovoChipsModule, typeof i15$1.NovoDatePickerModule, typeof i16.NovoTimePickerModule, typeof i17.NovoDateTimePickerModule, typeof i18.NovoNovoCKEditorModule, typeof NovoFormExtrasModule, typeof i20.NovoQuickNoteModule, typeof i17.NovoDateTimePickerModule, typeof i21.NovoHeaderModule, typeof i11.NovoTooltipModule, typeof i23.NovoPopOverModule, typeof i24.IMaskModule, typeof i25.NovoTipWellModule, typeof i26.NovoModalModule, typeof i7.NovoButtonModule, typeof i28.NovoCodeEditorModule, typeof i29.NovoCommonModule, typeof i12.NovoCheckboxModule, typeof i31.NovoIconModule, typeof i10$1.NovoRadioModule, typeof i32.NovoSwitchModule], [typeof NovoAutoSize, typeof NovoDynamicFormElement, typeof NovoControlElement, typeof NovoFormElement, typeof NovoFieldsetHeaderElement, typeof NovoControlGroup, typeof NovoControlTemplates]>;
1321
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NovoFormModule, [typeof NovoAutoSize, typeof NovoControlElement, typeof NovoDynamicFormElement, typeof NovoFormElement, typeof NovoFieldsetElement, typeof NovoFieldsetHeaderElement, typeof ControlConfirmModal, typeof ControlPromptModal, typeof NovoControlGroup, typeof NovoControlTemplates], [typeof i4.CommonModule, typeof i8$1.OverlayModule, typeof i5.ReactiveFormsModule, typeof i10$1.NovoRadioModule, typeof i11$1.NovoTilesModule, typeof i8.NovoSelectModule, typeof i9.NovoPickerModule, typeof i14$1.NovoChipsModule, typeof i15$1.NovoDatePickerModule, typeof i16$1.NovoTimePickerModule, typeof i17$1.NovoDateTimePickerModule, typeof i18.NovoNovoCKEditorModule, typeof NovoFormExtrasModule, typeof i20.NovoQuickNoteModule, typeof i17$1.NovoDateTimePickerModule, typeof i21.NovoHeaderModule, typeof i11.NovoTooltipModule, typeof i23.NovoPopOverModule, typeof i24.IMaskModule, typeof i25.NovoTipWellModule, typeof i26.NovoModalModule, typeof i7.NovoButtonModule, typeof i28.NovoCodeEditorModule, typeof i17.NovoCommonModule, typeof i12.NovoCheckboxModule, typeof i31.NovoIconModule, typeof i10$1.NovoRadioModule, typeof i32.NovoSwitchModule], [typeof NovoAutoSize, typeof NovoDynamicFormElement, typeof NovoControlElement, typeof NovoFormElement, typeof NovoFieldsetHeaderElement, typeof NovoControlGroup, typeof NovoControlTemplates]>;
1279
1322
  static ɵinj: i0.ɵɵInjectorDeclaration<NovoFormModule>;
1280
1323
  }
1281
1324
 
@@ -1303,4 +1346,4 @@ declare class FormValidators {
1303
1346
  }
1304
1347
 
1305
1348
  export { AddressControl, BaseControl, CheckListControl, CheckboxControl, CodeEditorControl, ControlConfirmModal, ControlFactory, ControlPromptModal, CustomControl, DateControl, DateTimeControl, EditState, EditorControl, FieldInteractionApi, FileControl, FormUtils, FormValidators, GroupedControl, NativeSelectControl, NovoAddressElement, NovoAutoSize, NovoControlElement, NovoControlGroup, NovoControlTemplates, NovoDynamicFormElement, NovoFieldsetElement, NovoFieldsetHeaderElement, NovoFile, NovoFileInputElement, NovoFormControl, NovoFormElement, NovoFormExtrasModule, NovoFormGroup, NovoFormModule, NumberRangeComponent, PickerControl, QuickNoteControl, RadioControl, ReadOnlyControl, SelectControl, SwitchControl, TablePickerControl, TextAreaControl, TextBoxControl, TilesControl, TimeControl, TimezoneControl };
1306
- export type { CustomHttp, FormField, IFieldInteractionEvent, IMaskOptions, ModifyPickerConfigArgs, NovoAddressConfig, NovoAddressSubfieldConfig, NovoControlConfig, NovoControlGroupAddConfig, NovoControlGroupRowConfig, NovoFieldset, NovoGroupedControlConfig, OptionsFunction, ResultsTemplateType };
1349
+ export type { AddressLookupResult, CustomHttp, FormField, IFieldInteractionEvent, IMaskOptions, ModifyPickerConfigArgs, NovoAddressConfig, NovoAddressSubfieldConfig, NovoControlConfig, NovoControlGroupAddConfig, NovoControlGroupRowConfig, NovoFieldset, NovoGroupedControlConfig, OptionsFunction, ResultsTemplateType };
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, OnChanges, EventEmitter, ElementRef, ChangeDetectorRef } from '@angular/core';
2
+ import { OnInit, OnChanges, EventEmitter, ElementRef, ChangeDetectorRef, InjectionToken } from '@angular/core';
3
3
  import * as i3 from '@angular/forms';
4
4
  import { ControlValueAccessor } from '@angular/forms';
5
5
  import { BasePickerResults } from 'novo-elements/elements/picker';
@@ -32,7 +32,7 @@ declare class GooglePlacesService {
32
32
  static ɵprov: i0.ɵɵInjectableDeclaration<GooglePlacesService>;
33
33
  }
34
34
 
35
- interface Settings {
35
+ interface PlacesSettings {
36
36
  geoPredictionServerUrl?: string;
37
37
  geoLatLangServiceUrl?: string;
38
38
  geoLocDetailServerUrl?: string;
@@ -56,22 +56,33 @@ interface Settings {
56
56
  searchIconUrl?: string;
57
57
  locationIconUrl?: string;
58
58
  }
59
+ /** Normalized address prediction; raw provider records are mapped into this via normalizePrediction. */
60
+ interface AddressLookupPrediction {
61
+ placeId?: string;
62
+ primaryText?: string;
63
+ secondaryText?: string;
64
+ displayAddress?: string;
65
+ types?: string[];
66
+ /** Original provider record, retained so recent-search selection re-emits full detail. */
67
+ raw?: any;
68
+ }
59
69
  declare class PlacesListComponent extends BasePickerResults implements OnInit, OnChanges, ControlValueAccessor {
60
70
  private platformId;
61
71
  private _elmRef;
62
72
  private _global;
63
73
  private _googlePlacesService;
64
74
  private cdr;
65
- userSettings: Settings;
75
+ userSettings: PlacesSettings;
66
76
  termChange: EventEmitter<any>;
67
77
  select: EventEmitter<any>;
78
+ matchesUpdated: EventEmitter<AddressLookupPrediction[]>;
68
79
  locationInput: string;
69
80
  gettingCurrentLocationFlag: boolean;
70
81
  dropdownOpen: boolean;
71
82
  recentDropdownOpen: boolean;
72
83
  isSettingsError: boolean;
73
84
  settingsErrorMsg: string;
74
- settings: Settings;
85
+ settings: PlacesSettings;
75
86
  private moduleinit;
76
87
  private selectedDataIndex;
77
88
  private recentSearchData;
@@ -90,7 +101,7 @@ declare class PlacesListComponent extends BasePickerResults implements OnInit, O
90
101
  searchinputCallback(event: any): any;
91
102
  activeListNode(index: number): any;
92
103
  selectedListNode(event: MouseEvent, index: number): any;
93
- selectMatch(match: any): any;
104
+ selectMatch(match: AddressLookupPrediction): any;
94
105
  closeAutocomplete(event: any): any;
95
106
  userQuerySubmit(selectedOption?: any): any;
96
107
  currentLocationSelected(): any;
@@ -105,10 +116,11 @@ declare class PlacesListComponent extends BasePickerResults implements OnInit, O
105
116
  private getPlaceLocationInfo;
106
117
  private setRecentLocation;
107
118
  private getRecentLocations;
119
+ normalizePrediction(raw: any): AddressLookupPrediction;
108
120
  onKeyDown(event: KeyboardEvent): void;
109
121
  search(term: any, mode?: any): Observable<any>;
110
122
  static ɵfac: i0.ɵɵFactoryDeclaration<PlacesListComponent, never>;
111
- static ɵcmp: i0.ɵɵComponentDeclaration<PlacesListComponent, "google-places-list", never, { "userSettings": { "alias": "userSettings"; "required": false; }; }, { "termChange": "termChange"; "select": "select"; }, never, never, false, never>;
123
+ static ɵcmp: i0.ɵɵComponentDeclaration<PlacesListComponent, "google-places-list", never, { "userSettings": { "alias": "userSettings"; "required": false; }; }, { "termChange": "termChange"; "select": "select"; "matchesUpdated": "matchesUpdated"; }, never, never, false, never>;
112
124
  }
113
125
 
114
126
  declare class GooglePlacesModule {
@@ -117,5 +129,8 @@ declare class GooglePlacesModule {
117
129
  static ɵinj: i0.ɵɵInjectorDeclaration<GooglePlacesModule>;
118
130
  }
119
131
 
120
- export { GooglePlacesModule, GooglePlacesService, PlacesListComponent };
121
- export type { Settings };
132
+ /** App-wide address-lookup config; when provided, every novo-address enables autocomplete on Address 1. */
133
+ declare const NOVO_ADDRESS_CONFIG: InjectionToken<PlacesSettings>;
134
+
135
+ export { GooglePlacesModule, GooglePlacesService, NOVO_ADDRESS_CONFIG, PlacesListComponent };
136
+ export type { AddressLookupPrediction, PlacesSettings };