Skip to content

Commit

Permalink
Merge pull request #14075 from SoyDiego/fix-typo-separator
Browse files Browse the repository at this point in the history
Fix typo "seperator" instead of "separator"
  • Loading branch information
cetincakiroglu authored Nov 22, 2023
2 parents fe5b8b9 + 60a42bf commit 007553f
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 46 deletions.
4 changes: 2 additions & 2 deletions src/app/components/breadcrumb/breadcrumb.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { Breadcrumb } from './breadcrumb';
*/
export interface BreadcumbTemplates {
/**
* Custom template of seperator.
* Custom template of separator.
*/
seperator(): TemplateRef<any>;
separator(): TemplateRef<any>;
}
/**
* Custom select event.
Expand Down
12 changes: 6 additions & 6 deletions src/app/components/calendar/calendar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -925,14 +925,14 @@ describe('Calendar', () => {
inputEl.nativeElement.dispatchEvent(focusEvent);
fixture.detectChanges();

const seperatorEl = fixture.debugElement.queryAll(By.css('.p-separator'));
const separatorEl = fixture.debugElement.queryAll(By.css('.p-separator'));
const secondPicker = fixture.debugElement.query(By.css('.p-second-picker'));
expect(seperatorEl.length).toEqual(2);
expect(separatorEl.length).toEqual(2);
expect(calendar.showSeconds).toBeTruthy();
expect(seperatorEl[0]).toBeTruthy();
expect(seperatorEl[1]).toBeTruthy();
expect(seperatorEl[0].children[0].nativeElement.textContent).toEqual(':');
expect(seperatorEl[1].children[0].nativeElement.textContent).toEqual(':');
expect(separatorEl[0]).toBeTruthy();
expect(separatorEl[1]).toBeTruthy();
expect(separatorEl[0].children[0].nativeElement.textContent).toEqual(':');
expect(separatorEl[1].children[0].nativeElement.textContent).toEqual(':');
expect(secondPicker).toBeTruthy();
expect(secondPicker.queryAll(By.css('span'))[0].nativeElement.textContent).toEqual('21');
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
this.updateEditableLabel();
}

if(visibleOptions && ObjectUtils.isNotEmpty(visibleOptions)) {
if (visibleOptions && ObjectUtils.isNotEmpty(visibleOptions)) {
this.selectedOption = visibleOptions[this.findSelectedOptionIndex()];
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor,
return;
}

event && this.onClick.emit({ originalEvent: event, option, value: this.value, });
event && this.onClick.emit({ originalEvent: event, option, value: this.value });

this.multiple ? this.onOptionSelectMultiple(event, option) : this.onOptionSelectSingle(event, option);
this.optionTouched = false;
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/menu/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe('Menu', () => {
}
});

it('should show seperator', () => {
it('should show separator', () => {
menu.model = [
{
label: 'File',
Expand All @@ -128,9 +128,9 @@ describe('Menu', () => {
];
fixture.detectChanges();

const seperatorEl = fixture.debugElement.query(By.css('.p-menuitem-separator'));
const separatorEl = fixture.debugElement.query(By.css('.p-menuitem-separator'));
const menuItemsEl = fixture.debugElement.queryAll(By.css('li'));
expect(seperatorEl).toBeTruthy();
expect(separatorEl).toBeTruthy();
expect(menuItemsEl.length).toEqual(4);
});

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/splitter/splitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { SplitterResizeEndEvent, SplitterResizeStartEvent } from './splitter.int
<div
*ngIf="i !== panels.length - 1"
class="p-splitter-gutter"
role="seperator"
role="separator"
tabindex="-1"
(mousedown)="onGutterMouseDown($event, i)"
(touchstart)="onGutterTouchStart($event, i)"
Expand Down
22 changes: 15 additions & 7 deletions src/app/components/tabview/tabview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,16 @@ export class TabPanel implements AfterContentInit, OnDestroy {
template: `
<div [ngClass]="{ 'p-tabview p-component': true, 'p-tabview-scrollable': scrollable }" [ngStyle]="style" [class]="styleClass" [attr.data-pc-name]="'tabview'">
<div #elementToObserve class="p-tabview-nav-container">
<button *ngIf="scrollable && !backwardIsDisabled && autoHideButtons" #prevBtn class="p-tabview-nav-prev p-tabview-nav-btn p-link" (click)="navBackward()" [attr.tabindex]="tabindex" [attr.aria-label]="prevButtonAriaLabel" type="button" pRipple>
<button
*ngIf="scrollable && !backwardIsDisabled && autoHideButtons"
#prevBtn
class="p-tabview-nav-prev p-tabview-nav-btn p-link"
(click)="navBackward()"
[attr.tabindex]="tabindex"
[attr.aria-label]="prevButtonAriaLabel"
type="button"
pRipple
>
<ChevronLeftIcon *ngIf="!previousIconTemplate" [attr.aria-hidden]="true" />
<ng-template *ngTemplateOutlet="previousIconTemplate"></ng-template>
</button>
Expand Down Expand Up @@ -473,7 +482,7 @@ export class TabView implements AfterContentInit, AfterViewChecked, OnDestroy, B
resizeObserver: Nullable<ResizeObserver>;

container: HTMLDivElement | undefined;

list: HTMLUListElement | undefined;

buttonVisible: boolean;
Expand Down Expand Up @@ -504,26 +513,25 @@ export class TabView implements AfterContentInit, AfterViewChecked, OnDestroy, B

ngAfterViewInit() {
if (isPlatformBrowser(this.platformId)) {
if(this.autoHideButtons) {
if (this.autoHideButtons) {
this.bindResizeObserver();
}

}
}

bindResizeObserver() {
this.container = DomHandler.findSingle(this.el.nativeElement, '[data-pc-section="navcontent"]');
this.list = DomHandler.findSingle(this.el.nativeElement,'[data-pc-section="nav"]');
this.list = DomHandler.findSingle(this.el.nativeElement, '[data-pc-section="nav"]');

this.resizeObserver = new ResizeObserver(() => {
if(this.list.offsetWidth > this.container.offsetWidth) {
if (this.list.offsetWidth > this.container.offsetWidth) {
this.buttonVisible = true;
} else {
this.buttonVisible = false;
}
this.updateButtonState();
this.cd.detectChanges();
})
});
this.resizeObserver.observe(this.container);
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/showcase/doc/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4664,9 +4664,9 @@
"values": [
{
"parent": "breadcrumb",
"name": "seperator",
"name": "separator",
"parameters": [],
"description": "Custom template of seperator."
"description": "Custom template of separator."
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/showcase/doc/chips/chipsdoc.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import { AppDocModule } from '../../layout/doc/app.doc.module';
import { AppCodeModule } from '../../layout/doc/code/app.code.component';
import { AccessibilityDoc } from './accessibilitydoc';
import { BasicDoc } from './basicdoc';
import { CommaSeperatorDoc } from './commaseperator.doc';
import { CommaSeparatorDoc } from './commaseparator.doc';
import { ImportDoc } from './importdoc';
import { ReactiveFormsDoc } from './reactiveformsdoc';
import { RegexpSeperatorDoc } from './regexpseperator.doc';
import { RegexpSeparatorDoc } from './regexpseparator.doc';
import { StyleDoc } from './styledoc';
import { TemplateDoc } from './templatedoc';
import { MaxValuesDoc } from './maxvaluesdoc';

@NgModule({
imports: [CommonModule, ChipsModule, FormsModule, ReactiveFormsModule, AppCodeModule, AppDocModule],
exports: [AppDocModule],
declarations: [ImportDoc, BasicDoc, CommaSeperatorDoc, RegexpSeperatorDoc, TemplateDoc, StyleDoc, AccessibilityDoc, ReactiveFormsDoc, MaxValuesDoc]
declarations: [ImportDoc, BasicDoc, CommaSeparatorDoc, RegexpSeparatorDoc, TemplateDoc, StyleDoc, AccessibilityDoc, ReactiveFormsDoc, MaxValuesDoc]
})
export class ChipsDocModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import { Component, Input } from '@angular/core';
import { Code } from '../../domain/code';

@Component({
selector: 'chips-comma-seperator-demo',
selector: 'chips-comma-separator-demo',
template: ` <section class="py-4">
<app-docsectiontext [title]="title" [id]="id">
<p>A new chip is added when <i>enter</i> key is pressed, <i>separator</i> property allows definining an additional key. Currently only valid value is <i>,</i> to create a new item when comma key is pressed.</p>
</app-docsectiontext>
<div class="card p-fluid">
<p-chips [(ngModel)]="values" separator="," placeholder="Hint: a, b, c"></p-chips>
</div>
<app-code [code]="code" selector="chips-comma-seperator-demo"></app-code>
<app-code [code]="code" selector="chips-comma-separator-demo"></app-code>
</section>`
})
export class CommaSeperatorDoc {
export class CommaSeparatorDoc {
@Input() id: string;

@Input() title: string;
Expand All @@ -33,10 +33,10 @@ export class CommaSeperatorDoc {
import { Component } from '@angular/core';
@Component({
selector: 'chips-comma-seperator-demo',
templateUrl: './chips-comma-seperator-demo.html',
selector: 'chips-comma-separator-demo',
templateUrl: './chips-comma-separator-demo.html',
})
export class ChipsCommaSeperatorDemo {
export class ChipsCommaSeparatorDemo {
values: string[] | undefined;
}`
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import { Component, Input } from '@angular/core';
import { Code } from '../../domain/code';

@Component({
selector: 'chips-reg-exp-seperator-demo',
selector: 'chips-reg-exp-separator-demo',
template: ` <section class="py-4">
<app-docsectiontext [title]="title" [id]="id">
<p>A new chip is added when <i>enter</i> key is pressed, <i>separator</i> property allows definining an additional key. Currently only valid value is , to create a new item when comma key is pressed.</p>
</app-docsectiontext>
<div class="card p-fluid">
<p-chips [(ngModel)]="values" [separator]="separatorExp" placeholder="Hint: a, b c"></p-chips>
</div>
<app-code [code]="code" selector="chips-reg-exp-seperator-demo"></app-code>
<app-code [code]="code" selector="chips-reg-exp-separator-demo"></app-code>
</section>`
})
export class RegexpSeperatorDoc {
export class RegexpSeparatorDoc {
@Input() id: string;

@Input() title: string;
Expand All @@ -35,10 +35,10 @@ export class RegexpSeperatorDoc {
import { Component } from '@angular/core';
@Component({
selector: 'chips-reg-exp-seperator-demo',
templateUrl: './chips-reg-exp-seperator-demo.html'
selector: 'chips-reg-exp-separator-demo',
templateUrl: './chips-reg-exp-separator-demo.html'
})
export class ChipsRegExpSeperatorDemo {
export class ChipsRegExpSeparatorDemo {
values: string[] | undefined;
separatorExp: RegExp = /,| /;
Expand Down
1 change: 0 additions & 1 deletion src/app/showcase/doc/dropdown/templatedoc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { Code } from '../../domain/code';


@Component({
selector: 'dropdown-template-demo',
template: ` <section class="py-4">
Expand Down
14 changes: 7 additions & 7 deletions src/app/showcase/pages/chips/chipsdemo.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component } from '@angular/core';
import { ImportDoc } from '../../doc/chips/importdoc';
import { BasicDoc } from '../../doc/chips/basicdoc';
import { CommaSeperatorDoc } from '../../doc/chips/commaseperator.doc';
import { RegexpSeperatorDoc } from '../../doc/chips/regexpseperator.doc';
import { CommaSeparatorDoc } from '../../doc/chips/commaseparator.doc';
import { RegexpSeparatorDoc } from '../../doc/chips/regexpseparator.doc';
import { TemplateDoc } from '../../doc/chips/templatedoc';
import { StyleDoc } from '../../doc/chips/styledoc';
import { AccessibilityDoc } from '../../doc/chips/accessibilitydoc';
Expand Down Expand Up @@ -35,14 +35,14 @@ export class ChipsDemo {
component: MaxValuesDoc
},
{
id: 'commaseperator',
id: 'commaseparator',
label: 'Comma Seperator',
component: CommaSeperatorDoc
component: CommaSeparatorDoc
},
{
id: 'regexpseperator',
label: 'RegExp Seperator',
component: RegexpSeperatorDoc
id: 'regexpseparator',
label: 'RegExp Separator',
component: RegexpSeparatorDoc
},
{
id: 'template',
Expand Down

0 comments on commit 007553f

Please sign in to comment.