-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Reimplement the autocomplete component * dev (add styles autocomplete): enhance functionality * Fix filtering and styling. * Fix the filtering and language messages * Add tests for JsonClassesService * Test are not running * fix (add styles dialog): now tests are running * Fix tests * Update mocks --------- Co-authored-by: Jalinson Diaz <zjaaaldev@gmail.com>
- Loading branch information
Showing
18 changed files
with
437 additions
and
649 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 44 additions & 30 deletions
74
...plate-builder/components/add-style-classes-dialog/add-style-classes-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,44 @@ | ||
<ng-container *ngIf="vm$ | async as vm"> | ||
<div class="dialog__auto-complete-container field"> | ||
<div class="p-fluid"> | ||
<p-autoComplete | ||
[ngModel]="vm.selectedClasses" | ||
[suggestions]="vm.filteredClasses" | ||
[multiple]="true" | ||
[completeOnFocus]="true" | ||
[size]="446" | ||
[tabindex]="1" | ||
(onSelect)="onSelect($event)" | ||
(onUnselect)="onUnselect($event)" | ||
(completeMethod)="filterClasses($event)" | ||
(onKeyUp)="onKeyUp($event)" | ||
dataKey="cssClass" | ||
field="cssClass" | ||
appendTo="body" | ||
inputId="auto-complete-input" | ||
name="class" | ||
type="text" | ||
> | ||
</p-autoComplete> | ||
</div> | ||
</div> | ||
<div class="dialog__actions-container"> | ||
<p-button (onClick)="saveClass(vm.selectedClasses)" data-testId="update-btn"> | ||
{{ 'dot.template.builder.classes.dialog.update.button' | dm }}</p-button | ||
> | ||
</div> | ||
</ng-container> | ||
<div class="dialog__auto-complete-container field"> | ||
<p-autoComplete | ||
class="p-fluid" | ||
[(ngModel)]="selectedClasses" | ||
[unique]="true" | ||
[suggestions]="filteredSuggestions" | ||
[size]="446" | ||
[multiple]="true" | ||
[dropdown]="isJsonClasses$ | async" | ||
[autofocus]="true" | ||
(onKeyUp)="onKeyUp($event)" | ||
(completeMethod)="filterClasses($event)" | ||
data-testId="autocomplete" | ||
inputId="auto-complete-input" | ||
appendTo="body"> | ||
</p-autoComplete> | ||
<ng-container *ngIf="isJsonClasses$ | async; else suggestionNotes"> | ||
<ul data-testId="list"> | ||
<li> | ||
<i class="pi pi-info-circle"></i> | ||
{{ 'dot.template.builder.autocomplete.has.suggestions' | dm }} | ||
</li> | ||
</ul> | ||
</ng-container> | ||
|
||
<ng-template #suggestionNotes> | ||
<ul data-testId="list"> | ||
<li> | ||
<i class="pi pi-info-circle"></i> | ||
{{ 'dot.template.builder.autocomplete.no.suggestions' | dm }} | ||
</li> | ||
<li> | ||
<i class="pi pi-check-circle"></i> | ||
<span | ||
[innerHTML]="'dot.template.builder.autocomplete.setup.suggestions' | dm"></span> | ||
</li> | ||
</ul> | ||
</ng-template> | ||
</div> | ||
<div class="dialog__actions-container"> | ||
<p-button (onClick)="save()" data-testId="update-btn"> | ||
{{ 'dot.template.builder.classes.dialog.update.button' | dm }}</p-button | ||
> | ||
</div> |
41 changes: 24 additions & 17 deletions
41
...plate-builder/components/add-style-classes-dialog/add-style-classes-dialog.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
@use "variables" as *; | ||
|
||
:host { | ||
width: 33.875rem; | ||
display: block; | ||
} | ||
|
||
.dialog__auto-complete-container { | ||
.auto-complete-container__label { | ||
margin: 0; | ||
color: $black; | ||
} | ||
} | ||
|
||
.dialog__actions-container { | ||
display: flex; | ||
justify-content: end; | ||
padding: 1.25rem $spacing-5; | ||
} | ||
|
||
::ng-deep { | ||
.p-autocomplete.p-autocomplete-multiple | ||
.p-autocomplete-multiple-container | ||
.p-autocomplete-token { | ||
margin-right: 0; | ||
} | ||
p-autoComplete { | ||
margin-bottom: $spacing-3; | ||
display: block; | ||
} | ||
|
||
ul { | ||
color: $color-palette-gray-700; | ||
display: flex; | ||
flex-direction: column; | ||
font-size: $font-size-sm; | ||
gap: $spacing-1; | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
li { | ||
display: flex; | ||
align-items: center; | ||
gap: $spacing-0; | ||
} | ||
|
||
.p-autocomplete-multiple-container { | ||
gap: 0.25rem; | ||
} | ||
.pi { | ||
color: $color-palette-gray; | ||
} |
Oops, something went wrong.