Sha256: b9ad15815885653be45df387a8ceab639cca061db5cf7381595a6b87408dc13a

Contents?: true

Size: 629 Bytes

Versions: 2

Compression:

Stored size: 629 Bytes

Contents

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.innerText = (event as CustomEvent).detail
      this.validationElement.removeAttribute('hidden')
    })

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yattho_view_components-0.1.1 lib/yattho/forms/toggle_switch_input.ts
yattho_view_components-0.0.1 lib/yattho/forms/toggle_switch_input.ts