@gravitee/ui-particles-angular 16.0.0 → 16.0.1-apim-11428-mcp-proxy-4ee5192
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.
|
@@ -478,7 +478,11 @@ class GioFormTagsInputComponent {
|
|
|
478
478
|
}
|
|
479
479
|
// From MatFormFieldControl interface
|
|
480
480
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
481
|
-
onContainerClick(_event) {
|
|
481
|
+
onContainerClick(_event) {
|
|
482
|
+
if (this._tagInput) {
|
|
483
|
+
this._tagInput.nativeElement.focus();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
482
486
|
addChipToFormControl(event) {
|
|
483
487
|
const input = this._tagInput?.nativeElement;
|
|
484
488
|
const tagToAdd = (event.value ?? '').trim();
|
|
@@ -524,9 +528,11 @@ class GioFormTagsInputComponent {
|
|
|
524
528
|
if (typeof this._autocompleteOptions === 'function') {
|
|
525
529
|
return this._autocompleteOptions(this._tagInput?.nativeElement.value ?? '').pipe(map(options => sanitizeAutocompleteOptions(options)),
|
|
526
530
|
// Add options to displayValueCache to avoid call on select
|
|
527
|
-
tap(
|
|
528
|
-
|
|
529
|
-
|
|
531
|
+
tap(groups => {
|
|
532
|
+
groups.forEach(group => {
|
|
533
|
+
group.groupOptions.forEach(option => {
|
|
534
|
+
this.displayValueCache[option.value] = option.label;
|
|
535
|
+
});
|
|
530
536
|
});
|
|
531
537
|
}));
|
|
532
538
|
}
|
|
@@ -543,7 +549,7 @@ class GioFormTagsInputComponent {
|
|
|
543
549
|
provide: MatFormFieldControl,
|
|
544
550
|
useExisting: GioFormTagsInputComponent,
|
|
545
551
|
},
|
|
546
|
-
], viewQueries: [{ propertyName: "tagInput", first: true, predicate: ["tagInput"], descendants: true }], ngImport: i0, template: "<!--\n\n Copyright (C) 2025 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-grid #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n @for (tag of value; track tag) {\n <mat-chip-row [removable]=\"!disabled\" (removed)=\"removeChipToFormControl(tag)\" [disabled]=\"disabled\" (click)=\"tagClicked.emit(tag)\">\n @if (_displayValueWith) {\n {{ _displayValueWith(tag) | async }}\n } @else {\n {{ tag }}\n }\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip-row>\n }\n <input\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 @if (loading) {\n <mat-option disabled id=\"loader\">\n <div class=\"loader-option\"><gio-loader></gio-loader></div>\n </mat-option>\n }\n @for (
|
|
552
|
+
], viewQueries: [{ propertyName: "tagInput", first: true, predicate: ["tagInput"], descendants: true }], ngImport: i0, template: "<!--\n\n Copyright (C) 2025 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-grid #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n @for (tag of value; track tag) {\n <mat-chip-row [removable]=\"!disabled\" (removed)=\"removeChipToFormControl(tag)\" [disabled]=\"disabled\" (click)=\"tagClicked.emit(tag)\">\n @if (_displayValueWith) {\n {{ _displayValueWith(tag) | async }}\n } @else {\n {{ tag }}\n }\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip-row>\n }\n <input\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 @if (loading) {\n <mat-option disabled id=\"loader\">\n <div class=\"loader-option\"><gio-loader></gio-loader></div>\n </mat-option>\n }\n @for (group of autocompleteFilteredOptions$ | async; track group.groupLabel) {\n @if (group.groupLabel) {\n <mat-optgroup [label]=\"group.groupLabel\">\n @for (option of group.groupOptions; track option.value) {\n <mat-option [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n }\n </mat-optgroup>\n } @else {\n @for (option of group.groupOptions; track option) {\n <mat-option [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n }\n }\n }\n </mat-autocomplete>\n</mat-chip-grid>\n", styles: ["::ng-deep gio-form-tags-input .mat-mdc-standard-chip{height:unset!important;min-height:var(--mat-chip-container-height)}::ng-deep gio-form-tags-input .mat-mdc-standard-chip .mdc-evolution-chip__text-label{white-space:normal}.loader-option{display:flex}.loader-option gio-loader{width:24px}\n"], dependencies: [{ kind: "component", type: i3.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i3.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i3.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i3.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i5.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: GioLoaderComponent, selector: "gio-loader" }, { kind: "pipe", type: i1$4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
547
553
|
}
|
|
548
554
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: GioFormTagsInputComponent, decorators: [{
|
|
549
555
|
type: Component,
|
|
@@ -552,7 +558,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
552
558
|
provide: MatFormFieldControl,
|
|
553
559
|
useExisting: GioFormTagsInputComponent,
|
|
554
560
|
},
|
|
555
|
-
], standalone: false, template: "<!--\n\n Copyright (C) 2025 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-grid #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n @for (tag of value; track tag) {\n <mat-chip-row [removable]=\"!disabled\" (removed)=\"removeChipToFormControl(tag)\" [disabled]=\"disabled\" (click)=\"tagClicked.emit(tag)\">\n @if (_displayValueWith) {\n {{ _displayValueWith(tag) | async }}\n } @else {\n {{ tag }}\n }\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip-row>\n }\n <input\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 @if (loading) {\n <mat-option disabled id=\"loader\">\n <div class=\"loader-option\"><gio-loader></gio-loader></div>\n </mat-option>\n }\n @for (
|
|
561
|
+
], standalone: false, template: "<!--\n\n Copyright (C) 2025 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-grid #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n @for (tag of value; track tag) {\n <mat-chip-row [removable]=\"!disabled\" (removed)=\"removeChipToFormControl(tag)\" [disabled]=\"disabled\" (click)=\"tagClicked.emit(tag)\">\n @if (_displayValueWith) {\n {{ _displayValueWith(tag) | async }}\n } @else {\n {{ tag }}\n }\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip-row>\n }\n <input\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 @if (loading) {\n <mat-option disabled id=\"loader\">\n <div class=\"loader-option\"><gio-loader></gio-loader></div>\n </mat-option>\n }\n @for (group of autocompleteFilteredOptions$ | async; track group.groupLabel) {\n @if (group.groupLabel) {\n <mat-optgroup [label]=\"group.groupLabel\">\n @for (option of group.groupOptions; track option.value) {\n <mat-option [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n }\n </mat-optgroup>\n } @else {\n @for (option of group.groupOptions; track option) {\n <mat-option [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n }\n }\n }\n </mat-autocomplete>\n</mat-chip-grid>\n", styles: ["::ng-deep gio-form-tags-input .mat-mdc-standard-chip{height:unset!important;min-height:var(--mat-chip-container-height)}::ng-deep gio-form-tags-input .mat-mdc-standard-chip .mdc-evolution-chip__text-label{white-space:normal}.loader-option{display:flex}.loader-option gio-loader{width:24px}\n"] }]
|
|
556
562
|
}], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
|
|
557
563
|
type: Optional
|
|
558
564
|
}, {
|
|
@@ -592,16 +598,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
592
598
|
args: ['attr.aria-describedby']
|
|
593
599
|
}] } });
|
|
594
600
|
const defaultAutocompleteFilter = (options, search) => {
|
|
595
|
-
|
|
596
|
-
|
|
601
|
+
const optionsFilter = (options, search) => {
|
|
602
|
+
return options.filter(option => option.label.toLowerCase().includes((search ?? '').toLowerCase()) ||
|
|
603
|
+
option.value.toLowerCase().includes((search ?? '').toLowerCase()));
|
|
604
|
+
};
|
|
605
|
+
return sanitizeAutocompleteOptions(options)
|
|
606
|
+
.map(group => ({
|
|
607
|
+
groupLabel: group.groupLabel,
|
|
608
|
+
groupOptions: optionsFilter(group.groupOptions, search),
|
|
609
|
+
}))
|
|
610
|
+
.filter(group => group.groupOptions.length > 0);
|
|
597
611
|
};
|
|
598
612
|
const sanitizeAutocompleteOptions = (options) => {
|
|
599
|
-
|
|
613
|
+
const sanitizeFlatOptions = (flatOptions) => flatOptions.map(option => {
|
|
600
614
|
if (option && typeof option !== 'string' && 'value' in option && 'label' in option) {
|
|
601
615
|
return option;
|
|
602
616
|
}
|
|
603
617
|
return { value: option, label: option };
|
|
604
618
|
});
|
|
619
|
+
if (Array.isArray(options) &&
|
|
620
|
+
(options.length === 0 || typeof options[0] === 'string' || ('value' in options[0] && 'label' in options[0]))) {
|
|
621
|
+
const optionsFlat = options;
|
|
622
|
+
return [
|
|
623
|
+
{
|
|
624
|
+
groupOptions: sanitizeFlatOptions(optionsFlat),
|
|
625
|
+
},
|
|
626
|
+
];
|
|
627
|
+
}
|
|
628
|
+
else {
|
|
629
|
+
// Else option is Grouped
|
|
630
|
+
const optionsGrouped = options;
|
|
631
|
+
return optionsGrouped.map(group => ({
|
|
632
|
+
groupLabel: group.groupLabel,
|
|
633
|
+
groupOptions: sanitizeFlatOptions(group.groupOptions),
|
|
634
|
+
}));
|
|
635
|
+
}
|
|
605
636
|
};
|
|
606
637
|
|
|
607
638
|
/*
|
|
@@ -7366,7 +7397,9 @@ class GioFormSelectionInlineCardHarness extends ComponentHarness {
|
|
|
7366
7397
|
}
|
|
7367
7398
|
async getValue() {
|
|
7368
7399
|
const host = await this.host();
|
|
7369
|
-
|
|
7400
|
+
// Fallback to keep for Angular 19 compatibility. Can be removed when all projects are on Angular 20+
|
|
7401
|
+
const value = (await host.getAttribute('value')) ?? (await host.getAttribute('ng-reflect-value'));
|
|
7402
|
+
return value ?? null;
|
|
7370
7403
|
}
|
|
7371
7404
|
async isSelected() {
|
|
7372
7405
|
return (await this.host()).hasClass('selected');
|
|
@@ -7399,7 +7432,6 @@ class GioFormSelectionInlineHarness extends ComponentHarness {
|
|
|
7399
7432
|
constructor() {
|
|
7400
7433
|
super(...arguments);
|
|
7401
7434
|
this.getCards = this.locatorForAll(GioFormSelectionInlineCardHarness);
|
|
7402
|
-
this.getCardByValue = (value) => this.locatorFor(`gio-form-selection-inline-card[value="${value}"]`)();
|
|
7403
7435
|
}
|
|
7404
7436
|
static { this.hostSelector = 'gio-form-selection-inline'; }
|
|
7405
7437
|
/**
|
|
@@ -7412,6 +7444,18 @@ class GioFormSelectionInlineHarness extends ComponentHarness {
|
|
|
7412
7444
|
static with(options = {}) {
|
|
7413
7445
|
return new HarnessPredicate(GioFormSelectionInlineHarness, options);
|
|
7414
7446
|
}
|
|
7447
|
+
async getCardByValue(value) {
|
|
7448
|
+
const primaryLocator = await this.locatorForOptional(`gio-form-selection-inline-card[value="${value}"]`)();
|
|
7449
|
+
if (primaryLocator) {
|
|
7450
|
+
return primaryLocator;
|
|
7451
|
+
}
|
|
7452
|
+
// Fallback to keep for Angular 19 compatibility. Can be removed when all projects are on Angular 20+
|
|
7453
|
+
const secondaryLocator = await this.locatorForOptional(`gio-form-selection-inline-card[ng-reflect-value="${value}"]`)();
|
|
7454
|
+
if (secondaryLocator) {
|
|
7455
|
+
return secondaryLocator;
|
|
7456
|
+
}
|
|
7457
|
+
throw new Error(`No card found with value or ng-reflect-value "${value}"`);
|
|
7458
|
+
}
|
|
7415
7459
|
async getSelectedValue() {
|
|
7416
7460
|
const cards = await this.getCards();
|
|
7417
7461
|
const cardsAttr = await parallel(() => cards.map(async (row) => ({ class: await row.isSelected(), value: await row.getValue() })));
|