<commit_before><!--
@license
Copyright (c) 2017 Vaadin Ltd.
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
-->

<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="../vaadin-themable-mixin/vaadin-themable-mixin.html">

<style>
  @font-face {
    font-family: "vaadin-grid-hierarchy-toggle-icons";
    src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAASkAAsAAAAABFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIEaGNtYXAAAAFoAAAAVAAAAFQYmtABZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAJAAAACQjc80tmhlYWQAAAJUAAAANgAAADYOnDBhaGhlYQAAAowAAAAkAAAAJAcCA8hobXR4AAACsAAAABwAAAAcEgADAGxvY2EAAALMAAAAEAAAABAAYgCIbWF4cAAAAtwAAAAgAAAAIAAJAAVuYW1lAAAC/AAAAYYAAAGGmUoJ+3Bvc3QAAASEAAAAIAAAACAAAwAAAAMDgAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA574DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOe+//3//wAAAAAAIOe8//3//wAB/+MYSAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQDAAQADQALAAAIAABMhAcACgP7AAsD+QAAAAAEBAACAAsADAAACAAABEQECwP5AAwD9gAFAAAABAUAAgAMAAwAAAgAAJREBAUABwIACgP7AAAAAAQAAAAAAAFCR<KEY>AAAAAAAA) format('woff');
    font-weight: normal;
    font-style: normal;
  }
</style>

<dom-module id="vaadin-grid-hierarchy-toggle">
  <template>
    <style>
      :host {
        display: inline-flex;
        align-items: baseline;
      }

      :host([hidden]) {
        display: none !important;
      }

      :host(:not([icon-hidden])) {
        cursor: pointer;
      }

      [part="spacer"],
      [part="toggle"] {
        flex: none;
      }

      [part="spacer"] {
        display: inline-block;
        width: var(--level, '0em');
      }

      [part="toggle"]::before {
        font-family: "vaadin-grid-hierarchy-toggle-icons";
        line-height: 1em; /* make icon font metrics not affect baseline */
      }

      :host(:not([expanded])) [part="toggle"]::before {
        content: "\e7be\00a0"; /* icon glyph + single non-breaking space */
      }

      :host(:not([expanded])) [part="toggle"]:dir(rtl)::before {
        content: "\e7bd\00a0";
      }

      :host([expanded]) [part="toggle"]::before {
        content: "\e7bc\00a0";
      }

      :host([icon-hidden]) [part="toggle"] {
        visibility: hidden;
      }
    </style>

    <span part="spacer"></span>
    <span part="toggle"></span>
    <slot></slot>
  </template>
</dom-module>

<script>
  {
    /**
     * `<vaadin-grid-hierarchy-toggle>` is a helper element for the `<vaadin-grid>`
     * that provides toggle and level display functionality for the item hierarchy.
     *
     * #### Example:
     * ```html
     * <vaadin-grid-column>
     *   <template class="header">Package name</template>
     *   <template>
     *     <vaadin-grid-hierarchy-toggle
     *         icon-hidden="[[!item.hasChildren]]"
     *         expanded="{{expanded}}"
     *         level="[[level]]">
     *       [[item.name]]
     *     </vaadin-grid-hierarchy-toggle>
     *   </template>
     * </vaadin-grid-column>
     * ```
     *
     * @memberof Vaadin
     * @mixes Vaadin.ThemableMixin
     */
    class GridHierarchyToggleElement extends Vaadin.ThemableMixin(Polymer.Element) {
      static get is() {
        return 'vaadin-grid-hierarchy-toggle';
      }

      static get properties() {
        return {
          /**
           * Current level of the hierarchy represented with a horizontal offset
           * of the toggle button.
           */
          level: {
            type: Number,
            value: 0,
            observer: '_levelChanged'
          },

          /**
           * Hides the toggle icon and disables toggling a hierarchy sublevel.
           */
          iconHidden: {
            type: Boolean,
            value: false,
            reflectToAttribute: true
          },

          /**
           * Sublevel toggle state.
           */
          expanded: {
            type: Boolean,
            value: false,
            reflectToAttribute: true,
            notify: true
          }
        };
      }

      ready() {
        super.ready();

        this.addEventListener('click', e => this._onClick(e));
      }

      _onClick(e) {
        if (this.iconHidden) {
          return;
        }

        e.preventDefault();
        this.expanded = !this.expanded;
      }

      _levelChanged(level) {
        const value = Number(level) + 'em';
        this.updateStyles({'--level': value});
        this.style['--level'] = value;
      }
    }

    customElements.define(GridHierarchyToggleElement.is, GridHierarchyToggleElement);

    /**
     * @namespace Vaadin
     */
    window.Vaadin = window.Vaadin || {};
    Vaadin.GridHierarchyToggleElement = GridHierarchyToggleElement;
  }
