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.49.2 app/lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.35.2 app/lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.49.1 app/lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.49.0 app/lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.35.1 app/lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.35.0 app/lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.48.2 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.48.1 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.48.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.47.1 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.47.0 lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.34.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.46.1 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.46.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.45.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.44.3 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.44.2 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.44.1 lib/primer/forms/toggle_switch_input.ts
primer_view_components-0.33.0 lib/primer/forms/toggle_switch_input.ts
openproject-primer_view_components-0.44.0 lib/primer/forms/toggle_switch_input.ts