<commit_before>
import { CommonModule } from '@angular/common';
import { Directive, Component, EventEmitter, Output, NgModule, ChangeDetectorRef } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { IgxCheckboxModule } from '../checkbox/checkbox.component';
import { ColumnChooserBase } from './column-chooser-base';
import { ColumnChooserItemBase } from './column-chooser-item-base';
import { IgxInputGroupModule } from '../input-group/input-group.component';

@Directive({
    selector: '[igxColumnPinningItem]'
})
export class IgxColumnPinningItemDirective extends ColumnChooserItemBase {

    constructor() {
        super('pinned');
    }

    /**
     * Returns whether a pinnable column could be pinned.
     * ```typescript
     * const columnItem: IgxColumnPinningItemDirective;
     * this.columnItem.pinnable;
     * ```
     */
    get pinnable() {
        if (this.column.grid.getUnpinnedWidth(true) - this.column.width < this.column.grid.unpinnedAreaMinWidth) {
            return false;
        }
        return true;
    }
}

@Component({
    preserveWhitespaces: false,
    selector: 'igx-column-pinning',
    templateUrl: './column-pinning.component.html'
})
export class IgxColumnPinningComponent extends ColumnChooserBase {

    constructor(public cdr: ChangeDetectorRef) {
        super(cdr);
    }

    /**
     * @hidden
     */
    createColumnItem(container: any, column: any) {
        if (column.level !== 0) {
            return null;
        }
        const item = new IgxColumnPinningItemDirective();
        item.container = container;
        item.column = column;
        return item;
    }

    /**
     * Checks whether the checkbox value should be changed,
     * depending if the selected column could be pinned.
     * ```typescript
     * checkboxValueChange($event, columnItem);
     * ```
     * @param event
     * @param columnItem a PinningItemDirective
     */
    public checkboxValueChange(event, columnItem: IgxColumnPinningItemDirective) {
        if (event.checked && !columnItem.pinnable) {
            event.checkbox.checked = false;
            return false;
        }
        columnItem.value = !columnItem.value;
    }
}

/**
 * The IgxColumnPinningModule provides the {@link IgxColumnPinningComponent}, {@link IgxColumnPinningItemDirective} inside your application.
 */
@NgModule({
    declarations: [IgxColumnPinningComponent, IgxColumnPinningItemDirective],
    exports: [IgxColumnPinningComponent],
    imports: [
        IgxCheckboxModule,
        IgxInputGroupModule,
        CommonModule,
        FormsModule
    ]
})
export class IgxColumnPinningModule {
}
<commit_msg>chore(API): fix description for pinnable method<commit_after>
import { CommonModule } from '@angular/common';
import { Directive, Component, EventEmitter, Output, NgModule, ChangeDetectorRef } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { IgxCheckboxModule } from '../checkbox/checkbox.component';
import { ColumnChooserBase } from './column-chooser-base';
import { ColumnChooserItemBase } from './column-chooser-item-base';
import { IgxInputGroupModule } from '../input-group/input-group.component';

@Directive({
    selector: '[igxColumnPinningItem]'
})
export class IgxColumnPinningItemDirective extends ColumnChooserItemBase {

    constructor() {
        super('pinned');
    }

    /**
     * Returns whether a column could be pinned.
     * It's not possible to pin a column if there is not enough space for the unpinned area.
     * ```typescript
     * const columnItem: IgxColumnPinningItemDirective;
     * this.columnItem.pinnable;
     * ```
     */
    get pinnable() {
        if (this.column.grid.getUnpinnedWidth(true) - this.column.width < this.column.grid.unpinnedAreaMinWidth) {
            return false;
        }
        return true;
    }
}

@Component({
    preserveWhitespaces: false,
    selector: 'igx-column-pinning',
    templateUrl: './column-pinning.component.html'
})
export class IgxColumnPinningComponent extends ColumnChooserBase {

    constructor(public cdr: ChangeDetectorRef) {
        super(cdr);
    }

    /**
     * @hidden
     */
    createColumnItem(container: any, column: any) {
        if (column.level !== 0) {
            return null;
        }
        const item = new IgxColumnPinningItemDirective();
        item.container = container;
        item.column = column;
        return item;
    }

    /**
     * Checks whether the checkbox value should be changed,
     * depending if the selected column could be pinned.
     * ```typescript
     * checkboxValueChange($event, columnItem);
     * ```
     * @param event
     * @param columnItem a PinningItemDirective
     */
    public checkboxValueChange(event, columnItem: IgxColumnPinningItemDirective) {
        if (event.checked && !columnItem.pinnable) {
            event.checkbox.checked = false;
            return false;
        }
        columnItem.value = !columnItem.value;
    }
}

/**
 * The IgxColumnPinningModule provides the {@link IgxColumnPinningComponent}, {@link IgxColumnPinningItemDirective} inside your application.
 */
@NgModule({
    declarations: [IgxColumnPinningComponent, IgxColumnPinningItemDirective],
    exports: [IgxColumnPinningComponent],
    imports: [
        IgxCheckboxModule,
        IgxInputGroupModule,
        CommonModule,
        FormsModule
    ]
})
export class IgxColumnPinningModule {
}

{'fraction_non_alphanumeric': 0.10714285714285714, 'fraction_numerical': 0.0003681885125184094, 'mean_word_length': 2.9802197802197803, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2561270', 'n_tokens_mistral': 1606, 'n_tokens_neox': 1550, 'n_words': 353}