Skip to content

Commit

Permalink
Merge branch 'primefaces:master' into muiltiselectFix
Browse files Browse the repository at this point in the history
  • Loading branch information
rosenthalj authored Feb 14, 2024
2 parents e77e5b6 + 4157578 commit bc5d47a
Show file tree
Hide file tree
Showing 93 changed files with 24,594 additions and 13,074 deletions.
106 changes: 106 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,98 @@
# Changelog
## [17.7.0](https://github.com/primefaces/primeng/tree/17.7.0) (2024-02-14)

[Full Changelog](https://github.com/primefaces/primeng/compare/17.6.0...17.7.0)

**Implemented New Features and Enhancements:**
- Dropdown, MultiSelect, AutoComplete, CascadeSelect: aria-label missing from inner ul element [\#14790](https://github.com/primefaces/primeng/issues/14790)
- Autocomplete: emptyMessage is not showed, when no item fit condition [\#14744](https://github.com/primefaces/primeng/issues/14744)
- ProgressSpinner: Unable to set aria-label [\#14798](https://github.com/primefaces/primeng/issues/14798)

**Fixed bugs:**
- Dropdown: invalid text after cleaning via ngModel [\#14784](https://github.com/primefaces/primeng/issues/14784)
- Component: p-dropdown emits changes when selected option did not change [\#14788](https://github.com/primefaces/primeng/issues/14788)
- Password: Hand/Pointer icon not displayed while hovering over the eye icon in password ToggleMask mode [\#14724](https://github.com/primefaces/primeng/issues/14724)
- Component: p-dropdown filterValue initial value is ignored and binding not working [\#14586](https://github.com/primefaces/primeng/issues/14586)
- ContextMenu: Double opacity applied to disabled items [\#14773](https://github.com/primefaces/primeng/issues/14773)
- dropdown: selected, disabled option not rendered [\#14716](https://github.com/primefaces/primeng/issues/14716)
- TreeSelect: Incorrect alignment in TreeSelect on filter [\#14764](https://github.com/primefaces/primeng/issues/14764)
- Multiselect: headerCheckboxViewChild not found [\#14737](https://github.com/primefaces/primeng/issues/14737)
- MultiSelect: Incorrect Alignment in multiselect dropdown on filter [\#14755](https://github.com/primefaces/primeng/issues/14755)
- Multiselect with string array search not working [\#12854](https://github.com/primefaces/primeng/issues/12854)
- Chips and Timeline: Typo error 'seperator' instead 'separator' [\#14783](https://github.com/primefaces/primeng/issues/14783)
- Remove CodeSandbox from the examples. [\#14792](https://github.com/primefaces/primeng/issues/14792)
- p-chips: [addOnTab] feature has no effect. Tab key should make a chip and keep focus in the text box. [\#14706](https://github.com/primefaces/primeng/issues/14706)

## [17.6.0](https://github.com/primefaces/primeng/tree/17.6.0) (2024-02-07)

[Full Changelog](https://github.com/primefaces/primeng/compare/17.5.0...17.6.0)

**Implemented New Features and Enhancements:**
- Dropdown | make clear method public for better DX [\#14641](https://github.com/primefaces/primeng/issues/14641)

**Fixed bugs:**
- MultiSelect: selectedItemsLabel is not localized (re-opened) [\#14554](https://github.com/primefaces/primeng/issues/14554)
- Component: Calendar isn't show initial value from FormControl/ngModel [\#14616](https://github.com/primefaces/primeng/issues/14616)
- Component: Dropdown removing a letter from filter that comes after a whitespace ' ' removes the whitespace [\#14701](https://github.com/primefaces/primeng/issues/14701)
- Component: p-multiselect - double click on multiselect "button" causes modal window to jump around before disappearing [\#14442](https://github.com/primefaces/primeng/issues/14442)
- Virtual Scroll Jumping Backwards [\#14298](https://github.com/primefaces/primeng/issues/14298)
- p-dropdown: dropdown options float to the top when searching [\#14659](https://github.com/primefaces/primeng/issues/14659)
- Dropdown: Key events not correctly working when filter is enabled [\#14189](https://github.com/primefaces/primeng/issues/14189)
- Component: Dropdown| closing overlay on pressing enter key on filter input [\#14708](https://github.com/primefaces/primeng/issues/14708)
- Component: p-Dropdown placeholder/values not displayed [\#14695](https://github.com/primefaces/primeng/issues/14695)
- TreeSelect: When using reactive form disabled input doesn't affect [\#14662](https://github.com/primefaces/primeng/issues/14662)
- MultiSelect: dynamic text in placeholder is not displayed [\#14321](https://github.com/primefaces/primeng/issues/14321)
- Dropdown: dynamic text in placeholder is not displayed [\#14320](https://github.com/primefaces/primeng/issues/14320)
- Component: Dropdown TypeError: option.toLowerCase is not a function [\#14682](https://github.com/primefaces/primeng/issues/14682)
- Dropdown: "0" Value in optionValue, causes Label to be replaced by Placeholder [\#14715](https://github.com/primefaces/primeng/issues/14715)
- The scrollToIndex method on VirtualScroller does not scroll to the correct index when triggered twice. [\#14731](https://github.com/primefaces/primeng/issues/14731)
- Checkbox: Disabled property does not work when it's used with formControlName [\#14693](https://github.com/primefaces/primeng/issues/14693)
- PrimeNg p-columnFilter does not close on outside element click or scroll or search submit [\#14658](https://github.com/primefaces/primeng/issues/14658)
- Showcase | Remove stateful config [\#14752](https://github.com/primefaces/primeng/issues/14752)


## [17.5.0](https://github.com/primefaces/primeng/tree/17.5.0) (2024-02-01)

[Full Changelog](https://github.com/primefaces/primeng/compare/17.4.0...17.5.0)

**Implemented New Features and Enhancements:**
- AutoComplete | Description in the accessibility section for tab not working [\#14641](https://github.com/primefaces/primeng/issues/14641)

**Fixed bugs:**
- Component: InputNumber does not validate max on blur [\#14630](https://github.com/primefaces/primeng/issues/14630)
- p-dropdown: Filtering all items incorrectly clears the dropdown's selected value [\#14596](https://github.com/primefaces/primeng/issues/14596)
- Component: Dropdown [\#14367](https://github.com/primefaces/primeng/issues/14367)
- paginator missing p-paginator-top/bottom class [\#14679](https://github.com/primefaces/primeng/issues/14679)
- Component: Placeholder not working in dropdown Reactive Forms and Template [\#14679](https://github.com/primefaces/primeng/issues/14679)
- TabView with scrollable throws an exception [\#13332](https://github.com/primefaces/primeng/issues/13332)
- Component: TreeTable, dragging over table cells [\#14512](https://github.com/primefaces/primeng/issues/14512)
- p-calendar: validation is triggered before calendar is even touched [\#14542](https://github.com/primefaces/primeng/issues/14542)
- Referencing closed thread -> Responsive Stack and add [scrollable]="true" not working responsive stack #11331 [\#14667](https://github.com/primefaces/primeng/issues/14667)
- Table: built-in Ctrl+A errors when "rows" parameter is defined [\#14634](https://github.com/primefaces/primeng/issues/14634)
- p-autocomplete: maxlength doesn't work anymore [\#14595](https://github.com/primefaces/primeng/issues/14595)
- Dropdown: autoOptionFocus property not working [\#14655](https://github.com/primefaces/primeng/issues/14655)
- Dropdown: Unable to type in editable Dropdowns when filtering options onChange and current value is an option [\#14556](https://github.com/primefaces/primeng/issues/14556)
- p-MultiSelect: Clear Button does not work [\#14585](https://github.com/primefaces/primeng/issues/14585)
- Calendar: Calendar CSS breaks other Components [\#14606](https://github.com/primefaces/primeng/issues/14606)

## [17.4.0](https://github.com/primefaces/primeng/tree/17.4.0) (2024-01-24)

[Full Changelog](https://github.com/primefaces/primeng/compare/17.3.3...17.4.0)

**Implemented New Features and Enhancements:**
- MultiSelect: selectedItemsLabel is not localized [\#14554](https://github.com/primefaces/primeng/issues/14554)

**Fixed bugs:**
- p-columnFilter: Missing icons to the table column filter dialog [\#14613](https://github.com/primefaces/primeng/issues/14613)
- p-multiselect: Displaying the multiselect options dialog causes page to horizontally scroll [\#14611](https://github.com/primefaces/primeng/issues/14611)
- p-calendar: Doesn't close on date selection in range mode [\#14558](https://github.com/primefaces/primeng/issues/14558)
- ConfirmPopup arror right side rendering defect [\#14557](https://github.com/primefaces/primeng/issues/14557)
- Dropdown: can't select input with Shift + Home / Shift + End [\#14540](https://github.com/primefaces/primeng/issues/14540)
- TreeTable: StyleClass wont apply [\#14559](https://github.com/primefaces/primeng/issues/14559)
- p-dropdown: optionValue is not working when object has property 'group' [\#14516](https://github.com/primefaces/primeng/issues/14516)
- Table pSelectableRow: cannot type space into an pInputText component [\#14531](https://github.com/primefaces/primeng/issues/14531)
- p-dropdown: Cannot clear dropdown programmatically [\#14544](https://github.com/primefaces/primeng/issues/14544)

## [17.3.3](https://github.com/primefaces/primeng/tree/17.3.3) (2024-01-18)

[Full Changelog](https://github.com/primefaces/primeng/compare/17.3.2...17.3.3)
Expand Down Expand Up @@ -200,6 +294,12 @@
- TypeError: this.focusedItemInfo.mutate is not a function [\#14119](https://github.com/primefaces/primeng/issues/14119)
- Upgrade to Angular 17? [\#14063](https://github.com/primefaces/primeng/issues/14063)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [16.9.5-LTS](https://www.npmjs.com/package/primeng/v/16.9.5-lts) (2024-02-07)

**Fixed bugs:**
- The scrollToIndex method on VirtualScroller does not scroll to the correct index when triggered twice. [\#14731](https://github.com/primefaces/primeng/issues/14731)
- Checkbox: Disabled property does not work when it's used with formControlName [\#14693](https://github.com/primefaces/primeng/issues/14693)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [16.9.4-LTS](https://www.npmjs.com/package/primeng/v/16.9.4-lts) (2024-01-19)

**Fixed bugs:**
Expand Down Expand Up @@ -747,6 +847,12 @@
- Checkbox in p-treeNode always checked when using custom icon [\#12951](https://github.com/primefaces/primeng/issues/12951)
- ConfirmDialog: Duplicated AcceptIcons [\#13001](https://github.com/primefaces/primeng/issues/13001)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [15.4.16-LTS](https://www.npmjs.com/package/primeng/v/15.4.16-lts) (2024-02-07)

**Fixed bugs:**
- The scrollToIndex method on VirtualScroller does not scroll to the correct index when triggered twice. [\#14731](https://github.com/primefaces/primeng/issues/14731)
- Checkbox: Disabled property does not work when it's used with formControlName [\#14693](https://github.com/primefaces/primeng/issues/14693)

## ![LTS](https://www.primefaces.org/wp-content/uploads/2020/01/lts-icon-24.png "PrimeNG LTS") [15.4.15-LTS](https://www.npmjs.com/package/primeng/v/15.4.15-lts) (2024-01-19)

**Fixed bugs:**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "primeng",
"version": "17.3.3",
"version": "17.7.0",
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
"ng": "ng",
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export class AccordionTab implements AfterContentInit, OnDestroy {
case 'Enter':
case 'Space':
this.toggle(event);
event.preventDefault(); // ???
event.preventDefault();
break;
default:
break;
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/api/primengconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export class PrimeNGConfig {
zoomIn: 'Zoom In',
zoomOut: 'Zoom Out',
rotateRight: 'Rotate Right',
rotateLeft: 'Rotate Left'
rotateLeft: 'Rotate Left',
listLabel: 'Option List'
}
};

Expand Down
1 change: 1 addition & 0 deletions src/app/components/api/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,5 @@ export interface Aria {
zoomOut?: string;
rotateRight?: string;
rotateLeft?: string;
listLabel?: string;
}
6 changes: 4 additions & 2 deletions src/app/components/api/translationkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export class TranslationKeys {
public static readonly PASSWORD_PROMPT = 'passwordPrompt';
public static readonly EMPTY_MESSAGE = 'emptyMessage';
public static readonly EMPTY_FILTER_MESSAGE = 'emptyFilterMessage';
public static readonly SHOW_FILTER_MENU = 'Show Filter Menu';
public static readonly HIDE_FILTER_MENU = 'Hide Filter Menu';
public static readonly SHOW_FILTER_MENU = 'showFilterMenu';
public static readonly HIDE_FILTER_MENU = 'hideFilterMenu';
public static readonly SELECTION_MESSAGE = 'selectionMessage';
public static readonly ARIA = 'aria';
}
14 changes: 9 additions & 5 deletions src/app/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
ViewEncapsulation
} from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { OverlayOptions, OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule } from 'primeng/api';
import { OverlayOptions, OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys } from 'primeng/api';
import { AutoFocusModule } from 'primeng/autofocus';
import { ButtonModule } from 'primeng/button';
import { ConnectedOverlayScrollHandler, DomHandler } from 'primeng/dom';
Expand Down Expand Up @@ -219,7 +219,7 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = {
</ng-container>
<ng-template #buildInItems let-items let-scrollerOptions="options">
<ul #items class="p-autocomplete-items" [ngClass]="scrollerOptions.contentStyleClass" [style]="scrollerOptions.contentStyle" role="listbox" [attr.id]="id + '_list'">
<ul #items class="p-autocomplete-items" [ngClass]="scrollerOptions.contentStyleClass" [style]="scrollerOptions.contentStyle" role="listbox" [attr.id]="id + '_list'" [attr.aria-label]="listLabel">
<ng-template ngFor let-option [ngForOf]="items" let-i="index">
<ng-container *ngIf="isOptionGroup(option)">
<li [attr.id]="id + '_' + getOptionIndex(i, scrollerOptions)" class="p-autocomplete-item-group" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }" role="option">
Expand Down Expand Up @@ -467,7 +467,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
* Whether to show the empty message or not.
* @group Props
*/
@Input() showEmptyMessage: boolean | undefined;
@Input() showEmptyMessage: boolean | undefined = true;
/**
* Specifies the behavior dropdown button. Default "blank" mode sends an empty string and "current" mode sends the input value.
* @group Props
Expand Down Expand Up @@ -583,7 +583,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
* Whether to focus on the first visible or selected element when the overlay panel is shown.
* @group Props
*/
@Input() autoOptionFocus: boolean | undefined = true;
@Input() autoOptionFocus: boolean | undefined = false;
/**
* When enabled, the focused option is selected.
* @group Props
Expand Down Expand Up @@ -846,6 +846,10 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
return this.visibleOptions().filter((option) => !this.isOptionGroup(option)).length;
}

get listLabel(): string {
return this.config.getTranslation(TranslationKeys.ARIA)['listLabel'];
}

get virtualScrollerDisabled() {
return !this.virtualScroll;
}
Expand Down Expand Up @@ -1061,7 +1065,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr
clearTimeout(this.searchTimeout);
}

let query = event.target.value;
let query = event.target.value.split('').slice(0, this.maxlength).join('');

if (!this.multiple && !this.forceSelection) {
this.updateModel(query);
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ export class Button implements AfterContentInit {

@ContentChildren(PrimeTemplate) templates: QueryList<PrimeTemplate> | undefined;

constructor(public el: ElementRef) {}

spinnerIconClass(): string {
return Object.entries(this.iconClass())
.filter(([, value]) => !!value)
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/calendar/calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
cursor: pointer;
}

.p-icon-wrapper {
.p-datepicker-icon {
pointer-events: none;
}

Expand Down
16 changes: 11 additions & 5 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ export const CALENDAR_VALUE_ACCESSOR: any = {
</ng-container>
</button>
<ng-container *ngIf="iconDisplay === 'input' && showIcon">
<CalendarIcon *ngIf="!inputIconTemplate" (click)="onButtonClick($event)" />
<CalendarIcon
(click)="onButtonClick($event)"
*ngIf="!inputIconTemplate"
[ngClass]="{
'p-datepicker-icon': showOnFocus
}"
/>
<ng-container *ngTemplateOutlet="inputIconTemplate; context: { clickCallBack: onButtonClick.bind(this) }"></ng-container>
</ng-container>
</ng-template>
Expand Down Expand Up @@ -1486,7 +1492,7 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
}
}

if (this.isSingleSelection() && this.hideOnDateTimeSelect) {
if ((this.isSingleSelection() && this.hideOnDateTimeSelect) || (this.isRangeSelection() && this.value[1])) {
setTimeout(() => {
event.preventDefault();
this.hideOverlay();
Expand Down Expand Up @@ -1575,6 +1581,8 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
formattedValue += ' ' + this.formatTime(date);
}
}
} else if (this.dataType === 'string') {
formattedValue = date;
}

return formattedValue;
Expand Down Expand Up @@ -3008,9 +3016,7 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
}
}
}
if (this.dataType === 'string') {
this.updateModel(value);
}

this.updateInputfield();
this.updateUI();
this.cd.markForCheck();
Expand Down
17 changes: 14 additions & 3 deletions src/app/components/cascadeselect/cascadeselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
ViewEncapsulation
} from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { OverlayOptions, OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule } from 'primeng/api';
import { OverlayOptions, OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys } from 'primeng/api';
import { DomHandler } from 'primeng/dom';
import { AngleRightIcon } from 'primeng/icons/angleright';
import { ChevronDownIcon } from 'primeng/icons/chevrondown';
Expand All @@ -43,7 +43,14 @@ export const CASCADESELECT_VALUE_ACCESSOR: any = {
@Component({
selector: 'p-cascadeSelectSub',
template: `
<ul class="p-cascadeselect-panel p-cascadeselect-items" [ngClass]="{ 'p-cascadeselect-panel-root': root }" [attr.role]="role" aria-orientation="horizontal" [attr.data-pc-section]="level === 0 ? 'list' : 'sublist'">
<ul
class="p-cascadeselect-panel p-cascadeselect-items"
[ngClass]="{ 'p-cascadeselect-panel-root': root }"
[attr.role]="role"
aria-orientation="horizontal"
[attr.data-pc-section]="level === 0 ? 'list' : 'sublist'"
[attr.aria-label]="listLabel"
>
<ng-template ngFor let-processedOption [ngForOf]="options" let-i="index">
<li
[ngClass]="getItemClass(processedOption)"
Expand Down Expand Up @@ -126,7 +133,11 @@ export class CascadeSelectSub implements OnInit {

@Output() onChange: EventEmitter<any> = new EventEmitter();

constructor(private el: ElementRef) {}
get listLabel(): string {
return this.config.getTranslation(TranslationKeys.ARIA)['listLabel'];
}

constructor(private el: ElementRef, public config: PrimeNGConfig) {}

ngOnInit() {
if (!this.root) {
Expand Down
4 changes: 3 additions & 1 deletion src/app/components/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ export class Checkbox implements ControlValueAccessor {
}

setDisabledState(val: boolean): void {
this.disabled = val;
setTimeout(() => {
this.disabled = val;
});
this.cd.markForCheck();
}

Expand Down
Loading

0 comments on commit bc5d47a

Please sign in to comment.