Skip to content

Commit

Permalink
Code format
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Mar 21, 2024
1 parent 7e6c297 commit 210d49a
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 69 deletions.
12 changes: 11 additions & 1 deletion src/app/components/chip/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ import { TimesCircleIcon } from 'primeng/icons/timescircle';
<div class="p-chip-text" *ngIf="label" [attr.data-pc-section]="'label'">{{ label }}</div>
<ng-container *ngIf="removable">
<ng-container *ngIf="!removeIconTemplate">
<span tabindex="0" *ngIf="removeIcon" [class]="removeIcon" [ngClass]="'pi-chip-remove-icon'" [attr.data-pc-section]="'removeicon'" (click)="close($event)" (keydown)="onKeydown($event)" [attr.aria-label]="removeAriaLabel" role="button"></span>
<span
tabindex="0"
*ngIf="removeIcon"
[class]="removeIcon"
[ngClass]="'pi-chip-remove-icon'"
[attr.data-pc-section]="'removeicon'"
(click)="close($event)"
(keydown)="onKeydown($event)"
[attr.aria-label]="removeAriaLabel"
role="button"
></span>
<TimesCircleIcon tabindex="0" *ngIf="!removeIcon" [class]="'pi-chip-remove-icon'" [attr.data-pc-section]="'removeicon'" (click)="close($event)" (keydown)="onKeydown($event)" [attr.aria-label]="removeAriaLabel" role="button" />
</ng-container>
<span *ngIf="removeIconTemplate" tabindex="0" [attr.data-pc-section]="'removeicon'" class="pi-chip-remove-icon" (click)="close($event)" (keydown)="onKeydown($event)" [attr.aria-label]="removeAriaLabel" role="button">
Expand Down
1 change: 0 additions & 1 deletion src/app/components/picklist/picklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,6 @@ export class PickList implements AfterViewChecked, AfterContentInit {
this.resetTargetFilter();
}


