igniteui-webcomponents
Version:
Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.
38 lines • 1.36 kB
JavaScript
import { html } from 'lit';
import { ifDefined } from 'lit/directives/if-defined.js';
import { live } from 'lit/directives/live.js';
import { partMap } from '../part-map.js';
import { bindIf } from '../util.js';
export function renderMaskedNativeInput(opts) {
return html `
<input
id=${ifDefined(opts.id)}
type="text"
part=${partMap(opts.partNames)}
name=${ifDefined(opts.name)}
.value=${live(opts.value)}
.placeholder=${opts.placeholder}
?readonly=${opts.readOnly}
?disabled=${opts.disabled}
?autofocus=${opts.autofocus}
inputmode=${ifDefined(opts.inputMode)}
tabindex=${bindIf(opts.tabindex != null, opts.tabindex)}
aria-describedby=${bindIf(!!opts.ariaDescribedBy, opts.ariaDescribedBy)}
.ariaLabelledByElements=${opts.ariaLabelledByElements ?? null}
@input=${opts.onInput}
@focus=${opts.onFocus}
@blur=${opts.onBlur}
@click=${opts.onClick}
@keydown=${opts.onSetMaskSelection}
@cut=${opts.onSetMaskSelection}
@dragstart=${opts.onSetMaskSelection}
@compositionstart=${opts.onCompositionStart}
@compositionend=${opts.onCompositionEnd}
@change=${opts.onChange}
@wheel=${opts.onWheel}
@dragenter=${opts.onDragEnter}
@dragleave=${opts.onDragLeave}
/>
`;
}
//# sourceMappingURL=masked-input.js.map