import { BaseInput } from './base-input.js';
|
import { e as e$1 } from './custom-element-30fc6381.js';
|
import { n as n$1 } from './base.component-813fc7cf.js';
|
import { x, i, r } from './query-assigned-elements-fea1f631.js';
|
import '@dh-software/furnview-icons';
|
|
/**
|
* @license
|
* Copyright 2020 Google LLC
|
* SPDX-License-Identifier: BSD-3-Clause
|
*/const e=Symbol.for(""),l=t=>{if((null==t?void 0:t.r)===e)return null==t?void 0:t._$litStatic$},o=t=>({_$litStatic$:t,r:e}),s=new Map,a=t=>(r,...e)=>{const o=e.length;let i,a;const n=[],u=[];let c,$=0,f=!1;for(;$<o;){for(c=r[$];$<o&&void 0!==(a=e[$],i=l(a));)c+=i+r[++$],f=!0;$!==o&&u.push(a),n.push(c),$++;}if($===o&&n.push(r[o]),f){const t=n.join("$$lit$$");void 0===(r=s.get(t))&&(n.raw=n,s.set(t,r=n)),e=u;}return t(r,...e)},n=a(x);
|
|
var css_248z = i`:host{height:auto}:host .input-field{height:auto;overflow:unset}:host fv-label{background:var(--labeled-input-label-background,#fff);font-size:var(--labeled-input-label-font-size,14px);left:var(--labeled-input-label-offset-left,5px);padding:var(--labeled-input-label-padding,0 5px);position:absolute;top:var(--labeled-input-label-offset-top,-11px)}`;
|
|
var __defProp = Object.defineProperty;
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
var __getProtoOf = Object.getPrototypeOf;
|
var __reflectGet = Reflect.get;
|
var __decorateClass = (decorators, target, key, kind) => {
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
if (decorator = decorators[i])
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
if (kind && result)
|
__defProp(target, key, result);
|
return result;
|
};
|
var __superStaticGet = (obj, member) => __reflectGet(__getProtoOf(obj), member, obj);
|
let LabeledInputComponent = class extends BaseInput {
|
constructor() {
|
super();
|
this.inputTag = "fv-input";
|
this.moveablePlaceholder = false;
|
}
|
render() {
|
if (this.moveablePlaceholder) {
|
return n`
|
<${o(this.inputTag)}
|
class="input-field"
|
@change="${this.OnBlurChange}"
|
@input=${this.OnChange}
|
?readonly=${this.readonly}
|
?moveable-placeholder=${this.moveablePlaceholder}
|
placeholder="${this.placeholder}"
|
.value="${this.value}">
|
</${o(this.inputTag)}>
|
`;
|
}
|
return n`
|
<${o(this.inputTag)} class="input-field" @change="${this.OnBlurChange}" @input=${this.OnChange} ?readonly=${this.readonly} .value="${this.value}">
|
<fv-label i18n="${this.textId}">${this.placeholder}</fv-label>
|
</${o(this.inputTag)}>
|
`;
|
}
|
getInputElement() {
|
var _a;
|
const baseElement = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector(this.inputTag);
|
if (baseElement && baseElement instanceof BaseInput) {
|
return baseElement._inputElement;
|
}
|
return void 0;
|
}
|
};
|
LabeledInputComponent.styles = [__superStaticGet(LabeledInputComponent, "styles") || [], r(css_248z)];
|
__decorateClass([
|
n$1({ type: String, reflect: true, attribute: true })
|
], LabeledInputComponent.prototype, "inputTag", 2);
|
__decorateClass([
|
n$1({ type: String, reflect: true, attribute: true })
|
], LabeledInputComponent.prototype, "textId", 2);
|
__decorateClass([
|
n$1({ type: Boolean, reflect: true, attribute: "moveable-placeholder" })
|
], LabeledInputComponent.prototype, "moveablePlaceholder", 2);
|
LabeledInputComponent = __decorateClass([
|
e$1("fv-labeled-input")
|
], LabeledInputComponent);
|
|
export { LabeledInputComponent };
|