mirror of https://github.com/docusealco/docuseal
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							22 lines
						
					
					
						
							678 B
						
					
					
				
			
		
		
	
	
							22 lines
						
					
					
						
							678 B
						
					
					
				import { actionable } from '@github/catalyst/lib/actionable'
 | 
						|
 | 
						|
export default actionable(class extends HTMLElement {
 | 
						|
  trigger (event) {
 | 
						|
    const elementIds = JSON.parse(this.dataset.elementIds)
 | 
						|
 | 
						|
    if (event.target.type === 'checkbox') {
 | 
						|
      elementIds.forEach((elementId) => {
 | 
						|
        document.getElementById(elementId)?.classList.toggle('hidden')
 | 
						|
      })
 | 
						|
    } else {
 | 
						|
      elementIds.forEach((elementId) => {
 | 
						|
        document.getElementById(elementId).classList.toggle('hidden', (event.target.dataset.toggleId || event.target.value) !== elementId)
 | 
						|
      })
 | 
						|
    }
 | 
						|
 | 
						|
    if (this.dataset.focusId) {
 | 
						|
      document.getElementById(this.dataset.focusId)?.focus()
 | 
						|
    }
 | 
						|
  }
 | 
						|
})
 |