<commit_before>import {
  Component, Renderer2, ElementRef, Input, Output, EventEmitter, ViewChild, ViewEncapsulation,
  AfterViewInit, OnDestroy, NgZone
} from '@angular/core';
import {DomController, Platform} from 'ionic-angular';
import { SuperTabsPanGesture } from '../../super-tabs-pan-gesture';
import { SuperTabsConfig } from '../super-tabs/super-tabs';

@Component({
  selector: 'super-tabs-container',
  template: '<div #container><ng-content></ng-content></div>',
  encapsulation: ViewEncapsulation.None
})
export class SuperTabsContainer implements AfterViewInit, OnDestroy {

  /**
   * Component configuration
   * @type {SuperTabsConfig}
   */
  @Input()
  config: SuperTabsConfig;

  /**
   * Number of tabs
   * @type {number}
   */
  @Input()
  tabsCount: number = 0;

  /**
   * Selected tab index
   * @type {number}
   */
  @Input()
  selectedTabIndex: number;

  /**
   * Notifies when a tab is selected
   * @type {EventEmitter<Object>}
   */
  @Output()
  tabSelect: EventEmitter<{ index: number; changed: boolean; }> = new EventEmitter<{ index: number; changed: boolean; }>();

  /**
   * Notifies when the container is being dragged
   * @type {EventEmitter<TouchEvent>}
   */
  @Output()
  onDrag: EventEmitter<TouchEvent> = new EventEmitter<TouchEvent>();

  // View bindings

  /**
   * Container position
   * @type {number}
   */
  containerPosition: number = 0;

  // View children

  /**
   * The container wrapping all the tabs
   */
  @ViewChild('container')
  container: ElementRef;

  /**
   * Single tab width
   * @type {number}
   */
  tabWidth: number = 0;

  /**
   * Container width (sum of tab widths)
   * @type {number}
   */
  containerWidth: number = 0;


  // Animation stuff

  private minPosX: number;

  private maxPosX: number;

  private gesture: SuperTabsPanGesture;

  private globalSwipeEnabled: boolean = true;

  private swipeEnabledPerTab: {[index: number]: boolean} = {};

  constructor(
    private el: ElementRef,
    private rnd: Renderer2,
    private plt: Platform,
    private domCtrl: DomController,
    private ngZone: NgZone
  ) {}

  ngAfterViewInit() {
    this.init();
  }

  ngOnDestroy() {
    this.gesture && this.gesture.destroy();
  }

  enableTabsSwipe(enable: boolean) {
    this.globalSwipeEnabled = enable;
  }

  enableTabSwipe(tabIndex: number, enable: boolean) {
    this.swipeEnabledPerTab[tabIndex] = enable;
  }

  refreshDimensions() {
    this.calculateContainerWidth();<commit_msg>refactor(): remove DomController injection<commit_after>import {
  Component, Renderer2, ElementRef, Input, Output, EventEmitter, ViewChild, ViewEncapsulation,
  AfterViewInit, OnDestroy, NgZone
} from '@angular/core';
import {DomController, Platform} from 'ionic-angular';
import { SuperTabsPanGesture } from '../../super-tabs-pan-gesture';
import { SuperTabsConfig } from '../super-tabs/super-tabs';

@Component({
  selector: 'super-tabs-container',
  template: '<div #container><ng-content></ng-content></div>',
  encapsulation: ViewEncapsulation.None
})
export class SuperTabsContainer implements AfterViewInit, OnDestroy {

  /**
   * Component configuration
   * @type {SuperTabsConfig}
   */
  @Input()
  config: SuperTabsConfig;

  /**
   * Number of tabs
   * @type {number}
   */
  @Input()
  tabsCount: number = 0;

  /**
   * Selected tab index
   * @type {number}
   */
  @Input()
  selectedTabIndex: number;

  /**
   * Notifies when a tab is selected
   * @type {EventEmitter<Object>}
   */
  @Output()
  tabSelect: EventEmitter<{ index: number; changed: boolean; }> = new EventEmitter<{ index: number; changed: boolean; }>();

  /**
   * Notifies when the container is being dragged
   * @type {EventEmitter<TouchEvent>}
   */
  @Output()
  onDrag: EventEmitter<TouchEvent> = new EventEmitter<TouchEvent>();

  // View bindings

  /**
   * Container position
   * @type {number}
   */
  containerPosition: number = 0;

  // View children

  /**
   * The container wrapping all the tabs
   */
  @ViewChild('container')
  container: ElementRef;

  /**
   * Single tab width
   * @type {number}
   */
  tabWidth: number = 0;

  /**
   * Container width (sum of tab widths)
   * @type {number}
   */
  containerWidth: number = 0;


  // Animation stuff

  private minPosX: number;

  private maxPosX: number;

  private gesture: SuperTabsPanGesture;

  private globalSwipeEnabled: boolean = true;

  private swipeEnabledPerTab: {[index: number]: boolean} = {};

  constructor(
    private el: ElementRef,
    private rnd: Renderer2,
    private plt: Platform,
    private ngZone: NgZone
  ) {}

  ngAfterViewInit() {
    this.init();
  }

  ngOnDestroy() {
    this.gesture && this.gesture.destroy();
  }

  enableTabsSwipe(enable: boolean) {
    this.globalSwipeEnabled = enable;
  }

  enableTabSwipe(tabIndex: number, enable: boolean) {
    this.swipeEnabledPerTab[tabIndex] = enable;
  }

  refreshDimensions() {
    this.calculateContainerWidth();
{'fraction_non_alphanumeric': 0.13394123606889563, 'fraction_numerical': 0.0024316109422492403, 'mean_word_length': 3.4508566275924255, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5215227', 'n_tokens_mistral': 1602, 'n_tokens_neox': 1545, 'n_words': 383}