</script>
<commit_msg>Fix hierarchy toggle icons for MSIE 11<commit_after><!--
@license
Copyright (c) 2017 Vaadin Ltd.
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
-->

<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="../vaadin-themable-mixin/vaadin-themable-mixin.html">

<style>
  @font-face {
    font-family: "vaadin-grid-hierarchy-icons";
    src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAQoAA0AAAAABvgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAEDAAAABoAAAAcgGQ0kEdERUYAAAPwAAAAHAAAAB4AJwAOT1MvMgAAAZQAAAA/AAAAYA8TBIJjbWFwAAAB8AAAAFUAAAFeGJvXWmdhc3AAAAPoAAAACAAAAAgAAAAQZ2x5ZgAAAlwAAABLAAAAhIrPOhFoZWFkAAABMAAAACsAAAA2Dqpie2hoZWEAAAFcAAAAHQAAACQHAgPHaG10eAAAAdQAAAAZAAAAHAxVAgBsb2NhAAACSAAAABIAAAASAIAAVG1heHAAAAF8AAAAGAAAACAACgAFbmFtZQAAAqgAAAEGAAACi/tBDcRwb3N0AAADsAAAADYAAABZQ7Ajh3icY2BkYGAA4va5i9/F89t8ZeBmYQCBa2r89sg0swMziOJgYAJRAAAxB0oAeJxjYGRgYD7w/wADAwsDCDA7MDAyoAI2AFEEAtIAAAB4nGNgZGBg4GBgZgDRDAxMDGgAAAGbABB4nGNgZp7JOIGBlYGBaSbTGQYGhn4IzfiawZiRkwEVMAqgCTA4MDA+38d84P8BBgdmIAapQZJVYGAEAGc/C54AeJxjYYAAxlAIzQTELAwMBxgZGB0ACy0BYwAAAHicY2BgYGaAYBkGRgYQiADyGMF8FgYbIM3FwMHABISMDArP9/3/+/8/WJXC8z0Q9v8nEp5gHVwMMMAIMo+RDYiZoQJMQIKJARUA7WBhGN4AACFKDtoAAAAAAAAAAAgACAAQABgAJgA0AEIAAHichYvBEYBADAKBVHBjBT4swl9KS2k05o0XHd/yW1hAfBFwCv9sIlJu3nZaNS3PXAaXXHI8Lge7DlzF7C1RgXc7xkK6+gvcD2URmQB4nLWOQWrDMBRER4mT0gS6Kl00Gx2gNgmEkBMUssgmlO4VS8iCIBXbCfgOPUbXPUPpqbrs2PwrWEboaTwzXwAe8A2FfimssBee4A5WeEr9Szgj/wnPsFQvwnOs1IfwAs/qlymV3VPZDQ09TzjrTXhK/SKckX+EZ3hSj8Jz7NReeIGt+sQNhp9FQEQOj5pkSRVPx5vhLnnrqAVSoq8BbsbYEHNfB5tXwdWmLqsuD2WK/Hli0uPK1/RpnJy/XgxhjFljdL4PyYb+3q2xQYE1ZVc3IUW9KdbjzH0dXC0nenZE6Wl5Wmpndmkchq4jd+8tGEqx1d5FdrXO6nOnD2U6phQL/AOVkHyhAAB4nGNgYsAPOBgYGJkYmBiZGZgZWRhZGdnY0nMqCzIM2UvzMg0MDMC0q7mTM5R2gdKuAO+pC5cAAAABAAH//wAPeJxjYGRgYOABYjEgZmJgBEJ2IGYB8xgAA+sANnicY2BgYGQAgisSYoIg+poavz2MBgAn2AOpAAA=) format('woff');
    font-weight: normal;
    font-style: normal;
  }
