Sha256: 8e47c1213e3857088e680f33e8707e5fa0cdf8442ae3001c4242bca0323d6a99

Contents?: true

Size: 875 Bytes

Versions: 117

Compression:

Stored size: 875 Bytes

Contents

/* eslint-disable custom-elements/expose-class-on-global */

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

@controller
export class ToggleSwitchInputElement extends HTMLElement {
  @target validationElement: HTMLElement
  @target validationMessageElement: HTMLElement

  connectedCallback() {
    this.addEventListener('toggleSwitchError', (event: Event) => {
      this.validationMessageElement.textContent = (event as CustomEvent).detail
      this.validationElement.removeAttribute('hidden')
    })

    this.addEventListener('toggleSwitchSuccess', () => {
      this.validationMessageElement.textContent = ''
      this.validationElement.setAttribute('hidden', 'hidden')
    })

    this.addEventListener('toggleSwitchLoading', () => {
      this.validationMessageElement.textContent = ''
      this.validationElement.setAttribute('hidden', 'hidden')
    })
  }
}

Version data entries

117 entries across 117 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.43.1 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.43.0 lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.32.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.42.0 lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.31.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.41.1 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.41.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.40.0 lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.30.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.39.1 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.39.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.38.0 lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.29.0 lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.28.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.37.1 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.37.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.36.2 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.36.1 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.36.0 lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.27.0 lib/primer/forms/toggle_switch_input.ts