Sha256: 7fb1deb0155b2ed53fb4d59b5c8a7b81799a2979bd0d690b5a8fd420c349e818

Contents?: true

Size: 1.05 KB

Versions: 22

Compression:

Stored size: 1.05 KB

Contents

import {controller, target, targets} from '@github/catalyst'

@controller
class SubHeaderElement extends HTMLElement {
  @target filterInput: HTMLElement
  @targets hiddenItemsOnExpandedFilter: HTMLElement[]
  @targets shownItemsOnExpandedFilter: HTMLElement[]

  expandFilterInput() {
    for (const item of this.hiddenItemsOnExpandedFilter) {
      item.classList.add('d-none')
    }

    for (const item of this.shownItemsOnExpandedFilter) {
      item.classList.remove('d-none')
    }

    this.classList.add('d-flex')

    this.filterInput.focus()
  }

  collapseFilterInput() {
    for (const item of this.hiddenItemsOnExpandedFilter) {
      item.classList.remove('d-none')
    }

    for (const item of this.shownItemsOnExpandedFilter) {
      item.classList.add('d-none')
    }

    this.classList.remove('d-flex')
  }
}

declare global {
  interface Window {
    SubHeaderElement: typeof SubHeaderElement
  }
}

if (!window.customElements.get('sub-header')) {
  window.SubHeaderElement = SubHeaderElement
  window.customElements.define('sub-header', SubHeaderElement)
}

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
openproject-primer_view_components-0.43.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.42.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.41.1 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.41.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.40.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.39.1 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.39.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.38.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.37.1 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.37.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.36.2 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.36.1 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.36.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.35.2 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.35.1 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.35.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.34.0 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.33.2 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.33.1 app/components/primer/open_project/sub_header_element.ts
openproject-primer_view_components-0.33.0 app/components/primer/open_project/sub_header_element.ts