<commit_before>/*  ============================================================================

 Copyright (C) 2006-2016 Talend Inc. - www.talend.com

 This source code is available under agreement available at
 https://github.com/Talend/data-prep/blob/master/LICENSE

 You should have received a copy of the agreement
 along with this program; if not, write to Talend SA
 9 rue Pages 92150 Suresnes, France

 ============================================================================*/

import ScFilterBarctrl from './filter-bar-controller.js';

const ScFilterBarComponent = {
    template: `
    <div id="filter-bar" >
        <div class="filter-bar-header">
            <sc-filter-monitor class="monitor"
                filters="$ctrl.filters"
                on-toogle=""
                state="$ctrl.state"
                nb-lines="$ctrl.nbLines"
                nb-total-lines="$ctrl.nbTotalLines"
                title="Toggle all filters"
                render-percentage-message= "$ctrl.renderPercentageMessage()">
            </sc-filter-monitor>
            <a id="reset-filters"
               class="filters-remove"
               data-icon="e"
               ng-click="$ctrl.onRemoveAllFilters()"
               title="Remove all filters"
               ng-if="$ctrl.filters && $ctrl.filters.length > 0">
            </a>
        </div>
      
    <!--
    TODO when implementing manual filter
    <sc-filter-search class="search"></sc-filter-search>
        -->
        <sc-filter-list class="list"
            filters="$ctrl.filters"
            on-filter-remove-value="$ctrl.removeFilterValue(filter, value)"
            on-filter-remove="$ctrl.removeFilter(filter)"
            on-filter-edit="$ctrl.editFilter(filter, newValue, oldValue)"
            removable="$ctrl.removable"
            render-value-fn="$ctrl.renderValue(colId, value)">
        </sc-filter-list>
    </div>`,
    bindings: {
        filters: '<',
        onFilterRemoveValue: '&',
        onFilterRemove: '&',
        onFilterEdit: '&',
        onRemoveAllFilters: '&',
        removable: '<',
        nbLines: '<',
        nbTotalLines: '<',
        state: '=',
        renderPercentageMessage: '&',
        renderValueFn: '&'
    },
    controller: ScFilterBarctrl
};

export default ScFilterBarComponent;<commit_msg>TDS-886: adding on toggle binding<commit_after>/*  ============================================================================

 Copyright (C) 2006-2016 Talend Inc. - www.talend.com

 This source code is available under agreement available at
 https://github.com/Talend/data-prep/blob/master/LICENSE

 You should have received a copy of the agreement
 along with this program; if not, write to Talend SA
 9 rue Pages 92150 Suresnes, France

 ============================================================================*/

import ScFilterBarctrl from './filter-bar-controller.js';

const ScFilterBarComponent = {
    template: `
    <div id="filter-bar" >
        <div class="filter-bar-header">
            <sc-filter-monitor class="monitor"
                filters="$ctrl.filters"
                on-toogle="$ctrl.onFilterState()"
                state="$ctrl.state"
                nb-lines="$ctrl.nbLines"
                nb-total-lines="$ctrl.nbTotalLines"
                title="Toggle all filters"
                render-percentage-message= "$ctrl.renderPercentageMessage()">
            </sc-filter-monitor>
            <a id="reset-filters"
               class="filters-remove"
               data-icon="e"
               ng-click="$ctrl.onRemoveAllFilters()"
               title="Remove all filters"
               ng-if="$ctrl.filters && $ctrl.filters.length > 0">
            </a>
        </div>
      
    <!--
    TODO when implementing manual filter
    <sc-filter-search class="search"></sc-filter-search>
        -->
        <sc-filter-list class="list"
            filters="$ctrl.filters"
            on-filter-remove-value="$ctrl.removeFilterValue(filter, value)"
            on-filter-remove="$ctrl.removeFilter(filter)"
            on-filter-edit="$ctrl.editFilter(filter, newValue, oldValue)"
            removable="$ctrl.removable"
            render-value-fn="$ctrl.renderValue(colId, value)">
        </sc-filter-list>
    </div>`,
    bindings: {
        filters: '<',
        onFilterRemoveValue: '&',
        onFilterRemove: '&',
        onFilterEdit: '&',
        onRemoveAllFilters: '&',
        onFilterState: '&',
        removable: '<',
        nbLines: '<',
        nbTotalLines: '<',
        state: '=',
        renderPercentageMessage: '&',
        renderValueFn: '&'
    },
    controller: ScFilterBarctrl
};

export default ScFilterBarComponent;
{'fraction_non_alphanumeric': 0.1925122314401191, 'fraction_numerical': 0.007019783024888321, 'mean_word_length': 2.2494816862474085, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '972547', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1224, 'n_words': 238}