import { FluentComponent } from '../core/fluent-component'
import { createUniversalComponent } from '../core/component-factory'
class FluentInputInternal extends FluentComponent {
static tag = 'fluent-input'
static override get observedAttributes() {
return ['type', 'placeholder', 'value', 'disabled']
}
static override get renderAttributes() {
return ['type', 'placeholder', 'value', 'disabled']
}
render() {
const type = this.getAttribute('type') || 'text'
const placeholder = this.getAttribute('placeholder') || ''
const value = this.getAttribute('value') || ''
const disabled = this.hasAttribute('disabled') ? 'disabled' : ''
this.shadowRootRef.innerHTML = `
`
}
}
/**
* Universal Input Component
*/
export const FluentInput = createUniversalComponent({
tag: 'fluent-input',
class: FluentInputInternal,
events: ['input', 'change', 'blur', 'focus']
})
if (typeof window !== 'undefined') {
if (!customElements.get(FluentInputInternal.tag)) {
customElements.define(FluentInputInternal.tag, FluentInputInternal)
}
}