UNPKG

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.

80 lines 3.15 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { LitElement, nothing } from 'lit'; import { property, query, state } from 'lit/decorators.js'; import { cache } from 'lit/directives/cache.js'; import { blazorDeepImport } from '../common/decorators/blazorDeepImport.js'; import { shadowOptions } from '../common/decorators/shadow-options.js'; import { EventEmitterMixin } from '../common/mixins/event-emitter.js'; import { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js'; import { nextInputId, renderInputShell, } from '../common/templates/input-shell.js'; let IgcInputBaseComponent = class IgcInputBaseComponent extends FormAssociatedRequiredMixin(EventEmitterMixin(LitElement)) { constructor() { super(...arguments); this._inputId = nextInputId(); this._labelElements = null; this.outlined = false; } get _resolvedLabelElements() { return this._labelElements ?? this._internals.labels; } _resolvePartNames(base) { return { [base]: true, prefixed: this._slots.hasAssignedElements('prefix', { selector: '[slot="prefix"]:not([hidden])', }), suffixed: this._slots.hasAssignedElements('suffix', { selector: '[slot="suffix"]:not([hidden])', }), filled: !!this.value, }; } select() { this._input?.select(); } focus(options) { this._input?.focus(options); } blur() { this._input?.blur(); } _renderFileParts() { return nothing; } render() { return cache(renderInputShell(this, { theme: this._themes.theme, label: this.label, labelId: this._inputId, containerParts: this._resolvePartNames('container'), renderInput: this._renderInput, renderFileParts: this._renderFileParts, })); } }; __decorate([ query('input') ], IgcInputBaseComponent.prototype, "_input", void 0); __decorate([ state() ], IgcInputBaseComponent.prototype, "_labelElements", void 0); __decorate([ property({ type: Boolean, reflect: true }) ], IgcInputBaseComponent.prototype, "outlined", void 0); __decorate([ property() ], IgcInputBaseComponent.prototype, "placeholder", void 0); __decorate([ property() ], IgcInputBaseComponent.prototype, "label", void 0); IgcInputBaseComponent = __decorate([ blazorDeepImport, shadowOptions({ delegatesFocus: true }) ], IgcInputBaseComponent); export { IgcInputBaseComponent }; //# sourceMappingURL=input-base.js.map