Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update codeowners #200

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @fateeand @korel-san @TerranceKhumalo-absa @AtlegangMolokwane @victorgvargas
* @fateeand @korel-san @TerranceKhumalo-absa @AtlegangMolokwane @lukasmatta
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<cps-tree-table
[data]="dataVirtual"
[data]="data"
toolbarTitle="Tree table alpha version"
[columns]="cols"
[virtualScroll]="true"
[showColumnsToggle]="true"
[showRowMenu]="true"
[selectable]="true"
[showGlobalFilter]="true"
(columnsSelected)="onColumnsSelected($event)"
scrollHeight="500px"
sortMode="multiple">
Expand Down Expand Up @@ -34,7 +35,11 @@
</ng-template> -->

<ng-template #header>
<th *ngFor="let scol of selCols" [cpsTTColSortable]="scol.field">
<th
*ngFor="let scol of selCols"
[cpsTTColSortable]="scol.field"
[cpsTTColFilter]="scol.field"
filterType="text">
{{ scol.header }}
</th>
</ng-template>
Expand All @@ -48,3 +53,9 @@
</ng-container>
</ng-template>
</cps-tree-table>

<!-- <th cpsTColSortable="a" cpsTColFilter="a" filterType="text">A</th>
<th cpsTColSortable="b" cpsTColFilter="b" filterType="date">B</th>
<th cpsTColSortable="c" cpsTColFilter="c" filterType="number">C</th>
<th cpsTColSortable="d" cpsTColFilter="d" filterType="boolean">D</th>
<th cpsTColSortable="e" cpsTColFilter="e" filterType="category">E</th> -->
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { CommonModule } from '@angular/common';
import {
CpsTreeTableComponent,
CpsTreetableRowTogglerDirective,
CpsTreeTableColumnSortableDirective
CpsTreeTableColumnSortableDirective,
CpsTreeTableColumnFilterDirective
} from 'cps-ui-kit';