findNextItem(item: any): HTMLElement | null {
let nextItem = item.nextElementSibling;

Expand Down
17 changes: 7 additions & 10 deletions src/app/components/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ export class StepperHeader {

@Input() active: boolean | undefined;

@Input() highlighted: boolean | undefined;
@Input() highlighted: boolean | undefined;

@Input() getStepProp: string | undefined;
@Input() getStepProp: string | undefined;

@Input() ariaControls: string | undefined;
@Input() ariaControls: string | undefined;

@Output() onClick = new EventEmitter<void>();

}

@Component({
Expand All @@ -76,16 +75,15 @@ export class StepperHeader {
export class StepperSeparator {
@Input() template: TemplateRef<any> | undefined;

@Input() separatorClass: string | undefined;
@Input() separatorClass: string | undefined;

@Input() stepperPanel: StepperPanel;

@Input() index: string | undefined;

@Input() active: boolean | undefined;
@Input() active: boolean | undefined;

@Input() highlighted: boolean | undefined;

}

@Component({
Expand Down Expand Up @@ -118,7 +116,7 @@ export class StepperContent {

@Input() stepperPanel: StepperPanel;

@Input() index: string | undefined;
@Input() index: string | undefined;

@Input() active: boolean | undefined;

Expand All @@ -129,7 +127,6 @@ export class StepperContent {
@Output() prevCallback = new EventEmitter<void>();

@Output() nextCallback = new EventEmitter<void>();

}

/**
Expand Down Expand Up @@ -387,7 +384,7 @@ export class Stepper implements AfterContentInit {

panels!: StepperPanel[];

isStepActive(index:number) {
isStepActive(index: number) {
return this.activeStep === index;
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/stepper/stepperpanel.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ export interface StepperPanelSeparatorProps {
* Current highlighted state of the stepperpanel
*/
highlighted: boolean;
}
}
8 changes: 2 additions & 6 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2432,9 +2432,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
throw new Error('dataKey or groupRowsBy must be defined to use row expansion');
}

let dataKeyValue = this.groupRowsBy ?
String(ObjectUtils.resolveFieldData(rowData, this.groupRowsBy)) :
String(ObjectUtils.resolveFieldData(rowData, this.dataKey));
let dataKeyValue = this.groupRowsBy ? String(ObjectUtils.resolveFieldData(rowData, this.groupRowsBy)) : String(ObjectUtils.resolveFieldData(rowData, this.dataKey));

if (this.expandedRowKeys[dataKeyValue] != null) {
delete this.expandedRowKeys[dataKeyValue];
Expand Down Expand Up @@ -2464,9 +2462,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
}

isRowExpanded(rowData: any): boolean {
return this.groupRowsBy ?
this.expandedRowKeys[String(ObjectUtils.resolveFieldData(rowData, this.groupRowsBy))] === true :
this.expandedRowKeys[String(ObjectUtils.resolveFieldData(rowData, this.dataKey))] === true;
return this.groupRowsBy ? this.expandedRowKeys[String(ObjectUtils.resolveFieldData(rowData, this.groupRowsBy))] === true : this.expandedRowKeys[String(ObjectUtils.resolveFieldData(rowData, this.dataKey))] === true;
}

isRowEditing(rowData: any): boolean {
Expand Down
14 changes: 9 additions & 5 deletions src/app/components/tieredmenu/tieredmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,15 @@ export class TieredMenuSub {
}

getAriaPosInset(index: number) {
return index - this.items.slice(0, index).filter((processedItem) => {
const isItemVisible = this.isItemVisible(processedItem);
const isVisibleSeparator = isItemVisible && this.getItemProp(processedItem, 'separator');
return !isItemVisible || isVisibleSeparator;
}).length + 1;
return (
index -
this.items.slice(0, index).filter((processedItem) => {
const isItemVisible = this.isItemVisible(processedItem);
const isVisibleSeparator = isItemVisible && this.getItemProp(processedItem, 'separator');
return !isItemVisible || isVisibleSeparator;
}).length +
1
);
}

isItemVisible(processedItem: any): boolean {
Expand Down
1 change: 0 additions & 1 deletion src/app/showcase/doc/inputotp/inputotpdoc.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { SampleDoc } from './sampledoc';
import { ButtonModule } from 'primeng/button';
import { AccessibilityDoc } from './accessibilitydoc';


@NgModule({
imports: [CommonModule, RouterModule, AppCodeModule, AppDocModule, FormsModule, ReactiveFormsModule, InputOtpModule, InputTextModule, ButtonModule],
exports: [AppDocModule],
Expand Down
74 changes: 37 additions & 37 deletions src/app/showcase/doc/stepper/accessibilitydoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,44 @@ import { Component } from '@angular/core';
selector: 'accessibility-doc',
template: ` <div>
<app-docsectiontext>
<h3>Screen Reader</h3>
<p>
Stepper container is defined with the <i>tablist</i> role, as any attribute is passed to the container element <i>aria-labelledby</i> can be optionally used to specify an element to describe the Stepper. Each stepper header has a
<i>tab</i> role and <i>aria-controls</i> to refer to the corresponding stepper content element. The content element of each stepper has <i>tabpanel</i> role, an id to match the <i>aria-controls</i> of the header and
<i>aria-labelledby</i> reference to the header as the accessible name.
</p>
<h3>Screen Reader</h3>
<p>
Stepper container is defined with the <i>tablist</i> role, as any attribute is passed to the container element <i>aria-labelledby</i> can be optionally used to specify an element to describe the Stepper. Each stepper header has a
<i>tab</i> role and <i>aria-controls</i> to refer to the corresponding stepper content element. The content element of each stepper has <i>tabpanel</i> role, an id to match the <i>aria-controls</i> of the header and
<i>aria-labelledby</i> reference to the header as the accessible name.
</p>
<h3>Tab Header Keyboard Support</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<i>tab</i>
</td>
<td>Moves focus through the header.</td>
</tr>
<tr>
<td>
<i>enter</i>
</td>
<td>Activates the focused stepper header.</td>
</tr>
<tr>
<td>
<i>space</i>
</td>
<td>Activates the focused stepper header.</td>
</tr>
</tbody>
</table>
</div>
<h3>Tab Header Keyboard Support</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<i>tab</i>
</td>
<td>Moves focus through the header.</td>
</tr>
<tr>
<td>
<i>enter</i>
</td>
<td>Activates the focused stepper header.</td>
</tr>
<tr>
<td>
<i>space</i>
</td>
<td>Activates the focused stepper header.</td>
</tr>
</tbody>
</table>
</div>
</app-docsectiontext>
</div>`
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/stepper/stepperdoc.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ToggleButtonModule } from 'primeng/togglebutton';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

@NgModule({
imports: [CommonModule, AppCodeModule, AppDocModule, StepperModule, RouterModule,FormsModule, ReactiveFormsModule, ButtonModule, PasswordModule, InputIconModule, IconFieldModule, InputTextModule, ToggleButtonModule],
imports: [CommonModule, AppCodeModule, AppDocModule, StepperModule, RouterModule, FormsModule, ReactiveFormsModule, ButtonModule, PasswordModule, InputIconModule, IconFieldModule, InputTextModule, ToggleButtonModule],
exports: [AppDocModule],
declarations: [ImportDoc, BasicDoc, VerticalDoc, LinearDoc, TemplateDoc, AccessibilityDoc]
})
Expand Down
6 changes: 1 addition & 5 deletions src/app/showcase/pages/inputotp/inputotpdemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ export class InputOtpDemo {
id: 'accessibility',
label: 'Accessibility',
component: AccessibilityDoc
},




}
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { RouterModule } from '@angular/router';
import { StepperDemo } from './stepperdemo';

@NgModule({
imports: [RouterModule.forChild([{ path: '', component: StepperDemo}])],
imports: [RouterModule.forChild([{ path: '', component: StepperDemo }])],
exports: [RouterModule]
})
export class StepperDemoRoutingModule {}

0 comments on commit 210d49a

Please sign in to comment.