Skip to content

Commit

Permalink
feat(multiselect): implementa as definições do AnimaliaDS
Browse files Browse the repository at this point in the history
Implementar as definições do handoff do multiselect no PoMultiselect.

Fixes DTHFUI-7684
  • Loading branch information
anliben committed Oct 30, 2023
1 parent d7a7f24 commit 65edfcb
Show file tree
Hide file tree
Showing 22 changed files with 893 additions and 380 deletions.
10 changes: 5 additions & 5 deletions projects/ui/src/lib/components/po-field/po-field.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { PoListBoxModule } from '../po-listbox/po-listbox.module';
import { PoComboComponent } from './po-combo/po-combo.component';
import { PoComboOptionTemplateDirective } from './po-combo/po-combo-option-template/po-combo-option-template.directive';
import { PoMultiselectOptionTemplateDirective } from './po-multiselect/po-multiselect-option-template/po-multiselect-option-template.directive';
import { PoDatepickerComponent } from './po-datepicker/po-datepicker.component';
import { PoDatepickerRangeComponent } from './po-datepicker-range/po-datepicker-range.component';
import { PoDecimalComponent } from './po-decimal/po-decimal.component';
import { PoEmailComponent } from './po-email/po-email.component';
Expand All @@ -36,7 +35,6 @@ import { PoLookupComponent } from './po-lookup/po-lookup.component';
import { PoLookupModalComponent } from './po-lookup/po-lookup-modal/po-lookup-modal.component';
import { PoMultiselectDropdownComponent } from './po-multiselect/po-multiselect-dropdown/po-multiselect-dropdown.component';
import { PoMultiselectComponent } from './po-multiselect/po-multiselect.component';
import { PoMultiselectSearchComponent } from './po-multiselect/po-multiselect-search/po-multiselect-search.component';
import { PoRichTextBodyComponent } from './po-rich-text/po-rich-text-body/po-rich-text-body.component';
import { PoRichTextComponent } from './po-rich-text/po-rich-text.component';
import { PoRichTextImageModalComponent } from './po-rich-text/po-rich-text-image-modal/po-rich-text-image-modal.component';
Expand All @@ -57,6 +55,7 @@ import { PoUrlComponent } from './po-url/po-url.component';
import { PoCheckboxModule } from './po-checkbox/po-checkbox.module';
import { PoSwitchModule } from './po-switch/po-switch.module';
import { PoLabelModule } from '../po-label';
import { PoTagModule } from '../po-tag';

/**
* @description
Expand Down Expand Up @@ -98,7 +97,8 @@ import { PoLabelModule } from '../po-label';
PoRadioModule,
PoLabelModule,
PoListBoxModule,
PoSwitchModule
PoSwitchModule,
PoTagModule
],
exports: [
PoCheckboxGroupModule,
Expand Down Expand Up @@ -127,7 +127,8 @@ import { PoLabelModule } from '../po-label';
PoCheckboxModule,
PoRadioModule,
PoLabelModule,
PoSwitchModule
PoSwitchModule,
PoTagModule
],
declarations: [
PoComboComponent,
Expand All @@ -142,7 +143,6 @@ import { PoLabelModule } from '../po-label';
PoLookupModalComponent,
PoMultiselectComponent,
PoMultiselectDropdownComponent,
PoMultiselectSearchComponent,
PoNumberComponent,
PoPasswordComponent,
PoRichTextBodyComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,26 @@ export const poMultiselectLiteralsDefault = {
en: <PoMultiselectLiterals>{
noData: 'No data found',
placeholderSearch: 'Search',
selectAll: 'Select all'
selectAll: 'Select all',
selectItem: 'Select items'
},
es: <PoMultiselectLiterals>{
noData: 'Datos no encontrados',
placeholderSearch: 'Busca',
selectAll: 'Seleccionar todo'
selectAll: 'Seleccionar todo',
selectItem: 'Seleccionar items'
},
pt: <PoMultiselectLiterals>{
noData: 'Nenhum dado encontrado',
placeholderSearch: 'Buscar',
selectAll: 'Selecionar todos'
selectAll: 'Selecionar todos',
selectItem: 'Selecionar itens'
},
ru: <PoMultiselectLiterals>{
noData: 'Данные не найдены',
placeholderSearch: 'искать',
selectAll: 'Выбрать все'
selectAll: 'Выбрать все',
selectItem: 'Выбрать элементы'
}
};

Expand Down Expand Up @@ -151,7 +155,7 @@ export abstract class PoMultiselectBaseComponent implements ControlValueAccessor

selectedOptions: Array<PoMultiselectOption | any> = [];
visibleOptionsDropdown: Array<PoMultiselectOption | any> = [];
visibleDisclaimers = [];
visibleTags = [];
isServerSearching = false;
isFirstFilter: boolean = true;
filterSubject = new Subject();
Expand Down Expand Up @@ -276,7 +280,9 @@ export abstract class PoMultiselectBaseComponent implements ControlValueAccessor
* ```
* const customLiterals: PoMultiselectLiterals = {
* noData: 'Nenhum dado encontrado',
* placeholderSearch: 'Buscar'
* placeholderSearch: 'Buscar',
* selectAll: 'Select all',
* selectItem: 'Select items'
* };
* ```
*
Expand Down Expand Up @@ -310,6 +316,7 @@ export abstract class PoMultiselectBaseComponent implements ControlValueAccessor
this._literals = poMultiselectLiteralsDefault[this.language];
}
}

get literals() {
return this._literals || poMultiselectLiteralsDefault[this.language];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
(p-change)="clickItem($event)"
(p-change-all)="onClickSelectAll()"
(p-change-search)="callChangeSearch($event)"
(p-close)="closeDropdown.emit()"
>
</po-listbox>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import { configureTestSuite } from './../../../../util-test/util-expect.spec';

import { PoMultiselectDropdownComponent } from './po-multiselect-dropdown.component';
import { poMultiselectLiteralsDefault } from '../po-multiselect-base.component';
import { PoMultiselectSearchComponent } from './../po-multiselect-search/po-multiselect-search.component';

describe('PoMultiselectDropdownComponent:', () => {
let component: PoMultiselectDropdownComponent;
let fixture: ComponentFixture<PoMultiselectDropdownComponent>;

configureTestSuite(() => {
TestBed.configureTestingModule({
declarations: [PoMultiselectDropdownComponent, PoMultiselectSearchComponent]
declarations: [PoMultiselectDropdownComponent]
});
});

Expand Down Expand Up @@ -292,13 +291,5 @@ describe('PoMultiselectDropdownComponent:', () => {

expect(fixture.nativeElement.querySelector('.po-listbox-container-no-data')).toBeNull();
});

it('shouldn`t show `po-multiselect-search` if `hideSearch` is `true`', () => {
component.hideSearch = true;

fixture.detectChanges();

expect(fixture.debugElement.query(By.css('po-multiselect-search'))).toEqual(null);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Component,
ElementRef,
EventEmitter,
HostListener,
Input,
Output,
ViewChild,
Expand All @@ -13,7 +12,6 @@ import {

import { PoMultiselectLiterals } from '../../index';
import { PoMultiselectOption } from '../po-multiselect-option.interface';
import { PoMultiselectSearchComponent } from './../po-multiselect-search/po-multiselect-search.component';
import { PoListBoxComponent } from './../../../po-listbox/po-listbox.component';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ export interface PoMultiselectLiterals {

/** Texto exibido no botão de selecionar todos. */
selectAll?: string;

/** Texto exibido na propriedade placeholder. */
selectItem?: string;
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 65edfcb

Please sign in to comment.