Skip to content

Commit

Permalink
Merge branch 'primefaces:master' into split-button
Browse files Browse the repository at this point in the history
  • Loading branch information
pouyababaie authored Mar 24, 2024
2 parents 73a2c67 + 7e17d57 commit f2741bb
Show file tree
Hide file tree
Showing 357 changed files with 204,593 additions and 22,858 deletions.
256 changes: 256 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}
15,813 changes: 7,888 additions & 7,925 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "primeng",
"version": "17.3.3",
"version": "17.12.0",
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
"ng": "ng",
Expand All @@ -23,23 +23,23 @@
"url": "https://github.com/primefaces/primeng.git"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.0.5",
"@angular-eslint/eslint-plugin": "17.1.1",
"@angular-eslint/eslint-plugin-template": "17.1.1",
"@angular-eslint/schematics": "17.1.1",
"@angular-eslint/template-parser": "17.1.1",
"@angular/animations": "^17.0.5",
"@angular/cdk": "^17.0.2",
"@angular/cli": "^17.0.5",
"@angular/common": "^17.0.5",
"@angular/compiler": "^17.0.5",
"@angular/compiler-cli": "^17.0.5",
"@angular/core": "^17.0.5",
"@angular/forms": "^17.0.5",
"@angular/platform-browser": "^17.0.5",
"@angular/platform-browser-dynamic": "^17.0.5",
"@angular/platform-server": "^17.0.5",
"@angular/router": "^17.0.5",
"@angular-devkit/build-angular": "^17.3.1",
"@angular-eslint/eslint-plugin": "17.3.0",
"@angular-eslint/eslint-plugin-template": "17.3.0",
"@angular-eslint/schematics": "17.3.0",
"@angular-eslint/template-parser": "17.3.0",
"@angular/animations": "^17.3.1",
"@angular/cdk": "^17.3.1",
"@angular/cli": "^17.3.1",
"@angular/common": "^17.3.1",
"@angular/compiler": "^17.3.1",
"@angular/compiler-cli": "^17.3.1",
"@angular/core": "^17.3.1",
"@angular/forms": "^17.3.1",
"@angular/platform-browser": "^17.3.1",
"@angular/platform-browser-dynamic": "^17.3.1",
"@angular/platform-server": "^17.3.1",
"@angular/router": "^17.3.1",
"@stackblitz/sdk": "1.9.0",
"@types/express": "^4.17.17",
"@types/jasmine": "~4.3.1",
Expand Down Expand Up @@ -72,7 +72,7 @@
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"ng-packagr": "^17.0.2",
"ng-packagr": "^17.2.0",
"prettier": "2.8.8",
"primeflex": "^3.3.1",
"primeicons": "^6.0.1",
Expand All @@ -85,7 +85,7 @@
"typescript": "5.2.2",
"xlsx": "^0.18.5",
"zone.js": "~0.14.0",
"@angular/ssr": "^17.0.5",
"@angular/ssr": "^17.3.1",
"@docsearch/js": "^3.3.4",
"esbuild": "^0.19.8"
}
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
10 changes: 5 additions & 5 deletions src/app/components/api/primeicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,20 @@ export class PrimeIcons {
public static readonly SLIDERS_V = 'pi pi-sliders-v';
public static readonly SORT = 'pi pi-sort';
public static readonly SORT_ALPHA_DOWN = 'pi pi-sort-alpha-down';
public static readonly SORT_ALPHA_ALT_DOWN = 'pi pi-sort-alpha-alt-down';
public static readonly SORT_ALPHA_DOWN_ALT = 'pi pi-sort-alpha-down-alt';
public static readonly SORT_ALPHA_UP = 'pi pi-sort-alpha-up';
public static readonly SORT_ALPHA_ALT_UP = 'pi pi-sort-alpha-alt-up';
public static readonly SORT_ALPHA_UP_ALT = 'pi pi-sort-alpha-up-alt';
public static readonly SORT_ALT = 'pi pi-sort-alt';
public static readonly SORT_ALT_SLASH = 'pi pi-sort-slash';
public static readonly SORT_ALT_SLASH = 'pi pi-sort-alt-slash';
public static readonly SORT_AMOUNT_DOWN = 'pi pi-sort-amount-down';
public static readonly SORT_AMOUNT_DOWN_ALT = 'pi pi-sort-amount-down-alt';
public static readonly SORT_AMOUNT_UP = 'pi pi-sort-amount-up';
public static readonly SORT_AMOUNT_UP_ALT = 'pi pi-sort-amount-up-alt';
public static readonly SORT_DOWN = 'pi pi-sort-down';
public static readonly SORT_NUMERIC_DOWN = 'pi pi-sort-numeric-down';
public static readonly SORT_NUMERIC_ALT_DOWN = 'pi pi-sort-numeric-alt-down';
public static readonly SORT_NUMERIC_DOWN_ALT = 'pi pi-sort-numeric-down-alt';
public static readonly SORT_NUMERIC_UP = 'pi pi-sort-numeric-up';
public static readonly SORT_NUMERIC_ALT_UP = 'pi pi-sort-numeric-alt-up';
public static readonly SORT_NUMERIC_UP_ALT = 'pi pi-sort-numeric-up-alt';
public static readonly SORT_UP = 'pi pi-sort-up';
public static readonly SPINNER = 'pi pi-spinner';
public static readonly STAR = 'pi pi-star';
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/api/primengconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ export class PrimeNGConfig {
zoomIn: 'Zoom In',
zoomOut: 'Zoom Out',
rotateRight: 'Rotate Right',
rotateLeft: 'Rotate Left'
rotateLeft: 'Rotate Left',
listLabel: 'Option List',
selectColor: 'Select a color',
removeLabel: 'Remove',
browseFiles: 'Browse Files'
}
};

