Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 9c71a68

Browse files
author
Sebastian Superczynski
committed
release: cut(9.4.0)
1 parent c0b52b8 commit 9c71a68

15 files changed

+70
-22
lines changed
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/// <reference types="Cypress" />
2+
3+
context('Column class', () => {
4+
before(() => {
5+
cy.visit('http://127.0.0.1:4201/#/column-class');
6+
},
7+
);
8+
it('by default "Company" column has class "blue"', () => {
9+
cy
10+
.get('#table > thead > tr:nth-child(1) > th:nth-child(3)').should('not.have.class', 'blue')
11+
.get('#table > tbody > tr:nth-child(1) > td:nth-child(3)').should('have.class', 'blue')
12+
;
13+
});
14+
it('by default "Level" column has class "pink" including header', () => {
15+
cy
16+
.get('#table > thead > tr:nth-child(1) > th:nth-child(4)').should('have.class', 'pink')
17+
.get('#table > thead > tr:nth-child(2) > th:nth-child(4)').should('have.class', 'pink')
18+
.get('#table > tbody > tr:nth-child(1) > td:nth-child(4)').should('have.class', 'pink')
19+
;
20+
});
21+
});

cypress/integration/pin.spec.ts

-11
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,4 @@ context('Pinned column', () => {
2626
.get('#table > tbody > tr:nth-child(1) > td:nth-child(2)').should('have.class', 'pinned-left')
2727
;
2828
});
29-
// TODO implement pin API
30-
// it('uses API to set 2nd column pinned', () => {
31-
// cy
32-
// .get('#setColumn2Pinned').click()
33-
// .get('#table > tbody > tr:nth-child(1) > td:nth-child(1)').should('have.class', 'pinned-left')
34-
// .get('#table > tbody > tr:nth-child(1) > td:nth-child(2)').should('have.class', 'pinned-left')
35-
// .get('#setColumn2UnPinned').click()
36-
// .get('#table > tbody > tr:nth-child(1) > td:nth-child(1)').should('have.class', 'pinned-left')
37-
// .get('#table > tbody > tr:nth-child(1) > td:nth-child(2)').should('have.class', 'ngx-table__header-cell')
38-
// ;
39-
// });
4029
});

projects/ngx-easy-table/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/ngx-easy-table/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-easy-table",
3-
"version": "9.4.0-rc.1",
3+
"version": "9.4.0",
44
"description": "Angular easy table",
55
"typings": "index.ts",
66
"repository": "https://github.com/ssuperczynski/ngx-easy-table.git",

projects/ngx-easy-table/src/lib/services/config-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const DefaultConfig: Config = {
2323
checkboxes: false,
2424
resizeColumn: false,
2525
fixedColumnWidth: true,
26-
horizontalScroll: true,
26+
horizontalScroll: false,
2727
draggable: false,
2828
logger: false,
2929
showDetailsArrow: false,

src/app/app.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export class AppComponent implements OnInit {
4040
{ link: 'persist-state', name: 'Persist state' },
4141
{ link: 'context-menu', name: 'Context menu', experimental: true },
4242
{ link: 'pinned', name: 'Pinned column' },
43+
{ link: 'column-class', name: 'Column Class' },
4344
],
4445
templates: [
4546
{ link: 'template', name: 'Basic template' },

src/app/app.module.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import {
6464
BootstrapComponent,
6565
DocComponent,
6666
InstallationComponent,
67-
PinnedComponent,
67+
PinnedComponent, ColumnClassComponent,
6868
} from './demo';
6969
import { TableModule } from 'ngx-easy-table';
7070

@@ -133,6 +133,7 @@ import { TableModule } from 'ngx-easy-table';
133133
DocComponent,
134134
InstallationComponent,
135135
PinnedComponent,
136+
ColumnClassComponent,
136137
],
137138
bootstrap: [AppComponent],
138139
providers: [],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div class="columns">
2+
<div class="column col-12">
3+
<ngx-table
4+
[configuration]="configuration"
5+
[data]="data"
6+
[columns]="columns">
7+
</ngx-table>
8+
</div>
9+
</div>

src/app/demo/column-class/column-class.component.scss

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { Company, data } from '../../../assets/data';
3+
import { Columns, Config, DefaultConfig } from 'ngx-easy-table';
4+
5+
@Component({
6+
selector: 'app-column-class',
7+
templateUrl: './column-class.component.html',
8+
styleUrls: ['./column-class.component.scss'],
9+
})
10+
export class ColumnClassComponent implements OnInit {
11+
public columns: Columns[];
12+
public data: Company[] = [];
13+
public configuration: Config;
14+
15+
ngOnInit(): void {
16+
this.configuration = DefaultConfig;
17+
this.configuration.searchEnabled = true;
18+
this.data = data;
19+
this.columns = [
20+
{ key: 'phone', title: 'Phone' },
21+
{ key: 'age', title: 'Age' },
22+
{ key: 'company', title: 'Company', cssClass: { includeHeader: false, name: 'blue' } },
23+
{ key: 'level', title: 'Level', cssClass: { includeHeader: true, name: 'pink' } },
24+
{ key: 'address.number', title: 'Number' },
25+
{ key: 'name', title: 'Name' },
26+
{ key: 'isActive', title: 'STATUS' },
27+
];
28+
}
29+
}

src/app/demo/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ export * from './bootstrap/bootstrap.component';
4949
export * from './doc/doc.component';
5050
export * from './installation/installation.component';
5151
export * from './pinned/pinned.component';
52+
export * from './column-class/column-class.component';

src/app/demo/pinned/pinned.component.html

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ngx-table
44
[configuration]="configuration"
55
[data]="data"
6-
#table
76
[columns]="columns">
87
</ngx-table>
98
</div>
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
.phone {
2-
color: #28a745;
3-
}

src/app/demo/pinned/pinned.component.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Component, OnInit, ViewChild } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
22
import { Company, data } from '../../../assets/data';
3-
import { Columns, Config, DefaultConfig, APIDefinition } from 'ngx-easy-table';
3+
import { Columns, Config, DefaultConfig } from 'ngx-easy-table';
44

55
@Component({
66
selector: 'app-pinned',
@@ -11,7 +11,6 @@ export class PinnedComponent implements OnInit {
1111
public columns: Columns[];
1212
public data: Company[] = [];
1313
public configuration: Config;
14-
@ViewChild('table') table: APIDefinition;
1514

1615
ngOnInit(): void {
1716
this.configuration = DefaultConfig;

src/app/routes.ts

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import {
5252
DocComponent,
5353
InstallationComponent,
5454
PinnedComponent,
55+
ColumnClassComponent,
5556
} from './demo';
5657

5758
export const routes = [
@@ -106,6 +107,7 @@ export const routes = [
106107
{ path: 'api-doc', component: ApiDocComponent },
107108
{ path: 'installation', component: InstallationComponent },
108109
{ path: 'pinned', component: PinnedComponent },
110+
{ path: 'column-class', component: ColumnClassComponent },
109111
{ path: '**', component: BasicComponent },
110112
];
111113

0 commit comments

Comments
 (0)