@recursyve/nice-ui-kit.v2 13.2.0-beta.101 → 13.2.0-beta.102
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/esm2020/lib/components/async-typeahead/async-typeahead.component.mjs +5 -3
- package/esm2020/lib/directives/chip-list/chip-list.directive.mjs +15 -4
- package/fesm2015/recursyve-nice-ui-kit.v2.mjs +20 -5
- package/fesm2015/recursyve-nice-ui-kit.v2.mjs.map +1 -1
- package/fesm2020/recursyve-nice-ui-kit.v2.mjs +18 -5
- package/fesm2020/recursyve-nice-ui-kit.v2.mjs.map +1 -1
- package/lib/components/async-typeahead/async-typeahead.component.d.ts +1 -1
- package/lib/directives/chip-list/chip-list.directive.d.ts +2 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import * as i1$7 from '@angular/animations';
|
|
|
2
2
|
import { animation, style, animate, trigger, transition, useAnimation, state, keyframes } from '@angular/animations';
|
|
3
3
|
import { HttpContextToken, HttpResponse, HttpContext, HttpParams } from '@angular/common/http';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Injectable, NgModule, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, HostBinding, InjectionToken, Directive, HostListener, forwardRef, Optional, Inject, ViewChild, ViewChildren, Self, Pipe, ElementRef, PLATFORM_ID, TemplateRef, ContentChildren, ContentChild, SkipSelf } from '@angular/core';
|
|
5
|
+
import { Injectable, NgModule, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, HostBinding, InjectionToken, Directive, HostListener, forwardRef, Optional, Inject, ViewChild, ViewChildren, Self, Pipe, ElementRef, PLATFORM_ID, TemplateRef, ContentChildren, ContentChild, SimpleChange, SkipSelf } from '@angular/core';
|
|
6
6
|
import { plainToInstance } from 'class-transformer';
|
|
7
7
|
import { map, filter, takeUntil, tap, take, debounceTime as debounceTime$1, delay, switchMap } from 'rxjs/operators';
|
|
8
8
|
import { catchError, ReplaySubject, Subject, BehaviorSubject, mergeMap, from, isObservable, firstValueFrom, debounceTime, distinctUntilChanged, startWith, tap as tap$1, Observable, combineLatest, fromEvent, merge as merge$1 } from 'rxjs';
|
|
@@ -2983,7 +2983,7 @@ class NiceAsyncTypeaheadComponent extends _BaseAsyncTypeaheadComponent {
|
|
|
2983
2983
|
}
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
2986
|
-
onRemove(event) {
|
|
2986
|
+
onRemove(event, reload = true) {
|
|
2987
2987
|
if (event) {
|
|
2988
2988
|
// event.stopPropagation();
|
|
2989
2989
|
}
|
|
@@ -2997,7 +2997,9 @@ class NiceAsyncTypeaheadComponent extends _BaseAsyncTypeaheadComponent {
|
|
|
2997
2997
|
this.ngControl.control.markAsTouched();
|
|
2998
2998
|
}
|
|
2999
2999
|
this.stateChanges.next();
|
|
3000
|
-
|
|
3000
|
+
if (reload) {
|
|
3001
|
+
this.service.search(this.resource, "", this.searchOptions);
|
|
3002
|
+
}
|
|
3001
3003
|
}
|
|
3002
3004
|
formatLabel(item) {
|
|
3003
3005
|
if (this._labelFormatFn) {
|
|
@@ -8939,6 +8941,7 @@ class NiceChipListDirective {
|
|
|
8939
8941
|
this.asyncTypeahead = asyncTypeahead;
|
|
8940
8942
|
this.ngControl = ngControl;
|
|
8941
8943
|
this.elementRef = elementRef;
|
|
8944
|
+
this.reloadOnSelected = true;
|
|
8942
8945
|
this.unsubscribeAll$ = new Subject();
|
|
8943
8946
|
this.values$ = new BehaviorSubject([]);
|
|
8944
8947
|
this._values = [];
|
|
@@ -8977,6 +8980,13 @@ class NiceChipListDirective {
|
|
|
8977
8980
|
this.withItemList.items$ = this.values$;
|
|
8978
8981
|
this.withItemList.removeChip.pipe(takeUntil(this.unsubscribeAll$)).subscribe(x => {
|
|
8979
8982
|
this._values.splice(x, 1);
|
|
8983
|
+
if (this.asyncTypeahead) {
|
|
8984
|
+
const searchOptions = this.asyncTypeahead.searchOptions;
|
|
8985
|
+
this.asyncTypeahead.searchOptions = { ...(searchOptions ?? {}), ignore: this._values ?? [] };
|
|
8986
|
+
this.asyncTypeahead.ngOnChanges({
|
|
8987
|
+
searchOptions: new SimpleChange(searchOptions, this.asyncTypeahead.searchOptions, false)
|
|
8988
|
+
});
|
|
8989
|
+
}
|
|
8980
8990
|
this.propagateChanges(this._values);
|
|
8981
8991
|
this.values$.next(this._values);
|
|
8982
8992
|
});
|
|
@@ -8995,7 +9005,8 @@ class NiceChipListDirective {
|
|
|
8995
9005
|
.pipe(takeUntil(this.unsubscribeAll$), filter((selected) => selected))
|
|
8996
9006
|
.subscribe((_) => {
|
|
8997
9007
|
this.addValue(this.asyncTypeahead.getActive());
|
|
8998
|
-
this.asyncTypeahead.
|
|
9008
|
+
this.asyncTypeahead.searchOptions = { ...(this.asyncTypeahead.searchOptions ?? {}), ignore: this._values ?? [] };
|
|
9009
|
+
this.asyncTypeahead.onRemove(null, this.reloadOnSelected);
|
|
8999
9010
|
});
|
|
9000
9011
|
}
|
|
9001
9012
|
addValue(value) {
|
|
@@ -9008,7 +9019,7 @@ class NiceChipListDirective {
|
|
|
9008
9019
|
}
|
|
9009
9020
|
}
|
|
9010
9021
|
NiceChipListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceChipListDirective, deps: [{ token: NiceAsyncTypeaheadComponent, optional: true }, { token: i1$2.NgControl, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
9011
|
-
NiceChipListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.3", type: NiceChipListDirective, selector: "input[niceChipList], nice-async-typeahead[niceChipList]", inputs: { withItemList: "withItemList" }, host: { listeners: { "keydown": "onKeyDown($event)" } }, usesOnChanges: true, ngImport: i0 });
|
|
9022
|
+
NiceChipListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.3", type: NiceChipListDirective, selector: "input[niceChipList], nice-async-typeahead[niceChipList]", inputs: { withItemList: "withItemList", reloadOnSelected: "reloadOnSelected" }, host: { listeners: { "keydown": "onKeyDown($event)" } }, usesOnChanges: true, ngImport: i0 });
|
|
9012
9023
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: NiceChipListDirective, decorators: [{
|
|
9013
9024
|
type: Directive,
|
|
9014
9025
|
args: [{
|
|
@@ -9020,6 +9031,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
|
|
|
9020
9031
|
type: Optional
|
|
9021
9032
|
}] }, { type: i0.ElementRef }]; }, propDecorators: { withItemList: [{
|
|
9022
9033
|
type: Input
|
|
9034
|
+
}], reloadOnSelected: [{
|
|
9035
|
+
type: Input
|
|
9023
9036
|
}], onKeyDown: [{
|
|
9024
9037
|
type: HostListener,
|
|
9025
9038
|
args: ["keydown", ["$event"]]
|