Expand Down
4 changes: 4 additions & 0 deletions src/app/components/api/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,8 @@ export interface Aria {
zoomOut?: string;
rotateRight?: string;
rotateLeft?: string;
listLabel?: string;
selectColor?: string;
removeLabel?: string;
browseFiles?: string;
}
8 changes: 6 additions & 2 deletions src/app/components/api/translationkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ 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';
public static readonly SELECT_COLOR = 'selectColor';
public static readonly BROWSE_FILES = 'browseFiles';
}
28 changes: 18 additions & 10 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 @@ -81,8 +81,8 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = {
[attr.aria-label]="ariaLabel"
[attr.aria-labelledby]="ariaLabelledBy"
[attr.aria-required]="required"
[attr.aria-expanded]="overlayVisible"
[attr.aria-controls]="id + '_list'"
[attr.aria-expanded]="overlayVisible ?? false"
[attr.aria-controls]="overlayVisible ? id + '_list' : null"
[attr.aria-aria-activedescendant]="focused ? focusedOptionId : undefined"
(input)="onInput($event)"
(keydown)="onKeyDown($event)"
Expand Down Expand Up @@ -155,8 +155,8 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = {
[attr.aria-label]="ariaLabel"
[attr.aria-labelledby]="ariaLabelledBy"
[attr.aria-required]="required"
[attr.aria-expanded]="overlayVisible"
[attr.aria-controls]="id + '_list'"
[attr.aria-expanded]="overlayVisible ?? false"
[attr.aria-controls]="overlayVisible ? id + '_list' : null"
[attr.aria-aria-activedescendant]="focused ? focusedOptionId : undefined"
(input)="onInput($event)"
(keydown)="onKeyDown($event)"
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 @@ -256,8 +256,8 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = {
<ng-container #empty *ngTemplateOutlet="emptyTemplate"></ng-container>
</li>
</ul>
<ng-container *ngTemplateOutlet="footerTemplate; context: { $implicit: items }"></ng-container>
</ng-template>
<ng-container *ngTemplateOutlet="footerTemplate"></ng-container>
</div>
<span role="status" aria-live="polite" class="p-hidden-accessible">
{{ selectedMessageText }}
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 Expand Up @@ -1367,6 +1371,10 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr

event.stopPropagation(); // To prevent onBackspaceKeyOnMultiple method
}

if (!this.multiple && this.showClear && this.findSelectedOptionIndex() != -1) {
this.clear();
}
}

onArrowLeftKeyOnMultiple(event) {
Expand Down
18 changes: 10 additions & 8 deletions src/app/components/autofocus/autofocus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ export class AutoFocus {
ngAfterContentChecked() {
if (!this.focused) {
if (this.autofocus) {
const focusableElements = DomHandler.getFocusableElements(this.host.nativeElement);
setTimeout(() => {
const focusableElements = DomHandler.getFocusableElements(this.host.nativeElement);

if (focusableElements.length === 0) {
this.host.nativeElement.focus();
}
if (focusableElements.length > 0) {
focusableElements[0].focus();
}
if (focusableElements.length === 0) {
this.host.nativeElement.focus();
}
if (focusableElements.length > 0) {
focusableElements[0].focus();
}

this.focused = true;
this.focused = true;
});
}
}
}
Expand Down
41 changes: 32 additions & 9 deletions src/app/components/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,55 @@
order: 2;
}

.p-buttonset .p-button {
.p-button-group .p-button {
margin: 0;
}

.p-buttonset .p-button:not(:last-child) {
.p-button-group .p-button:focus,
.p-button-group p-button:focus .p-button,
.p-buttonset .p-button:focus,
.p-buttonset .p-button:focus,
.p-buttonset p-button:focus .p-button,
.p-buttonset .p-button:focus{
position: relative;
z-index: 1;
}

.p-button-group .p-button:not(:last-child),
.p-button-group .p-button:not(:last-child):hover,
.p-button-group p-button:not(:last-child) .p-button,
.p-button-group p-button:not(:last-child) .p-button:hover,
.p-buttonset .p-button:not(:last-child),
.p-buttonset .p-button:not(:last-child):hover,
.p-buttonset p-button:not(:last-child) .p-button,
.p-buttonset p-button:not(:last-child) .p-button:hover {
border-right: 0 none;
}

.p-buttonset .p-button:not(:first-of-type):not(:last-of-type) {
.p-button-group .p-button:not(:first-of-type):not(:last-of-type),
.p-button-group p-button:not(:first-of-type):not(:last-of-type) .p-button,
.p-buttonset .p-button:not(:first-of-type):not(:last-of-type),
.p-buttonset p-button:not(:first-of-type):not(:last-of-type) .p-button {
border-radius: 0;
}

.p-buttonset .p-button:first-of-type {

.p-button-group .p-button:first-of-type:not(:only-of-type),
.p-button-group p-button:first-of-type:not(:only-of-type) .p-button,
.p-buttonset .p-button:first-of-type:not(:only-of-type),
.p-buttonset p-button:first-of-type:not(:only-of-type) .p-button {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}

.p-buttonset .p-button:last-of-type {
.p-button-group .p-button:last-of-type:not(:only-of-type),
.p-button-group p-button:last-of-type:not(:only-of-type) .p-button,
.p-buttonset .p-button:last-of-type:not(:only-of-type),
.p-buttonset p-button:last-of-type:not(:only-of-type) .p-button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}

.p-buttonset .p-button:focus {
position: relative;
z-index: 1;
}

p-button[iconpos='right'] spinnericon {
order: 1;
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
21 changes: 21 additions & 0 deletions src/app/components/buttongroup/buttongroup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, NgModule, ViewEncapsulation } from '@angular/core';

@Component({
selector: 'p-buttonGroup',
template: `
<span class="p-button-group p-component" role="group">
<ng-content></ng-content>
</span>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
})
export class ButtonGroup {}

@NgModule({
imports: [CommonModule],
exports: [ButtonGroup],
declarations: [ButtonGroup]
})
export class ButtonGroupModule {}
6 changes: 6 additions & 0 deletions src/app/components/buttongroup/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "ng-packagr/ng-package.schema.json",
"lib": {
"entryFile": "public_api.ts"
}
}
1 change: 1 addition & 0 deletions src/app/components/buttongroup/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './buttongroup';
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
Loading

0 comments on commit f2741bb

Please sign in to comment.