@gravitee/ui-particles-angular 7.37.4 → 7.37.5
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/gio-form-tags-input/gio-form-tags-input.component.mjs +20 -16
- package/esm2020/lib/gio-form-tags-input/gio-form-tags-input.harness.mjs +7 -3
- package/fesm2015/gravitee-ui-particles-angular.mjs +25 -17
- package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-particles-angular.mjs +25 -17
- package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
- package/lib/gio-form-tags-input/gio-form-tags-input.component.d.ts +4 -3
- package/lib/gio-form-tags-input/gio-form-tags-input.harness.d.ts +2 -1
- package/package.json +1 -1
|
@@ -34,7 +34,7 @@ import { MatInputModule } from '@angular/material/input';
|
|
|
34
34
|
import * as i2$2 from '@angular/material/select';
|
|
35
35
|
import { MatSelectModule } from '@angular/material/select';
|
|
36
36
|
import { MatAutocompleteHarness } from '@angular/material/autocomplete/testing';
|
|
37
|
-
import { MatChipListHarness } from '@angular/material/chips/testing';
|
|
37
|
+
import { MatChipListHarness, MatChipHarness } from '@angular/material/chips/testing';
|
|
38
38
|
import * as i1$3 from '@angular/material/dialog';
|
|
39
39
|
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
40
40
|
import { MatButtonHarness } from '@angular/material/button/testing';
|
|
@@ -549,18 +549,18 @@ class GioFormTagsInputComponent {
|
|
|
549
549
|
*/
|
|
550
550
|
this.useAutocompleteOptionValueOnly = false;
|
|
551
551
|
this._tagInput = null;
|
|
552
|
+
this.displayValueCache = {};
|
|
552
553
|
this._value = null;
|
|
553
|
-
// From
|
|
554
|
+
// From MatFormFieldControl interface
|
|
554
555
|
this.stateChanges = new Subject();
|
|
555
|
-
// From
|
|
556
|
+
// From MatFormFieldControl interface
|
|
556
557
|
this.id = `gio-form-tags-input-${GioFormTagsInputComponent.nextId++}`;
|
|
557
558
|
this._placeholder = '';
|
|
558
|
-
// From
|
|
559
|
+
// From MatFormFieldControl interface
|
|
559
560
|
this.focused = false;
|
|
560
561
|
this._required = false;
|
|
561
562
|
this._disabled = false;
|
|
562
|
-
|
|
563
|
-
// From ControlValueAccessor interface
|
|
563
|
+
// From MatFormFieldControl interface
|
|
564
564
|
this.describedBy = '';
|
|
565
565
|
// Replace the provider from above with this.
|
|
566
566
|
if (this.ngControl != null) {
|
|
@@ -598,7 +598,7 @@ class GioFormTagsInputComponent {
|
|
|
598
598
|
this._tagInput = v;
|
|
599
599
|
this.initAutocomplete();
|
|
600
600
|
}
|
|
601
|
-
// From
|
|
601
|
+
// From MatFormFieldControl interface
|
|
602
602
|
get value() {
|
|
603
603
|
return this._value;
|
|
604
604
|
}
|
|
@@ -607,7 +607,7 @@ class GioFormTagsInputComponent {
|
|
|
607
607
|
this._onChange(_tags);
|
|
608
608
|
this.stateChanges.next();
|
|
609
609
|
}
|
|
610
|
-
// From
|
|
610
|
+
// From MatFormFieldControl interface
|
|
611
611
|
get placeholder() {
|
|
612
612
|
return this._placeholder;
|
|
613
613
|
}
|
|
@@ -615,15 +615,15 @@ class GioFormTagsInputComponent {
|
|
|
615
615
|
this._placeholder = plh;
|
|
616
616
|
this.stateChanges.next();
|
|
617
617
|
}
|
|
618
|
-
// From
|
|
618
|
+
// From MatFormFieldControl interface
|
|
619
619
|
get empty() {
|
|
620
620
|
return isEmpty(this.value) && isEmpty(this._tagInput?.nativeElement?.value);
|
|
621
621
|
}
|
|
622
|
-
// From
|
|
622
|
+
// From MatFormFieldControl interface
|
|
623
623
|
get shouldLabelFloat() {
|
|
624
624
|
return this.focused || !this.empty;
|
|
625
625
|
}
|
|
626
|
-
// From
|
|
626
|
+
// From MatFormFieldControl interface
|
|
627
627
|
get required() {
|
|
628
628
|
return this._required;
|
|
629
629
|
}
|
|
@@ -631,7 +631,7 @@ class GioFormTagsInputComponent {
|
|
|
631
631
|
this._required = coerceBooleanProperty(req);
|
|
632
632
|
this.stateChanges.next();
|
|
633
633
|
}
|
|
634
|
-
// From
|
|
634
|
+
// From MatFormFieldControl interface
|
|
635
635
|
get disabled() {
|
|
636
636
|
return this._disabled || (this.ngControl && this.ngControl.disabled === true);
|
|
637
637
|
}
|
|
@@ -639,7 +639,7 @@ class GioFormTagsInputComponent {
|
|
|
639
639
|
this._disabled = coerceBooleanProperty(dis);
|
|
640
640
|
this.stateChanges.next();
|
|
641
641
|
}
|
|
642
|
-
// From
|
|
642
|
+
// From MatFormFieldControl interface
|
|
643
643
|
get errorState() {
|
|
644
644
|
return (this.touched &&
|
|
645
645
|
// if required check if is empty
|
|
@@ -658,6 +658,10 @@ class GioFormTagsInputComponent {
|
|
|
658
658
|
this.stateChanges.complete();
|
|
659
659
|
this.fm.stopMonitoring(this.elRef.nativeElement);
|
|
660
660
|
}
|
|
661
|
+
// From ControlValueAccess interface
|
|
662
|
+
setDisabledState(isDisabled) {
|
|
663
|
+
this.disabled = isDisabled;
|
|
664
|
+
}
|
|
661
665
|
// From ControlValueAccessor interface
|
|
662
666
|
writeValue(value) {
|
|
663
667
|
this._value = value;
|
|
@@ -673,7 +677,7 @@ class GioFormTagsInputComponent {
|
|
|
673
677
|
setDescribedByIds(ids) {
|
|
674
678
|
this.describedBy = ids.join(' ');
|
|
675
679
|
}
|
|
676
|
-
// From
|
|
680
|
+
// From MatFormFieldControl interface
|
|
677
681
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
678
682
|
onContainerClick(_event) { }
|
|
679
683
|
addChipToFormControl(event) {
|
|
@@ -738,7 +742,7 @@ GioFormTagsInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
|
|
|
738
742
|
provide: MatFormFieldControl,
|
|
739
743
|
useExisting: GioFormTagsInputComponent,
|
|
740
744
|
},
|
|
741
|
-
], viewQueries: [{ propertyName: "tagInput", first: true, predicate: ["tagInput"], descendants: true }], ngImport: i0, template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<mat-chip-list #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n <mat-chip
|
|
745
|
+
], viewQueries: [{ propertyName: "tagInput", first: true, predicate: ["tagInput"], descendants: true }], ngImport: i0, template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<mat-chip-list #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n <mat-chip\n *ngFor=\"let tag of value\"\n [selectable]=\"false\"\n [removable]=\"!disabled\"\n (removed)=\"removeChipToFormControl(tag)\"\n [disabled]=\"disabled\"\n >\n {{ _displayValueWith ? (_displayValueWith(tag) | async) : tag }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n <input\n *ngIf=\"!disabled\"\n #tagInput\n [matAutocompleteDisabled]=\"!_autocompleteOptions || disabled\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\"\n [matChipInputFor]=\"tagChipList\"\n [matChipInputAddOnBlur]=\"addOnBlur\"\n (matChipInputTokenEnd)=\"onMatChipTokenEnd()\"\n />\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onAutocompleteSelect($event)\">\n <mat-option *ngFor=\"let option of autocompleteFilteredOptions$ | async\" [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n </mat-autocomplete>\n</mat-chip-list>\n", styles: [""], components: [{ type: i3$2.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i1$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i2$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3$2.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i3$2.MatChipRemove, selector: "[matChipRemove]" }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: i3$2.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }], pipes: { "async": i2.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
742
746
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormTagsInputComponent, decorators: [{
|
|
743
747
|
type: Component,
|
|
744
748
|
args: [{ selector: 'gio-form-tags-input', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -746,7 +750,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
746
750
|
provide: MatFormFieldControl,
|
|
747
751
|
useExisting: GioFormTagsInputComponent,
|
|
748
752
|
},
|
|
749
|
-
], template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<mat-chip-list #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n <mat-chip
|
|
753
|
+
], template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<mat-chip-list #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n <mat-chip\n *ngFor=\"let tag of value\"\n [selectable]=\"false\"\n [removable]=\"!disabled\"\n (removed)=\"removeChipToFormControl(tag)\"\n [disabled]=\"disabled\"\n >\n {{ _displayValueWith ? (_displayValueWith(tag) | async) : tag }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n <input\n *ngIf=\"!disabled\"\n #tagInput\n [matAutocompleteDisabled]=\"!_autocompleteOptions || disabled\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\"\n [matChipInputFor]=\"tagChipList\"\n [matChipInputAddOnBlur]=\"addOnBlur\"\n (matChipInputTokenEnd)=\"onMatChipTokenEnd()\"\n />\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onAutocompleteSelect($event)\">\n <mat-option *ngFor=\"let option of autocompleteFilteredOptions$ | async\" [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n </mat-autocomplete>\n</mat-chip-list>\n", styles: [""] }]
|
|
750
754
|
}], ctorParameters: function () { return [{ type: i7.NgControl, decorators: [{
|
|
751
755
|
type: Optional
|
|
752
756
|
}, {
|
|
@@ -844,6 +848,7 @@ class GioFormTagsInputHarness extends ComponentHarness {
|
|
|
844
848
|
constructor() {
|
|
845
849
|
super(...arguments);
|
|
846
850
|
this.getMatChipListHarness = this.locatorFor(MatChipListHarness);
|
|
851
|
+
this.getMatChipsHarness = this.locatorForAll(MatChipHarness);
|
|
847
852
|
}
|
|
848
853
|
/**
|
|
849
854
|
* Gets a `HarnessPredicate` that can be used to search for a `GioFormColorInputHarness` that meets
|
|
@@ -857,7 +862,10 @@ class GioFormTagsInputHarness extends ComponentHarness {
|
|
|
857
862
|
}
|
|
858
863
|
async isDisabled() {
|
|
859
864
|
const matChipList = await this.getMatChipListHarness();
|
|
860
|
-
|
|
865
|
+
const matChips = await this.getMatChipsHarness();
|
|
866
|
+
const chipListDisabled = await matChipList.isDisabled();
|
|
867
|
+
const chipsDisabled = await parallel(() => matChips.map(async (matChip) => await matChip.isDisabled()));
|
|
868
|
+
return chipListDisabled && chipsDisabled.every(chipDisabled => chipDisabled);
|
|
861
869
|
}
|
|
862
870
|
async getTags() {
|
|
863
871
|
const matChipList = await this.getMatChipListHarness();
|