How to use the @sbb-esta/angular-business/table.SbbTableDataSource function in @sbb-esta/angular-business

To help you get started, we’ve selected a few @sbb-esta/angular-business examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sbb-design-systems / sbb-angular / projects / angular-showcase / src / app / business / business-examples / table-showcase / table-showcase.component.ts View on Github external
})
export class TableShowcaseComponent {}

@Component({
  selector: 'sbb-table-showcase-1',
  templateUrl: './table-showcase-1.component.html'
})
export class TableShowcase1Component {
  displayedColumns: string[] = [
    'leftAligned',
    'groupedOne',
    'groupedTwo',
    'groupedThree',
    'centerAligned'
  ];
  dataSource: SbbTableDataSource = new SbbTableDataSource(TABLE_SHOWCASE_DATA_1, [
    ['groupedOne', 'groupedTwo', 'groupedThree']
  ]);

  deleteItem(element: any): void {
    const index = this.dataSource.data.indexOf(element);
    this.dataSource.data.splice(index, 1);
    this.dataSource._updateChangeSubscription();
  }
}

@Component({
  selector: 'sbb-table-showcase-2',
  templateUrl: './table-showcase-2.component.html'
})
export class TableShowcase2Component {
  displayedColumns: string[] = ['deviceName', 'orderDate', 'arrivalDate', 'lifecycleEnd', 'status'];
github sbb-design-systems / sbb-angular / projects / angular-showcase / src / app / business / business-examples / table-showcase / grouped-columns-table / grouped-columns-table.component.ts View on Github external
import { TABLE_SHOWCASE_DATA_GROUPED_COLS } from '../table-showcase-data';

@Component({
  selector: 'sbb-table-grouped-columns-showcase',
  templateUrl: './grouped-columns-table.component.html'
})
export class GroupedColumnsTableComponent {
  displayedColumns: string[] = [
    'leftAligned',
    'groupedOne',
    'groupedTwo',
    'groupedThree',
    'centerAligned'
  ];
  dataSource: SbbTableDataSource = new SbbTableDataSource(TABLE_SHOWCASE_DATA_GROUPED_COLS, [
    ['groupedOne', 'groupedTwo', 'groupedThree']
  ]);
}
github sbb-design-systems / sbb-angular / projects / angular-showcase / src / app / business / business-examples / table-showcase / table-showcase.component.ts View on Github external
]);

  deleteItem(element: any): void {
    const index = this.dataSource.data.indexOf(element);
    this.dataSource.data.splice(index, 1);
    this.dataSource._updateChangeSubscription();
  }
}

@Component({
  selector: 'sbb-table-showcase-2',
  templateUrl: './table-showcase-2.component.html'
})
export class TableShowcase2Component {
  displayedColumns: string[] = ['deviceName', 'orderDate', 'arrivalDate', 'lifecycleEnd', 'status'];
  dataSource: SbbTableDataSource = new SbbTableDataSource(TABLE_SHOWCASE_DATA_2, [
    ['orderDate', 'arrivalDate', 'lifecycleEnd']
  ]);

  isGroup(index, item): boolean {
    return item.isGroupBy;
  }
}
github sbb-design-systems / sbb-angular / projects / angular-showcase / src / app / business / business-examples / table-showcase / table-grouped-rows-showcase / table-grouped-rows-showcase.component.ts View on Github external
import { Component } from '@angular/core';
import { SbbTableDataSource } from '@sbb-esta/angular-business/table';

import { TABLE_SHOWCASE_DATA_GROUPED_ROWS } from '../table-showcase-data';

@Component({
  selector: 'sbb-table-grouped-rows-showcase',
  templateUrl: './table-grouped-rows-showcase.component.html'
})
export class TableGroupedRowsShowcaseComponent {
  displayedColumns: string[] = ['deviceName', 'orderDate', 'arrivalDate', 'lifecycleEnd', 'status'];
  dataSource: SbbTableDataSource = new SbbTableDataSource(TABLE_SHOWCASE_DATA_GROUPED_ROWS, [
    ['orderDate', 'arrivalDate', 'lifecycleEnd']
  ]);

  isGroup(index, item): boolean {
    return item.isGroupBy;
  }
}
github sbb-design-systems / sbb-angular / projects / angular-showcase / src / app / business / business-examples / table-showcase / table-sort-showcase / table-sort-showcase.component.ts View on Github external
import { Component } from '@angular/core';
import { SbbTableDataSource, Sort } from '@sbb-esta/angular-business/table';

import { TABLE_SHOWCASE_DATA } from '../table-showcase-data';

@Component({
  selector: 'sbb-table-sort-showcase',
  templateUrl: './table-sort-showcase.component.html'
})
export class TableSortShowcaseComponent {
  displayedColumns: string[] = ['letter', 'number', 'word', 'date'];
  dataSource: SbbTableDataSource = new SbbTableDataSource(TABLE_SHOWCASE_DATA.slice());

  sortData(sort: Sort) {
    const data = this.dataSource.data.slice();
    if (!sort.active || sort.direction === '') {
      this.dataSource.data = TABLE_SHOWCASE_DATA;
      return;
    }

    this.dataSource.data = data.sort((a, b) => {
      const isAsc = sort.direction === 'asc';
      switch (sort.active) {
        case 'letter':
          return this.compare(a.letter, b.letter, isAsc);
        case 'number':
          return this.compare(a.number, b.number, isAsc);
        case 'word':
github sbb-design-systems / sbb-angular / projects / angular-showcase / src / app / business / business-examples / table-showcase / simple-table / simple-table.component.ts View on Github external
import { TABLE_SHOWCASE_DATA_SIMPLE } from '../table-showcase-data';

@Component({
  selector: 'sbb-table-simple-showcase',
  templateUrl: './simple-table.component.html'
})
export class SimpleTableComponent {
  displayedColumns: string[] = [
    'columnOne',
    'columnTwo',
    'columnThree',
    'columnFour',
    'columnFive'
  ];
  dataSource: SbbTableDataSource = new SbbTableDataSource(TABLE_SHOWCASE_DATA_SIMPLE);
}
github sbb-design-systems / sbb-angular / projects / angular-showcase / src / app / business / business-examples / table-showcase / table-actions-showcase / table-actions-showcase.component.ts View on Github external
import { Component } from '@angular/core';
import { SbbTableDataSource } from '@sbb-esta/angular-business/table';

import { TABLE_SHOWCASE_DATA } from '../table-showcase-data';

@Component({
  selector: 'sbb-table-actions-showcase',
  templateUrl: './table-actions-showcase.component.html'
})
export class TableActionsShowcaseComponent {
  displayedColumns: string[] = ['letter', 'number', 'word', 'date'];
  dataSource: SbbTableDataSource = new SbbTableDataSource(TABLE_SHOWCASE_DATA.slice());

  deleteItem(element: any): void {
    const index = this.dataSource.data.indexOf(element);
    this.dataSource.data.splice(index, 1);
    this.dataSource._updateChangeSubscription();
  }
}

@sbb-esta/angular-business

This is the repository for the Angular component library for SBB.

Apache-2.0
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis

Similar packages