ngx-bootstrap 11.0.1 → 12.0.0
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.
- package/accordion/esm2022/accordion-group.component.mjs +6 -6
- package/accordion/esm2022/accordion.component.mjs +5 -5
- package/accordion/esm2022/accordion.config.mjs +3 -3
- package/accordion/esm2022/accordion.module.mjs +4 -4
- package/accordion/fesm2022/ngx-bootstrap-accordion.mjs +16 -16
- package/accordion/fesm2022/ngx-bootstrap-accordion.mjs.map +1 -1
- package/alert/esm2022/alert.component.mjs +5 -5
- package/alert/esm2022/alert.config.mjs +3 -3
- package/alert/esm2022/alert.module.mjs +4 -4
- package/alert/fesm2022/ngx-bootstrap-alert.mjs +12 -12
- package/alert/fesm2022/ngx-bootstrap-alert.mjs.map +1 -1
- package/buttons/esm2022/button-checkbox.directive.mjs +3 -3
- package/buttons/esm2022/button-radio-group.directive.mjs +5 -5
- package/buttons/esm2022/button-radio.directive.mjs +6 -6
- package/buttons/esm2022/buttons.module.mjs +4 -4
- package/buttons/fesm2022/ngx-bootstrap-buttons.mjs +16 -16
- package/buttons/fesm2022/ngx-bootstrap-buttons.mjs.map +1 -1
- package/carousel/esm2022/carousel.component.mjs +6 -6
- package/carousel/esm2022/carousel.config.mjs +3 -3
- package/carousel/esm2022/carousel.module.mjs +4 -4
- package/carousel/esm2022/slide.component.mjs +5 -5
- package/carousel/esm2022/utils.mjs +3 -3
- package/carousel/fesm2022/ngx-bootstrap-carousel.mjs +18 -18
- package/carousel/fesm2022/ngx-bootstrap-carousel.mjs.map +1 -1
- package/carousel/utils.d.ts +1 -1
- package/collapse/esm2022/collapse.directive.mjs +5 -5
- package/collapse/esm2022/collapse.module.mjs +4 -4
- package/collapse/fesm2022/ngx-bootstrap-collapse.mjs +8 -8
- package/collapse/fesm2022/ngx-bootstrap-collapse.mjs.map +1 -1
- package/component-loader/esm2022/component-loader.factory.mjs +5 -5
- package/component-loader/fesm2022/ngx-bootstrap-component-loader.mjs +5 -5
- package/datepicker/bs-datepicker-input.directive.d.ts +3 -4
- package/datepicker/esm2022/bs-datepicker-inline.component.mjs +5 -5
- package/datepicker/esm2022/bs-datepicker-inline.config.mjs +3 -3
- package/datepicker/esm2022/bs-datepicker-input.directive.mjs +42 -40
- package/datepicker/esm2022/bs-datepicker.component.mjs +5 -5
- package/datepicker/esm2022/bs-datepicker.config.mjs +3 -3
- package/datepicker/esm2022/bs-datepicker.module.mjs +4 -4
- package/datepicker/esm2022/bs-daterangepicker-inline.component.mjs +5 -5
- package/datepicker/esm2022/bs-daterangepicker-inline.config.mjs +3 -3
- package/datepicker/esm2022/bs-daterangepicker-input.directive.mjs +5 -5
- package/datepicker/esm2022/bs-daterangepicker.component.mjs +5 -5
- package/datepicker/esm2022/bs-daterangepicker.config.mjs +3 -3
- package/datepicker/esm2022/bs-locale.service.mjs +3 -3
- package/datepicker/esm2022/reducer/bs-datepicker.actions.mjs +3 -3
- package/datepicker/esm2022/reducer/bs-datepicker.effects.mjs +4 -4
- package/datepicker/esm2022/reducer/bs-datepicker.store.mjs +4 -4
- package/datepicker/esm2022/themes/bs/bs-calendar-layout.component.mjs +3 -3
- package/datepicker/esm2022/themes/bs/bs-current-date-view.component.mjs +3 -3
- package/datepicker/esm2022/themes/bs/bs-custom-dates-view.component.mjs +3 -3
- package/datepicker/esm2022/themes/bs/bs-datepicker-container.component.mjs +17 -13
- package/datepicker/esm2022/themes/bs/bs-datepicker-day-decorator.directive.mjs +5 -5
- package/datepicker/esm2022/themes/bs/bs-datepicker-inline-container.component.mjs +5 -5
- package/datepicker/esm2022/themes/bs/bs-datepicker-navigation-view.component.mjs +3 -3
- package/datepicker/esm2022/themes/bs/bs-daterangepicker-container.component.mjs +24 -23
- package/datepicker/esm2022/themes/bs/bs-daterangepicker-inline-container.component.mjs +5 -5
- package/datepicker/esm2022/themes/bs/bs-days-calendar-view.component.mjs +5 -5
- package/datepicker/esm2022/themes/bs/bs-months-calendar-view.component.mjs +3 -3
- package/datepicker/esm2022/themes/bs/bs-timepicker-view.component.mjs +3 -3
- package/datepicker/esm2022/themes/bs/bs-years-calendar-view.component.mjs +3 -3
- package/datepicker/fesm2022/ngx-bootstrap-datepicker.mjs +170 -163
- package/datepicker/fesm2022/ngx-bootstrap-datepicker.mjs.map +1 -1
- package/dropdown/bs-dropdown.directive.d.ts +1 -1
- package/dropdown/esm2022/bs-dropdown-container.component.mjs +4 -4
- package/dropdown/esm2022/bs-dropdown-menu.directive.mjs +4 -4
- package/dropdown/esm2022/bs-dropdown-toggle.directive.mjs +5 -5
- package/dropdown/esm2022/bs-dropdown.config.mjs +3 -3
- package/dropdown/esm2022/bs-dropdown.directive.mjs +14 -12
- package/dropdown/esm2022/bs-dropdown.module.mjs +4 -4
- package/dropdown/esm2022/bs-dropdown.state.mjs +4 -4
- package/dropdown/fesm2022/ngx-bootstrap-dropdown.mjs +36 -34
- package/dropdown/fesm2022/ngx-bootstrap-dropdown.mjs.map +1 -1
- package/focus-trap/esm2022/focus-trap-manager.mjs +3 -3
- package/focus-trap/esm2022/focus-trap.mjs +11 -11
- package/focus-trap/esm2022/focus-trap.module.mjs +4 -4
- package/focus-trap/esm2022/interactivity-checker.mjs +4 -4
- package/focus-trap/esm2022/platform.mjs +5 -5
- package/focus-trap/fesm2022/ngx-bootstrap-focus-trap.mjs +26 -26
- package/focus-trap/fesm2022/ngx-bootstrap-focus-trap.mjs.map +1 -1
- package/modal/esm2022/bs-modal-ref.service.mjs +3 -3
- package/modal/esm2022/bs-modal.service.mjs +5 -5
- package/modal/esm2022/modal-backdrop.component.mjs +4 -4
- package/modal/esm2022/modal-container.component.mjs +5 -5
- package/modal/esm2022/modal-options.class.mjs +3 -3
- package/modal/esm2022/modal.directive.mjs +6 -6
- package/modal/esm2022/modal.module.mjs +4 -4
- package/modal/fesm2022/ngx-bootstrap-modal.mjs +28 -28
- package/modal/fesm2022/ngx-bootstrap-modal.mjs.map +1 -1
- package/package.json +51 -99
- package/pagination/esm2022/pager.component.mjs +5 -5
- package/pagination/esm2022/pagination.component.mjs +5 -5
- package/pagination/esm2022/pagination.config.mjs +3 -3
- package/pagination/esm2022/pagination.module.mjs +4 -4
- package/pagination/fesm2022/ngx-bootstrap-pagination.mjs +15 -15
- package/pagination/fesm2022/ngx-bootstrap-pagination.mjs.map +1 -1
- package/popover/esm2022/popover-container.component.mjs +5 -6
- package/popover/esm2022/popover.config.mjs +3 -3
- package/popover/esm2022/popover.directive.mjs +7 -12
- package/popover/esm2022/popover.module.mjs +4 -4
- package/popover/fesm2022/ngx-bootstrap-popover.mjs +17 -23
- package/popover/fesm2022/ngx-bootstrap-popover.mjs.map +1 -1
- package/popover/popover-container.component.d.ts +3 -3
- package/popover/popover.directive.d.ts +3 -3
- package/positioning/esm2022/models/index.mjs +1 -1
- package/positioning/esm2022/positioning.service.mjs +5 -5
- package/positioning/esm2022/public_api.mjs +1 -1
- package/positioning/esm2022/utils/checkMargin.mjs +1 -1
- package/positioning/esm2022/utils/getOffsetRectRelativeToArbitraryNode.mjs +1 -3
- package/positioning/esm2022/utils/getWindowSizes.mjs +4 -6
- package/positioning/esm2022/utils/isNumeric.mjs +1 -2
- package/positioning/esm2022/utils/updateContainerClass.mjs +4 -2
- package/positioning/fesm2022/ngx-bootstrap-positioning.mjs +50 -52
- package/positioning/fesm2022/ngx-bootstrap-positioning.mjs.map +1 -1
- package/positioning/models/index.d.ts +7 -1
- package/positioning/public_api.d.ts +1 -1
- package/positioning/utils/checkMargin.d.ts +3 -3
- package/positioning/utils/isNumeric.d.ts +1 -1
- package/progressbar/esm2022/bar.component.mjs +5 -5
- package/progressbar/esm2022/progressbar.component.mjs +5 -5
- package/progressbar/esm2022/progressbar.config.mjs +3 -3
- package/progressbar/esm2022/progressbar.module.mjs +4 -4
- package/progressbar/fesm2022/ngx-bootstrap-progressbar.mjs +15 -15
- package/progressbar/fesm2022/ngx-bootstrap-progressbar.mjs.map +1 -1
- package/rating/esm2022/rating.component.mjs +5 -5
- package/rating/esm2022/rating.config.mjs +3 -3
- package/rating/esm2022/rating.module.mjs +4 -4
- package/rating/fesm2022/ngx-bootstrap-rating.mjs +11 -11
- package/rating/fesm2022/ngx-bootstrap-rating.mjs.map +1 -1
- package/schematics/utils/addStyles.d.ts +2 -2
- package/schematics/utils/addStyles.js +3 -3
- package/schematics/utils/addStyles.js.map +1 -1
- package/schematics/utils/current_dependency_versions.json +1 -1
- package/schematics/utils/getVersions.js +1 -2
- package/schematics/utils/getVersions.js.map +1 -1
- package/schematics/utils/index.d.ts +2 -2
- package/schematics/utils/index.js +6 -9
- package/schematics/utils/index.js.map +1 -1
- package/sortable/esm2022/draggable-item.service.mjs +3 -3
- package/sortable/esm2022/sortable.component.mjs +5 -5
- package/sortable/esm2022/sortable.module.mjs +4 -4
- package/sortable/fesm2022/ngx-bootstrap-sortable.mjs +11 -11
- package/sortable/fesm2022/ngx-bootstrap-sortable.mjs.map +1 -1
- package/tabs/esm2022/ng-transclude.directive.mjs +5 -5
- package/tabs/esm2022/tab-heading.directive.mjs +4 -4
- package/tabs/esm2022/tab.directive.mjs +5 -5
- package/tabs/esm2022/tabs.module.mjs +4 -4
- package/tabs/esm2022/tabset.component.mjs +5 -5
- package/tabs/esm2022/tabset.config.mjs +3 -3
- package/tabs/fesm2022/ngx-bootstrap-tabs.mjs +23 -23
- package/tabs/fesm2022/ngx-bootstrap-tabs.mjs.map +1 -1
- package/timepicker/esm2022/reducer/timepicker.actions.mjs +3 -3
- package/timepicker/esm2022/reducer/timepicker.store.mjs +4 -4
- package/timepicker/esm2022/timepicker.component.mjs +5 -5
- package/timepicker/esm2022/timepicker.config.mjs +3 -3
- package/timepicker/esm2022/timepicker.module.mjs +4 -4
- package/timepicker/fesm2022/ngx-bootstrap-timepicker.mjs +18 -18
- package/timepicker/fesm2022/ngx-bootstrap-timepicker.mjs.map +1 -1
- package/tooltip/esm2022/tooltip-container.component.mjs +4 -4
- package/tooltip/esm2022/tooltip.config.mjs +3 -3
- package/tooltip/esm2022/tooltip.directive.mjs +8 -12
- package/tooltip/esm2022/tooltip.module.mjs +4 -4
- package/tooltip/fesm2022/ngx-bootstrap-tooltip.mjs +19 -23
- package/tooltip/fesm2022/ngx-bootstrap-tooltip.mjs.map +1 -1
- package/tooltip/tooltip.directive.d.ts +4 -4
- package/typeahead/esm2022/typeahead-container.component.mjs +5 -5
- package/typeahead/esm2022/typeahead-match.class.mjs +2 -2
- package/typeahead/esm2022/typeahead.config.mjs +3 -3
- package/typeahead/esm2022/typeahead.directive.mjs +28 -34
- package/typeahead/esm2022/typeahead.module.mjs +4 -4
- package/typeahead/fesm2022/ngx-bootstrap-typeahead.mjs +41 -47
- package/typeahead/fesm2022/ngx-bootstrap-typeahead.mjs.map +1 -1
- package/typeahead/typeahead-match.class.d.ts +3 -3
- package/typeahead/typeahead.directive.d.ts +3 -3
- package/accordion/package.json +0 -28
- package/alert/package.json +0 -28
- package/buttons/package.json +0 -27
- package/carousel/package.json +0 -28
- package/chronos/package.json +0 -23
- package/collapse/package.json +0 -28
- package/component-loader/package.json +0 -27
- package/datepicker/package.json +0 -33
- package/dropdown/package.json +0 -30
- package/focus-trap/package.json +0 -28
- package/locale/package.json +0 -26
- package/mini-ngrx/package.json +0 -26
- package/modal/package.json +0 -28
- package/pagination/package.json +0 -28
- package/popover/package.json +0 -29
- package/positioning/esm2022/utils/includeScroll.mjs +0 -24
- package/positioning/package.json +0 -30
- package/positioning/utils/includeScroll.d.ts +0 -2
- package/progressbar/package.json +0 -27
- package/rating/package.json +0 -28
- package/schematics/package.json +0 -11
- package/sortable/package.json +0 -30
- package/tabs/package.json +0 -27
- package/timepicker/package.json +0 -30
- package/tooltip/package.json +0 -30
- package/typeahead/package.json +0 -32
- package/utils/package.json +0 -26
@@ -4,13 +4,13 @@ import { Utils } from 'ngx-bootstrap/utils';
|
|
4
4
|
import * as i1 from 'ngx-bootstrap/positioning';
|
5
5
|
import { PositioningService } from 'ngx-bootstrap/positioning';
|
6
6
|
import { Subscription, isObservable, EMPTY, from } from 'rxjs';
|
7
|
-
import {
|
7
|
+
import { style, state, animate, transition, trigger } from '@angular/animations';
|
8
8
|
import * as i2 from '@angular/common';
|
9
9
|
import { CommonModule } from '@angular/common';
|
10
10
|
import * as i3 from '@angular/forms';
|
11
11
|
import * as i1$1 from 'ngx-bootstrap/component-loader';
|
12
12
|
import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';
|
13
|
-
import { debounceTime, tap, switchMap,
|
13
|
+
import { debounceTime, tap, switchMap, filter, toArray, mergeMap } from 'rxjs/operators';
|
14
14
|
|
15
15
|
const latinMap = {
|
16
16
|
'Á': 'A',
|
@@ -847,8 +847,8 @@ class TypeaheadOptions {
|
|
847
847
|
}
|
848
848
|
}
|
849
849
|
|
850
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
850
851
|
class TypeaheadMatch {
|
851
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
852
852
|
constructor(item, value = item, header = false) {
|
853
853
|
this.item = item;
|
854
854
|
this.value = value;
|
@@ -1225,10 +1225,10 @@ class TypeaheadContainerComponent {
|
|
1225
1225
|
}
|
1226
1226
|
this.ulElement.nativeElement.scrollTop = 0;
|
1227
1227
|
}
|
1228
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1229
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
1228
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadContainerComponent, deps: [{ token: i1.PositioningService }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
1229
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: TypeaheadContainerComponent, selector: "typeahead-container", outputs: { activeChangeEvent: "activeChange" }, host: { listeners: { "mouseleave": "focusLost()", "blur": "focusLost()" }, properties: { "style.height": "needScrollbar ? guiHeight: 'auto'", "style.visibility": "'inherit'", "class.dropup": "dropup", "attr.role": "'listbox'" }, styleAttribute: "position: absolute;display: block;", classAttribute: "dropdown open bottom dropdown-menu" }, viewQueries: [{ propertyName: "ulElement", first: true, predicate: ["ulElement"], descendants: true }, { propertyName: "liElements", predicate: ["liElements"], descendants: true }], ngImport: i0, template: "<!-- inject options list template -->\n<ng-template [ngTemplateOutlet]=\"optionsListTemplate || bs4Template\"\n [ngTemplateOutletContext]=\"{\n matches: matches,\n itemTemplate: itemTemplate || bsItemTemplate,\n query: query,\n $implicit: typeaheadTemplateMethods\n }\">\n</ng-template>\n\n<!-- default options item template -->\n<ng-template #bsItemTemplate let-match=\"match\" let-query=\"query\">\n <span [innerHtml]=\"highlight(match, query)\"></span>\n</ng-template>\n\n<!-- Bootstrap 4 options list template -->\n<ng-template #bs4Template>\n <ng-template ngFor let-match let-i=\"index\" [ngForOf]=\"matches\">\n <h6 *ngIf=\"match.isHeader()\" class=\"dropdown-header\">{{ match }}</h6>\n <ng-template [ngIf]=\"!match.isHeader()\">\n <button #liElements\n [id]=\"popupId + '-' + i\"\n role=\"option\"\n [@typeaheadAnimation]=\"animationState\"\n class=\"dropdown-item\"\n (click)=\"selectMatch(match, $event)\"\n (mouseenter)=\"selectActive(match)\"\n [class.active]=\"isActive(match)\">\n <ng-template [ngTemplateOutlet]=\"itemTemplate || bsItemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-template>\n </button>\n </ng-template>\n </ng-template>\n</ng-template>\n", styles: [":host.dropdown{z-index:1000}:host.dropdown-menu,.dropdown-menu{overflow-y:auto;height:100px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], animations: [typeaheadAnimation] }); }
|
1230
1230
|
}
|
1231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadContainerComponent, decorators: [{
|
1232
1232
|
type: Component,
|
1233
1233
|
args: [{ selector: 'typeahead-container', host: {
|
1234
1234
|
class: 'dropdown open bottom dropdown-menu',
|
@@ -1238,7 +1238,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
1238
1238
|
style: 'position: absolute;display: block;',
|
1239
1239
|
'[attr.role]': `'listbox'`
|
1240
1240
|
}, animations: [typeaheadAnimation], template: "<!-- inject options list template -->\n<ng-template [ngTemplateOutlet]=\"optionsListTemplate || bs4Template\"\n [ngTemplateOutletContext]=\"{\n matches: matches,\n itemTemplate: itemTemplate || bsItemTemplate,\n query: query,\n $implicit: typeaheadTemplateMethods\n }\">\n</ng-template>\n\n<!-- default options item template -->\n<ng-template #bsItemTemplate let-match=\"match\" let-query=\"query\">\n <span [innerHtml]=\"highlight(match, query)\"></span>\n</ng-template>\n\n<!-- Bootstrap 4 options list template -->\n<ng-template #bs4Template>\n <ng-template ngFor let-match let-i=\"index\" [ngForOf]=\"matches\">\n <h6 *ngIf=\"match.isHeader()\" class=\"dropdown-header\">{{ match }}</h6>\n <ng-template [ngIf]=\"!match.isHeader()\">\n <button #liElements\n [id]=\"popupId + '-' + i\"\n role=\"option\"\n [@typeaheadAnimation]=\"animationState\"\n class=\"dropdown-item\"\n (click)=\"selectMatch(match, $event)\"\n (mouseenter)=\"selectActive(match)\"\n [class.active]=\"isActive(match)\">\n <ng-template [ngTemplateOutlet]=\"itemTemplate || bsItemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-template>\n </button>\n </ng-template>\n </ng-template>\n</ng-template>\n", styles: [":host.dropdown{z-index:1000}:host.dropdown-menu,.dropdown-menu{overflow-y:auto;height:100px}\n"] }]
|
1241
|
-
}], ctorParameters:
|
1241
|
+
}], ctorParameters: () => [{ type: i1.PositioningService }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { activeChangeEvent: [{
|
1242
1242
|
type: Output,
|
1243
1243
|
args: ['activeChange']
|
1244
1244
|
}], ulElement: [{
|
@@ -1279,10 +1279,10 @@ class TypeaheadConfig {
|
|
1279
1279
|
*/
|
1280
1280
|
this.selectItemOnBlur = false;
|
1281
1281
|
}
|
1282
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1283
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
1282
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1283
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadConfig, providedIn: 'root' }); }
|
1284
1284
|
}
|
1285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadConfig, decorators: [{
|
1286
1286
|
type: Injectable,
|
1287
1287
|
args: [{ providedIn: 'root' }]
|
1288
1288
|
}] });
|
@@ -1366,7 +1366,8 @@ class TypeaheadDirective {
|
|
1366
1366
|
this._matches = [];
|
1367
1367
|
this._subscriptions = [];
|
1368
1368
|
this._outsideClickListener = () => void 0;
|
1369
|
-
this._typeahead = cis
|
1369
|
+
this._typeahead = cis
|
1370
|
+
.createLoader(element, viewContainerRef, renderer)
|
1370
1371
|
.provide({ provide: TypeaheadConfig, useValue: config });
|
1371
1372
|
Object.assign(this, {
|
1372
1373
|
typeaheadHideResultsOnBlur: config.hideResultsOnBlur,
|
@@ -1384,10 +1385,9 @@ class TypeaheadDirective {
|
|
1384
1385
|
}
|
1385
1386
|
ngOnInit() {
|
1386
1387
|
this.typeaheadOptionsLimit = this.typeaheadOptionsLimit || 20;
|
1387
|
-
this.typeaheadMinLength =
|
1388
|
-
this.typeaheadMinLength === void 0 ? 1 : this.typeaheadMinLength;
|
1388
|
+
this.typeaheadMinLength = this.typeaheadMinLength === void 0 ? 1 : this.typeaheadMinLength;
|
1389
1389
|
// async should be false in case of array
|
1390
|
-
if (this.typeaheadAsync === undefined && !
|
1390
|
+
if (this.typeaheadAsync === undefined && !isObservable(this.typeahead)) {
|
1391
1391
|
this.typeaheadAsync = false;
|
1392
1392
|
}
|
1393
1393
|
if (isObservable(this.typeahead)) {
|
@@ -1496,7 +1496,10 @@ class TypeaheadDirective {
|
|
1496
1496
|
let valueStr;
|
1497
1497
|
if (this.typeaheadMultipleSearch && this._allEnteredValue) {
|
1498
1498
|
const tokens = this._allEnteredValue.split(new RegExp(`([${this.typeaheadMultipleSearchDelimiters}]+)`));
|
1499
|
-
this._allEnteredValue = tokens
|
1499
|
+
this._allEnteredValue = tokens
|
1500
|
+
.slice(0, tokens.length - 1)
|
1501
|
+
.concat(match.value)
|
1502
|
+
.join('');
|
1500
1503
|
valueStr = this._allEnteredValue;
|
1501
1504
|
}
|
1502
1505
|
else {
|
@@ -1518,8 +1521,7 @@ class TypeaheadDirective {
|
|
1518
1521
|
animation: false,
|
1519
1522
|
dropup: this.dropup
|
1520
1523
|
});
|
1521
|
-
this._outsideClickListener = this.renderer
|
1522
|
-
.listen('document', 'click', (event) => {
|
1524
|
+
this._outsideClickListener = this.renderer.listen('document', 'click', (event) => {
|
1523
1525
|
if (this.typeaheadMinLength === 0 && this.element.nativeElement.contains(event.target)) {
|
1524
1526
|
return;
|
1525
1527
|
}
|
@@ -1534,9 +1536,7 @@ class TypeaheadDirective {
|
|
1534
1536
|
this._container = this._typeahead.instance;
|
1535
1537
|
this._container.parent = this;
|
1536
1538
|
// This improves the speed as it won't have to be done for each list item
|
1537
|
-
const normalizedQuery = (this.typeaheadLatinize
|
1538
|
-
? latinize(this.ngControl.control.value)
|
1539
|
-
: this.ngControl.control.value)
|
1539
|
+
const normalizedQuery = (this.typeaheadLatinize ? latinize(this.ngControl.control.value) : this.ngControl.control.value)
|
1540
1540
|
.toString()
|
1541
1541
|
.toLowerCase();
|
1542
1542
|
this._container.query = this.tokenizeQuery(normalizedQuery);
|
@@ -1572,7 +1572,7 @@ class TypeaheadDirective {
|
|
1572
1572
|
}
|
1573
1573
|
asyncActions() {
|
1574
1574
|
this._subscriptions.push(this.keyUpEventEmitter
|
1575
|
-
.pipe(debounceTime(this.typeaheadWaitMs), tap(value => this._allEnteredValue = value), switchMap(() => {
|
1575
|
+
.pipe(debounceTime(this.typeaheadWaitMs), tap((value) => (this._allEnteredValue = value)), switchMap(() => {
|
1576
1576
|
if (!this.typeahead) {
|
1577
1577
|
return EMPTY;
|
1578
1578
|
}
|
@@ -1591,8 +1591,7 @@ class TypeaheadDirective {
|
|
1591
1591
|
return EMPTY;
|
1592
1592
|
}
|
1593
1593
|
const typeahead = isObservable(this.typeahead) ? this.typeahead : from(this.typeahead);
|
1594
|
-
return typeahead
|
1595
|
-
.pipe(filter((option) => {
|
1594
|
+
return typeahead.pipe(filter((option) => {
|
1596
1595
|
return !!option && this.testMatch(this.normalizeOption(option), normalizedQuery);
|
1597
1596
|
}), toArray());
|
1598
1597
|
}))
|
@@ -1602,9 +1601,7 @@ class TypeaheadDirective {
|
|
1602
1601
|
}
|
1603
1602
|
normalizeOption(option) {
|
1604
1603
|
const optionValue = getValueFromObject(option, this.typeaheadOptionField);
|
1605
|
-
const normalizedOption = this.typeaheadLatinize
|
1606
|
-
? latinize(optionValue)
|
1607
|
-
: optionValue;
|
1604
|
+
const normalizedOption = this.typeaheadLatinize ? latinize(optionValue) : optionValue;
|
1608
1605
|
return normalizedOption.toLowerCase();
|
1609
1606
|
}
|
1610
1607
|
tokenizeQuery(currentQuery) {
|
@@ -1626,9 +1623,7 @@ class TypeaheadDirective {
|
|
1626
1623
|
}
|
1627
1624
|
normalizeQuery(value) {
|
1628
1625
|
// If singleWords, break model here to not be doing extra work on each iteration
|
1629
|
-
let normalizedQuery = (this.typeaheadLatinize
|
1630
|
-
? latinize(value)
|
1631
|
-
: value)
|
1626
|
+
let normalizedQuery = (this.typeaheadLatinize ? latinize(value) : value)
|
1632
1627
|
.toString()
|
1633
1628
|
.toLowerCase();
|
1634
1629
|
normalizedQuery = this.tokenizeQuery(normalizedQuery);
|
@@ -1660,9 +1655,7 @@ class TypeaheadDirective {
|
|
1660
1655
|
}
|
1661
1656
|
if (this._container && this.ngControl.control) {
|
1662
1657
|
// fix: remove usage of ngControl internals
|
1663
|
-
const _controlValue = (this.typeaheadLatinize
|
1664
|
-
? latinize(this.ngControl.control.value)
|
1665
|
-
: this.ngControl.control.value) || '';
|
1658
|
+
const _controlValue = (this.typeaheadLatinize ? latinize(this.ngControl.control.value) : this.ngControl.control.value) || '';
|
1666
1659
|
// This improves the speed as it won't have to be done for each list item
|
1667
1660
|
const normalizedQuery = _controlValue.toString().toLowerCase();
|
1668
1661
|
this._container.query = this.tokenizeQuery(normalizedQuery);
|
@@ -1701,14 +1694,14 @@ class TypeaheadDirective {
|
|
1701
1694
|
if (!options.length) {
|
1702
1695
|
return options;
|
1703
1696
|
}
|
1704
|
-
if (this.typeaheadOrderBy !== null
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1697
|
+
if (this.typeaheadOrderBy !== null &&
|
1698
|
+
this.typeaheadOrderBy !== undefined &&
|
1699
|
+
typeof this.typeaheadOrderBy === 'object' &&
|
1700
|
+
Object.keys(this.typeaheadOrderBy).length === 0) {
|
1708
1701
|
console.error('Field and direction properties for typeaheadOrderBy have to be set according to documentation!');
|
1709
1702
|
return options;
|
1710
1703
|
}
|
1711
|
-
const { field, direction } =
|
1704
|
+
const { field, direction } = this.typeaheadOrderBy || {};
|
1712
1705
|
if (!direction || !(direction === 'asc' || direction === 'desc')) {
|
1713
1706
|
console.error('typeaheadOrderBy direction has to equal "asc" or "desc". Please follow the documentation.');
|
1714
1707
|
return options;
|
@@ -1736,8 +1729,9 @@ class TypeaheadDirective {
|
|
1736
1729
|
return this._matches.length > 0;
|
1737
1730
|
}
|
1738
1731
|
checkDelimitersConflict() {
|
1739
|
-
if (this.typeaheadMultipleSearch &&
|
1740
|
-
|
1732
|
+
if (this.typeaheadMultipleSearch &&
|
1733
|
+
this.typeaheadSingleWords &&
|
1734
|
+
this.haveCommonCharacters(`${this.typeaheadPhraseDelimiters}${this.typeaheadWordDelimiters}`, this.typeaheadMultipleSearchDelimiters)) {
|
1741
1735
|
throw new Error(`Delimiters used in typeaheadMultipleSearchDelimiters must be different
|
1742
1736
|
from delimiters used in typeaheadWordDelimiters (current value: ${this.typeaheadWordDelimiters}) and
|
1743
1737
|
typeaheadPhraseDelimiters (current value: ${this.typeaheadPhraseDelimiters}).
|
@@ -1752,10 +1746,10 @@ class TypeaheadDirective {
|
|
1752
1746
|
}
|
1753
1747
|
return false;
|
1754
1748
|
}
|
1755
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1756
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
1749
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadDirective, deps: [{ token: i1$1.ComponentLoaderFactory }, { token: TypeaheadConfig }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i3.NgControl }, { token: i0.Renderer2 }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
1750
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: TypeaheadDirective, selector: "[typeahead]", inputs: { typeahead: "typeahead", typeaheadMinLength: "typeaheadMinLength", adaptivePosition: "adaptivePosition", isAnimated: "isAnimated", typeaheadWaitMs: "typeaheadWaitMs", typeaheadOptionsLimit: "typeaheadOptionsLimit", typeaheadOptionField: "typeaheadOptionField", typeaheadGroupField: "typeaheadGroupField", typeaheadOrderBy: "typeaheadOrderBy", typeaheadAsync: "typeaheadAsync", typeaheadLatinize: "typeaheadLatinize", typeaheadSingleWords: "typeaheadSingleWords", typeaheadWordDelimiters: "typeaheadWordDelimiters", typeaheadMultipleSearch: "typeaheadMultipleSearch", typeaheadMultipleSearchDelimiters: "typeaheadMultipleSearchDelimiters", typeaheadPhraseDelimiters: "typeaheadPhraseDelimiters", typeaheadItemTemplate: "typeaheadItemTemplate", optionsListTemplate: "optionsListTemplate", typeaheadScrollable: "typeaheadScrollable", typeaheadOptionsInScrollableView: "typeaheadOptionsInScrollableView", typeaheadHideResultsOnBlur: "typeaheadHideResultsOnBlur", typeaheadSelectFirstItem: "typeaheadSelectFirstItem", typeaheadIsFirstItemActive: "typeaheadIsFirstItemActive", container: "container", dropup: "dropup" }, outputs: { typeaheadLoading: "typeaheadLoading", typeaheadNoResults: "typeaheadNoResults", typeaheadOnSelect: "typeaheadOnSelect", typeaheadOnPreview: "typeaheadOnPreview", typeaheadOnBlur: "typeaheadOnBlur" }, host: { listeners: { "input": "onInput($event)", "keyup": "onChange($event)", "click": "onFocus()", "focus": "onFocus()", "blur": "onBlur()", "keydown": "onKeydown($event)" }, properties: { "attr.aria-activedescendant": "activeDescendant", "attr.aria-owns": "isOpen ? this._container.popupId : null", "attr.aria-expanded": "isOpen", "attr.aria-autocomplete": "list" } }, exportAs: ["bs-typeahead"], ngImport: i0 }); }
|
1757
1751
|
}
|
1758
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1752
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadDirective, decorators: [{
|
1759
1753
|
type: Directive,
|
1760
1754
|
args: [{
|
1761
1755
|
selector: '[typeahead]',
|
@@ -1768,7 +1762,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
|
|
1768
1762
|
'[attr.aria-autocomplete]': 'list'
|
1769
1763
|
}
|
1770
1764
|
}]
|
1771
|
-
}], ctorParameters:
|
1765
|
+
}], ctorParameters: () => [{ type: i1$1.ComponentLoaderFactory }, { type: TypeaheadConfig }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i3.NgControl }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }], propDecorators: { typeahead: [{
|
1772
1766
|
type: Input
|
1773
1767
|
}], typeaheadMinLength: [{
|
1774
1768
|
type: Input
|
@@ -1857,11 +1851,11 @@ class TypeaheadModule {
|
|
1857
1851
|
providers: [ComponentLoaderFactory, PositioningService]
|
1858
1852
|
};
|
1859
1853
|
}
|
1860
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
1861
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
1862
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
1854
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1855
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadModule, declarations: [TypeaheadContainerComponent, TypeaheadDirective], imports: [CommonModule], exports: [TypeaheadContainerComponent, TypeaheadDirective] }); }
|
1856
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadModule, imports: [CommonModule] }); }
|
1863
1857
|
}
|
1864
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
1858
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TypeaheadModule, decorators: [{
|
1865
1859
|
type: NgModule,
|
1866
1860
|
args: [{
|
1867
1861
|
imports: [CommonModule],
|