<commit_before><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../tf-imports/lodash.html">
<link rel="import" href="../tf-dashboard-common/scrollbar-style.html">
<link rel="import" href="../tf-dashboard-common/run-color-style.html">
<link rel="import" href="../tf-storage/tf-storage.html">

<!--
tf-multi-checkbox creates a list of checkboxes that can be used to toggle on or off
a large number of values. Each checkbox displays a name, and may also have an
associated tooltip value. Checkboxes can be highlighted, hidden, and re-ordered.

tf-multi-checkbox assumes that the names may be very long compared to the width
of the checkbox, and the number of names may also be very large, and works to
handle these situations gracefully.
-->

<dom-module id="tf-multi-checkbox">
  <style include="scrollbar-style"></style>
  <style include="run-color-style"></style>

  <template>
    <div id="outer-container" class="scrollbar">
      <paper-input
        id="runs-regex"
        no-label-float
        label="Write a regex to filter runs"
        value="{{regexInput}}"
      ></paper-input>
      <template
        is="dom-repeat"
        items="[[namesMatchingRegex]]"
      >
        <div
          class="run-row"
        >
          <div class="checkbox-container vertical-align-container">
            <paper-checkbox
              class="checkbox vertical-align-center"
              name="[[item]]"
              checked$="[[_isChecked(item, runToIsCheckedMapping.*)]]"
              on-change="_checkboxChange"
            ></paper-checkbox>
          </div>
          <div class="item-label-container">
            <span>[[item]]</span>
          </div>
        </div>
      </template>
    </div>
  <style>
    paper-input {
      --paper-input-container-focus-color: var(--tb-orange-strong);
      --paper-input-container-input: {
        font-size: 14px;
      };
      --paper-input-container-label: {
        font-size: 14px;
      };
    }
    :host {
      display: flex;
      flex-direction: column;
      height: 100%;
    }
    #outer-container {
      overflow-y: auto;
      overflow-x: hidden;
      width: 100%;
      flex-grow: 1;
      flex-shrink: 1;
      word-wrap: break-word;
    }
    .run-row {
      padding-top: 5px;
      padding-bottom: 5px;
      display: flex;
      flex-direction: row;
      font-size: 13px;
    }
    .checkbox-container {
      flex-grow: 0;
      flex-shrink: 0;
    }
    .checkbox {
      padding-left: 2px;
      width: 32px;<commit_msg>- Make tf-run-selector's paper input be fixed on the layout so that it doesn't disappear when you scroll down tf-multi-checkbox. - Fix tf-run-selector's scrolling of firefox, it was expanding instead of scrolling. Change: 129369035<commit_after><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../tf-imports/lodash.html">
<link rel="import" href="../tf-dashboard-common/scrollbar-style.html">
<link rel="import" href="../tf-dashboard-common/run-color-style.html">
<link rel="import" href="../tf-storage/tf-storage.html">

<!--
tf-multi-checkbox creates a list of checkboxes that can be used to toggle on or off
a large number of values. Each checkbox displays a name, and may also have an
associated tooltip value. Checkboxes can be highlighted, hidden, and re-ordered.

tf-multi-checkbox assumes that the names may be very long compared to the width
of the checkbox, and the number of names may also be very large, and works to
handle these situations gracefully.
-->

<dom-module id="tf-multi-checkbox">
  <style include="scrollbar-style"></style>
  <style include="run-color-style"></style>

  <template>
      <paper-input
        id="runs-regex"
        no-label-float
        label="Write a regex to filter runs"
        value="{{regexInput}}"
      ></paper-input>
    <div id="outer-container" class="scrollbar">
      <template
        is="dom-repeat"
        items="[[namesMatchingRegex]]"
      >
        <div
          class="run-row"
        >
          <div class="checkbox-container vertical-align-container">
            <paper-checkbox
              class="checkbox vertical-align-center"
              name="[[item]]"
              checked$="[[_isChecked(item, runToIsCheckedMapping.*)]]"
              on-change="_checkboxChange"
            ></paper-checkbox>
          </div>
          <div class="item-label-container">
            <span>[[item]]</span>
          </div>
        </div>
      </template>
    </div>
  <style>
    paper-input {
      --paper-input-container-focus-color: var(--tb-orange-strong);
      --paper-input-container-input: {
        font-size: 14px;
      };
      --paper-input-container-label: {
        font-size: 14px;
      };
    }
    :host {
      display: flex;
      flex-direction: column;
      height: 100%;
    }
    #outer-container {
      overflow-y: auto;
      overflow-x: hidden;
      width: 100%;
      height: 0; /* Quirk to make firefox add scrolling instead of expand div */
      flex-grow: 1;
      flex-shrink: 1;
      word-wrap: break-word;
    }
    .run-row {
      padding-top: 5px;
      padding-bottom: 5px;
      display: flex;
      flex-direction: row;
      font-size: 13px;
    }
    .checkbox-container {
      flex-grow: 0;
      flex-shrink: 0;
    }
    .checkbox {
      padding-left: 2px;
      width: 32px;
{'fraction_non_alphanumeric': 0.14510083883633768, 'fraction_numerical': 0.009280742459396751, 'mean_word_length': 2.323843416370107, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 65, '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': '1795243', 'n_tokens_mistral': 1746, 'n_tokens_neox': 1666, 'n_words': 423}