@Component({
Expand All @@ -13,7 +14,8 @@ import {
CommonModule,
CpsTreeTableComponent,
CpsTreetableRowTogglerDirective,
CpsTreeTableColumnSortableDirective
CpsTreeTableColumnSortableDirective,
CpsTreeTableColumnFilterDirective
],
templateUrl: './tree-table-page.component.html',
styleUrls: ['./tree-table-page.component.scss'],
Expand Down Expand Up @@ -317,21 +319,21 @@ export class TreeTablePageComponent implements OnInit {
data: {
name: 'Videos',
size: '1500mb',
type: 'Folder'
type: 'Directory'
},
children: [
{
data: {
name: 'primefaces.mkv',
size: '1000mb',
type: 'Video'
type: 'Directory'
}
},
{
data: {
name: 'intro.avi',
size: '500mb',
type: 'Video'
type: 'Directory'
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { CpsMenuComponent } from '../components/cps-menu/cps-menu.component';
@Component({
template: ''
})
export class CpsTreeDropdownBaseComponent
export class BaseTreeDropdownComponent
implements ControlValueAccessor, OnInit, AfterViewInit, OnDestroy
{
@Input() label = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class CpsMenuComponent implements AfterViewInit, OnDestroy {
@Input() withArrow = true;
@Input() compressed = false; // prepared-colored, without header and items description
@Input() focusOnShow = true;
@Input() persistent = false;
@Input() containerClass = '';
@Input() showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
@Input() hideTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
Expand Down Expand Up @@ -241,6 +242,7 @@ export class CpsMenuComponent implements AfterViewInit, OnDestroy {
documentEvent,
(event) => {
if (
!this.persistent &&
!this.container?.contains(event.target) &&
this.target !== event.target &&
!this.target.contains(event.target) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
(onLazyLoad)="onLazyLoaded($event)"
(sortFunction)="onSortFunction($event)"
(onSort)="onSort($event)"
(onFilter)="onFilter($event)"
(onRowReorder)="onRowReorder($event)">
<ng-template pTemplate="caption" *ngIf="hasToolbar">
<ng-container *ngIf="toolbarTemplate">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,10 +687,6 @@ $tbar-normal-height: 72px;
}
}

.p-sortable-column.cps-table-col-filter-menu-open {
cursor: default;
}

.cps-table-col-filter-menu-open {
.cps-table-col-filter-menu-button {
color: $body-text-color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class CpsTableComponent implements OnInit, AfterViewChecked {
@Input() reorderableRows = false;
@Input() showColumnsToggle = false; // if external body template is provided, use columnsSelected event emitter
@Input() loading = false;

@Input() tableStyle = undefined;
@Input() tableStyleClass = '';

Expand Down Expand Up @@ -133,6 +134,7 @@ export class CpsTableComponent implements OnInit, AfterViewChecked {
@Output() rowsRemoved = new EventEmitter<any[]>();
@Output() pageChanged = new EventEmitter<any>();
@Output() sorted = new EventEmitter<any>();
@Output() filtered = new EventEmitter<any>();
@Output() rowsReordered = new EventEmitter<any>();
@Output() columnsSelected = new EventEmitter<{ [key: string]: any }[]>();
@Output() lazyLoaded = new EventEmitter<any>();
Expand Down Expand Up @@ -393,6 +395,10 @@ export class CpsTableComponent implements OnInit, AfterViewChecked {
this.sorted.emit(event);
}

onFilter(event: any) {
this.filtered.emit(event);
}

onRowReorder(event: any) {
this.rowsReordered.emit(event);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,4 @@ export class CpsTableColumnSortableDirective
this.sortIconRef.destroy();
this.viewContainerRef.clear();
}

override onClick(event: MouseEvent): void {
if (
!this.elementRef?.nativeElement?.classList?.contains(
'cps-table-col-filter-menu-open'
)
) {
super.onClick(event);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {
ComponentRef,
Directive,
ElementRef,
Input,
OnDestroy,
OnInit,
ViewContainerRef
} from '@angular/core';
import { TableCheckbox } from 'primeng/table';

@Directive({
standalone: true,
selector: '[cpsTRowSelectable]'
})
export class CpsTableRowSelectableDirective implements OnInit, OnDestroy {
@Input('cpsTRowSelectable') value: any;
checkboxCompRef: ComponentRef<TableCheckbox>;

constructor(
private elementRef: ElementRef,
private viewContainerRef: ViewContainerRef
) {
this.checkboxCompRef = this.viewContainerRef.createComponent(TableCheckbox);
}

ngOnInit(): void {
this.checkboxCompRef.setInput('value', this.value);

this.elementRef.nativeElement.appendChild(
this.checkboxCompRef.location.nativeElement
);
}

ngOnDestroy(): void {
this.checkboxCompRef.destroy();
this.viewContainerRef.clear();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, Optional } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { FilterMetadata } from 'primeng/api';
Expand All @@ -10,6 +10,7 @@ import {
BtnToggleOption,
CpsButtonToggleComponent
} from '../../../cps-button-toggle/cps-button-toggle.component';
import { TreeTable } from 'primeng/treetable';

@Component({
selector: 'table-column-filter-constraint',
Expand Down Expand Up @@ -40,8 +41,11 @@ export class TableColumnFilterConstraintComponent implements OnInit {

categories: { label: string; value: string }[] = [];

// eslint-disable-next-line no-useless-constructor
constructor(public dt: Table) {}
_tableInstance: Table | TreeTable;

constructor(@Optional() public dt: Table, @Optional() public tt: TreeTable) {
this._tableInstance = dt || tt;
}

ngOnInit(): void {
if (this.type === 'category') {
Expand All @@ -53,7 +57,10 @@ export class TableColumnFilterConstraintComponent implements OnInit {
} else {
this.categories =
Array.from(
new Set(this.dt.value?.map((v) => v[this.field as string]) || [])
new Set(
this._tableInstance.value?.map((v) => v[this.field as string]) ||
[]
)
)?.map((c) => ({
label: c,
value: c
Expand All @@ -66,12 +73,12 @@ export class TableColumnFilterConstraintComponent implements OnInit {
(<any>this.filterConstraint).value = value;

if (value === '' || !this.hasApplyButton) {
this.dt._filter();
this._tableInstance._filter();
}
}

onEnterKeyDown(event: any) {
this.dt._filter();
this._tableInstance._filter();
event.preventDefault();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<cps-menu
#columnFilterMenu
[withArrow]="false"
[persistent]="true"
(menuShown)="onMenuShown()"
(menuHidden)="onMenuHidden()">
<div class="cps-table-col-filter-menu-content">
Expand Down
Loading
Loading