Skip to content

Commit

Permalink
Merge branch 'primefaces:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
nitedani authored Sep 2, 2022
2 parents 18798f0 + c86e685 commit 858723c
Show file tree
Hide file tree
Showing 62 changed files with 236 additions and 145 deletions.
23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## [14.0.2](https://github.com/primefaces/primeng/tree/14.0.2) (2022-08-24)

[Full Changelog](https://github.com/primefaces/primeng/compare/14.0.1...14.0.2)

**Fixed bugs:**
- Table Sticky Footer doesn't work with VirtualScroll on DataTable [\#11819](https://github.com/primefaces/primeng/issues/11819)
- Table | ColumnFilter overlay not closing after clicked an input element inside the container [\#11822](https://github.com/primefaces/primeng/issues/11822)
- pColumnFilter | Filter is applied by adding a new constraint [\#11841](https://github.com/primefaces/primeng/issues/11841)
- Table | LazyLoad emits before onPage event [\#11843](https://github.com/primefaces/primeng/issues/11843)
- Accordion Panel within an Accordion Panel is broken [\#11848](https://github.com/primefaces/primeng/issues/11848)
- TabView | inkbar does not work correctly [\#11855](https://github.com/primefaces/primeng/issues/11855)
- Table | Header and Footer have no background color with virtualScroller [\#11858](https://github.com/primefaces/primeng/issues/11858)
- p-autoComplete : onHide firing on destroy [\#11839](https://github.com/primefaces/primeng/issues/11839)
- Dropdown: Allow empty string while not showing clear button [\#11836](https://github.com/primefaces/primeng/issues/11836)
- Editor: Not displaying content correctly in dialog [\#11814](https://github.com/primefaces/primeng/issues/11814)
- FileUpload | The error message does not disappear correctly when removing file(s), to match your file limit [\#11799](https://github.com/primefaces/primeng/issues/11799)
- TreeSelect: style and type attribute of TreeNode API doesn't work [\#11761](https://github.com/primefaces/primeng/issues/11761)
- p-radioButton: can't get the value from onClick event [\#11861](https://github.com/primefaces/primeng/issues/11861)

## [14.0.1](https://github.com/primefaces/primeng/tree/14.0.1) (2022-08-11)

[Full Changelog](https://github.com/primefaces/primeng/compare/14.0.0...14.0.1)
Expand Down Expand Up @@ -29,7 +48,7 @@
- p-calendar is hidden while in a p-panel [\#11685](https://github.com/primefaces/primeng/issues/11685)
- Badge: Whitespaces are added before & after string [\#11627](https://github.com/primefaces/primeng/issues/11627)
- P-Tree: Duplicated render [\#11669](https://github.com/primefaces/primeng/issues/11669)
- The scrollTo method is not working as expected on Scroller API [\#11669](https://github.com/primefaces/primeng/issues/11669)
- The scrollTo method is not working as expected on Scroller API [\#11675](https://github.com/primefaces/primeng/issues/11675)
- Dropdown: Options grouping feature is not working [\#11672](https://github.com/primefaces/primeng/issues/11672)

## [14.0.0-rc.1](https://github.com/primefaces/primeng/tree/14.0.0-rc.1) (2022-06-29)
Expand Down Expand Up @@ -59,7 +78,7 @@

**Fixed bugs:**
- Dropdown method "show" not working [\#11648](https://github.com/primefaces/primeng/issues/11648)
- Scrolling in a t-table that implements virtual scrolling and lazy loading bugs out the header of the t-table [\#11617](https://github.com/primefaces/primeng/issues/11617)
- Scrolling in a t-table that implements virtual scrolling and lazy loading bugs out the header of the t-table [\#10630](https://github.com/primefaces/primeng/issues/10630)
- Dropdown | ng-dirty issue when options are set by a service call [\#11634](https://github.com/primefaces/primeng/issues/11634)
- Dialog bottom has no border radius when footer does not exist [\#11626](https://github.com/primefaces/primeng/issues/11626)
- AutoComplete showClear is not working when dropdown is enabled [\#11592](https://github.com/primefaces/primeng/issues/11592)
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": "14.0.2-SNAPSHOT",
"version": "14.0.3-SNAPSHOT",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down
4 changes: 0 additions & 4 deletions src/app/components/accordion/accordion.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
line-height: 1;
}

.p-accordion-tab-active .p-toggleable-content:not(.ng-animating) {
overflow: visible;
}

.p-accordion .p-toggleable-content{
overflow: hidden;
}
1 change: 1 addition & 0 deletions src/app/components/api/treenode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface TreeNode<T = any> {
type?: string;
parent?: TreeNode<T>;
partialSelected?: boolean;
style?: string;
styleClass?: string;
draggable?: boolean;
droppable?: boolean;
Expand Down
6 changes: 4 additions & 2 deletions src/app/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,10 @@ export class AutoComplete implements AfterViewChecked,AfterContentInit,OnDestroy
this.unbindDocumentClickListener();
this.unbindDocumentResizeListener();
this.unbindScrollListener();
this.overlay = null;
this.onHide.emit();
if (this.overlay) {
this.overlay = null;
this.onHide.emit();
}
}

ngOnDestroy() {
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class DropdownItem {
<span [ngClass]="{'p-dropdown-label p-inputtext p-placeholder':true,'p-dropdown-label-empty': (placeholder == null || placeholder.length === 0)}" *ngIf="!editable && (label == null)">{{placeholder||'empty'}}</span>
<input #editableInput type="text" [attr.maxlength]="maxlength" class="p-dropdown-label p-inputtext" *ngIf="editable" [disabled]="disabled" [attr.placeholder]="placeholder"
aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible" (click)="onEditableInputClick()" (input)="onEditableInputChange($event)" (focus)="onEditableInputFocus($event)" (blur)="onInputBlur($event)">
<i class="p-dropdown-clear-icon pi pi-times" (click)="clear($event)" *ngIf="value != null && showClear && !disabled"></i>
<i class="p-dropdown-clear-icon pi pi-times" (click)="clear($event)" *ngIf="isVisibleClearIcon"></i>
<div class="p-dropdown-trigger" role="button" aria-label="dropdown trigger" aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible">
<span class="p-dropdown-trigger-icon" [ngClass]="dropdownIcon"></span>
</div>
Expand Down Expand Up @@ -536,6 +536,10 @@ export class Dropdown implements OnInit,AfterViewInit,AfterContentInit,AfterView
return this.value || this.value != null || this.value != undefined;
}

get isVisibleClearIcon(): boolean {
return (this.value != null && this.value !== '') && this.showClear && !this.disabled;
}

updateEditableLabel(): void {
if (this.editableInputViewChild && this.editableInputViewChild.nativeElement) {
this.editableInputViewChild.nativeElement.value = (this.selectedOption ? this.getOptionLabel(this.selectedOption) : this.value||'');
Expand Down
129 changes: 77 additions & 52 deletions src/app/components/editor/editor.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {NgModule,Component,ElementRef,AfterViewInit,Input,Output,EventEmitter,ContentChild,forwardRef,ChangeDetectionStrategy, ViewEncapsulation, ContentChildren, QueryList, AfterContentInit, TemplateRef} from '@angular/core';
import {NgModule,Component,ElementRef,AfterViewInit,Input,Output,EventEmitter,ContentChild,forwardRef,ChangeDetectionStrategy,ViewEncapsulation,ContentChildren,QueryList,AfterContentInit,TemplateRef,AfterViewChecked} from '@angular/core';
import {CommonModule} from '@angular/common';
import {SharedModule,Header, PrimeTemplate} from 'primeng/api'
import {DomHandler} from 'primeng/dom';
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';
import Quill from "quill";
import Quill from 'quill';

export const EDITOR_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -71,7 +71,7 @@ export const EDITOR_VALUE_ACCESSOR: any = {
'class': 'p-element'
}
})
export class Editor implements AfterViewInit,AfterContentInit,ControlValueAccessor {
export class Editor implements AfterViewInit,AfterViewChecked,AfterContentInit,ControlValueAccessor {

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

Expand Down Expand Up @@ -111,14 +111,78 @@ export class Editor implements AfterViewInit,AfterContentInit,ControlValueAccess

headerTemplate: TemplateRef<any>;

private quillElements: {editorElement: HTMLElement, toolbarElement: HTMLElement} | null = null;

constructor(public el: ElementRef) {}

ngAfterViewInit() {
let editorElement = DomHandler.findSingle(this.el.nativeElement ,'div.p-editor-content');
let toolbarElement = DomHandler.findSingle(this.el.nativeElement ,'div.p-editor-toolbar');
ngAfterViewInit(): void {
this.initQuillElements();

if (this.quillElements?.editorElement?.isConnected) {
this.initQuillEditor();
}
}

ngAfterViewChecked(): void {
if (!this.quill && this.quillElements?.editorElement?.isConnected) {
this.initQuillEditor();
}
}

ngAfterContentInit() {
this.templates.forEach((item) => {
switch(item.getType()) {
case 'header':
this.headerTemplate = item.template;
break;
}
});
}

writeValue(value: any) : void {
this.value = value;

if (this.quill) {
if (value)
this.quill.setContents(this.quill.clipboard.convert(value));
else
this.quill.setText('');
}
}

registerOnChange(fn: Function): void {
this.onModelChange = fn;
}

registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

getQuill() {
return this.quill;
}

@Input() get readonly(): boolean {
return this._readonly;
}

set readonly(val:boolean) {
this._readonly = val;

if (this.quill) {
if (this._readonly)
this.quill.disable();
else
this.quill.enable();
}
}

private initQuillEditor(): void {
this.initQuillElements();

const { toolbarElement, editorElement } = this.quillElements;
let defaultModule = {toolbar: toolbarElement};
let modules = this.modules ? {...defaultModule, ...this.modules} : defaultModule;

this.quill = new Quill(editorElement, {
modules: modules,
placeholder: this.placeholder,
Expand Down Expand Up @@ -167,51 +231,12 @@ export class Editor implements AfterViewInit,AfterContentInit,ControlValueAccess
});
}

ngAfterContentInit() {
this.templates.forEach((item) => {
switch(item.getType()) {
case 'header':
this.headerTemplate = item.template;
break;
}
});
}

writeValue(value: any) : void {
this.value = value;

if (this.quill) {
if (value)
this.quill.setContents(this.quill.clipboard.convert(value));
else
this.quill.setText('');
}
}

registerOnChange(fn: Function): void {
this.onModelChange = fn;
}

registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

getQuill() {
return this.quill;
}

@Input() get readonly(): boolean {
return this._readonly;
}

set readonly(val:boolean) {
this._readonly = val;

if (this.quill) {
if (this._readonly)
this.quill.disable();
else
this.quill.enable();
private initQuillElements(): void {
if (!this.quillElements) {
this.quillElements = {
editorElement: DomHandler.findSingle(this.el.nativeElement ,'div.p-editor-content'),
toolbarElement: DomHandler.findSingle(this.el.nativeElement ,'div.p-editor-toolbar')
};
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/fileupload/fileupload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ export class FileUpload implements AfterViewInit,AfterContentInit,OnInit,OnDestr
this.clearInputElement();
this.onRemove.emit({originalEvent: event, file: this.files[index]});
this.files.splice(index, 1);
this.checkFileLimit();
}

isFileLimitExceeded() {
Expand All @@ -462,6 +463,8 @@ export class FileUpload implements AfterViewInit,AfterContentInit,OnInit,OnDestr
summary: this.invalidFileLimitMessageSummary.replace('{0}', this.fileLimit.toString()),
detail: this.invalidFileLimitMessageDetail.replace('{0}', this.fileLimit.toString())
});
} else {
this.msgs = [];
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/app/components/inputmask/inputmask.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ describe('InputMask', () => {
inputmask.size = 5;
inputmask.tabindex = "1";
inputmask.required = true;
inputmask.autoFocus = true;
inputmask.title = "TheTitle";
fixture.detectChanges();

Expand All @@ -66,7 +65,6 @@ describe('InputMask', () => {
expect(inputMaskEl.nativeElement.size).toEqual(5);
expect(inputMaskEl.nativeElement.tabIndex).toEqual(1);
expect(inputMaskEl.nativeElement.required).toBeTruthy();
expect(inputMaskEl.nativeElement.autofocus).toBeTruthy();
expect(inputMaskEl.nativeElement.title).toEqual("TheTitle");
});

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "primeng",
"version": "14.0.1",
"version": "14.0.2",
"repository": {
"type": "git",
"url": "https://github.com/primefaces/primeng"
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/radiobutton/radiobutton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class RadioButton implements ControlValueAccessor, OnInit, OnDestroy {
this.checked = true;
this.onModelChange(this.value);
this.registry.select(this);
this.onClick.emit(event);
this.onClick.emit({originalEvent: event, value: this.value});
}
}

Expand Down
9 changes: 4 additions & 5 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -865,15 +865,15 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
this.first = event.first;
this.rows = event.rows;

if (this.lazy) {
this.onLazyLoad.emit(this.createLazyLoadMetadata());
}

this.onPage.emit({
first: this.first,
rows: this.rows
});

if (this.lazy) {
this.onLazyLoad.emit(this.createLazyLoadMetadata());
}

this.firstChange.emit(this.first);
this.rowsChange.emit(this.rows);
this.tableService.onValueChange(this.value);
Expand Down Expand Up @@ -4612,7 +4612,6 @@ export class ColumnFilter implements AfterContentInit {

addConstraint() {
(<FilterMetadata[]> this.dt.filters[this.field]).push({value: null, matchMode: this.getDefaultMatchMode(), operator: this.getDefaultOperator()});
this.dt._filter();
}

removeConstraint(filterMeta: FilterMetadata) {
Expand Down
Loading

0 comments on commit 858723c

Please sign in to comment.