</style>

<dom-module id="vaadin-grid-hierarchy-toggle">
  <template>
    <style>
      :host {
        display: inline-flex;
        align-items: baseline;
      }

      :host([hidden]) {
        display: none !important;
      }

      :host(:not([icon-hidden])) {
        cursor: pointer;
      }

      [part="spacer"],
      [part="toggle"] {
        flex: none;
      }

      [part="spacer"] {
        display: inline-block;
        width: var(--level, '0em');
      }

      [part="toggle"]::before {
        font-family: "vaadin-grid-hierarchy-icons";
        line-height: 1em; /* make icon font metrics not affect baseline */
      }

      :host(:not([expanded])) [part="toggle"]::before {
        content: "\e7be\00a0"; /* icon glyph + single non-breaking space */
      }

      :host(:not([expanded])) [part="toggle"]:dir(rtl)::before {
        content: "\e7bd\00a0";
      }

      :host([expanded]) [part="toggle"]::before {
        content: "\e7bc\00a0";
      }

      :host([icon-hidden]) [part="toggle"] {
        visibility: hidden;
      }
    </style>

    <span part="spacer"></span>
    <span part="toggle"></span>
    <slot></slot>
  </template>
</dom-module>

<script>
  {
    /**
     * `<vaadin-grid-hierarchy-toggle>` is a helper element for the `<vaadin-grid>`
     * that provides toggle and level display functionality for the item hierarchy.
     *
     * #### Example:
     * ```html
     * <vaadin-grid-column>
     *   <template class="header">Package name</template>
     *   <template>
     *     <vaadin-grid-hierarchy-toggle
     *         icon-hidden="[[!item.hasChildren]]"
     *         expanded="{{expanded}}"
     *         level="[[level]]">
     *       [[item.name]]
     *     </vaadin-grid-hierarchy-toggle>
     *   </template>
     * </vaadin-grid-column>
     * ```
     *
     * @memberof Vaadin
     * @mixes Vaadin.ThemableMixin
     */
    class GridHierarchyToggleElement extends Vaadin.ThemableMixin(Polymer.Element) {
      static get is() {
        return 'vaadin-grid-hierarchy-toggle';
      }

      static get properties() {
        return {
          /**
           * Current level of the hierarchy represented with a horizontal offset
           * of the toggle button.
           */
          level: {
            type: Number,
            value: 0,
            observer: '_levelChanged'
          },

          /**
           * Hides the toggle icon and disables toggling a hierarchy sublevel.
           */
          iconHidden: {
            type: Boolean,
            value: false,
            reflectToAttribute: true
          },

          /**
           * Sublevel toggle state.
           */
          expanded: {
            type: Boolean,
            value: false,
            reflectToAttribute: true,
            notify: true
          }
        };
      }

      ready() {
        super.ready();

        this.addEventListener('click', e => this._onClick(e));
      }

      _onClick(e) {
        if (this.iconHidden) {
          return;
        }

        e.preventDefault();
        this.expanded = !this.expanded;
      }

      _levelChanged(level) {
        const value = Number(level) + 'em';
        this.updateStyles({'--level': value});
        this.style['--level'] = value;
      }
    }

    customElements.define(GridHierarchyToggleElement.is, GridHierarchyToggleElement);

    /**
     * @namespace Vaadin
     */
    window.Vaadin = window.Vaadin || {};
    Vaadin.GridHierarchyToggleElement = GridHierarchyToggleElement;
  }
</script>

{'fraction_non_alphanumeric': 0.1216320246343341, 'fraction_numerical': 0.021170130869899922, 'mean_word_length': 2.640280210157618, 'pattern_counts': {'":': 0, '<': 62, '<?xml version=': 0, '>': 64, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 13, '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': '6119795', 'n_tokens_mistral': 4065, 'n_tokens_neox': 3818, 'n_words': 478}