'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-a0b63bee.js');
const index$1 = require('./index-ef15ef00.js');

const DgaHelperText = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.helperText = '';
        this.error = false;
    }
    render() {
        var _a;
        return (index.h("div", { key: '3027091d08930ba6a5c9b1c6339ee6a07973288d', class: `dga-helper-text ${this.error ? "dga-helper-text--error" : ""}` }, index.h("span", { key: 'b8009e673984f1b8fd2d960ed15ca274d0cb31ba', class: "dga-helper-text__icon" }, this.helperTextIcon && ((_a = this.helperTextIcon) === null || _a === void 0 ? void 0 : _a.name) && index.h("dga-icon", { key: '51d329ecf87d97d2c6676253316fba7969ad7c87', icon: this.helperTextIcon.name, variant: this.helperTextIcon.variant, type: this.helperTextIcon.type, size: 16 })), index.h("span", { key: 'c3099672ca5b679e0b3f83a645d804d8e47de975', class: "dga-helper-text__desc" }, this.helperText)));
    }
};

const DgaLabel = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.label = '';
        this.variant = 'default';
        this.size = 'md';
        this.disabled = false;
        this.required = false;
    }
    render() {
        return (index.h("label", { key: '35cd780b901fca5fe50de1cd81ca1d44a2d2914c', class: `dga-label dga-label--${this.size} ${this.disabled ? "disabled" : ""}` }, this.required && index.h("span", { key: '5a35be9ee548d6a204c4e636d7198c2e0d41293d', class: "star" }, "*"), this.label));
    }
};

const feedbackIconTypes = {
    success: index.h("dga-icon", { icon: "CheckmarkCircle02Icon", variant: "solid" }),
    error: index.h("dga-icon", { icon: "AlertCircleIcon", variant: "solid" }),
    warning: index.h("dga-icon", { icon: "Alert02Icon", variant: "solid" }),
};
const DgaTextInput = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.size = 'lg';
        this.type = 'text';
        this.variant = 'default';
        this.error = false;
        this.feedbackIcon = false;
        this.feedbackIconType = 'success';
        this.feedbackIconRing = false;
        this.helperText = '';
        this.disabled = false;
        this.readonly = false;
        this.required = false;
        //   @Prop() id: string = guid();
        this.name = index$1.guid();
        this.value = '';
        this.isActive = false;
        this.isFocused = false;
    }
    // @Element() el: HTMLElement;
    //   handleFocus = () => {
    //     this.isFocused = true;
    //   };
    //   handleBlur = (e: FocusEvent) => {
    //     this.isFocused = false;
    //     if (this.onBlur) {
    //       this.onBlur(e);
    //     }
    //   };
    //   handleMouseDown = () => {
    //     this.isActive = true;
    //   };
    //   handleMouseUp = () => {
    //     this.isActive = false;
    //   };
    //   handleMouseOut = () => {
    //     this.isActive = false;
    //   };
    // componentWillLoad() {
    //   this.el.childNodes.forEach(item => {
    //     const el = item as HTMLElement;
    //     if (el.tagName === 'DGA-SLIDEOUT-MENU-ACTIONS' && el.attributes.getNamedItem('slot') === null) {
    //       el.setAttribute('slot', 'slideout-menu-actions');
    //     }
    //   });
    // }
    render() {
        return (index.h("div", { key: '19f0b99b9f435a38edd22905a3db29d8aff57cb6', class: "dga-form-control" }, this.label && index.h("dga-label", { key: '7e6a15e17be30c0f9a018a692bc6c992ab97e135', label: this.label, size: this.size, required: this.required, disabled: this.disabled }), index.h("div", { key: '0fa51c9f567dc1f842c35e4e1cfcc53006d91cd4', class: `input input--${this.size} ${this.error ? 'input--error' : ''} ${this.variant !== 'default' ? `input--${this.variant}` : ''} ${this.isActive ? 'active' : ''} ${this.isFocused ? 'focus' : ''} ${this.disabled ? 'input--disabled' : ''} ${this.readonly ? 'readOnly' : ''}`, ref: el => (this.inputContainerRef = el) }, index.h("slot", { key: 'a7074b723ada5e6baa0a2ee67bd74112ef25198b', name: "prefix" }), this.icon && (index.h("span", { key: '19f471c8ef43a45db98bc376a71d44223c8bf62b', class: "input__icon" }, index.h("dga-icon", { key: '8553ea7464f912dccbf27cbc44de3ccf53be559b', icon: this.icon.name, variant: this.icon.variant, type: this.icon.type, size: 20 }))), index.h("input", { key: '1b485d4d06d91fad904aaa87a982051d3549589c',
            // id={id}
            value: this.value, name: this.name, type: this.type, onFocus: () => (this.isFocused = true), onBlur: e => {
                this.isFocused = false;
                this.onBlur(e);
            }, class: "input__field", placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, required: this.required, onMouseDown: () => (this.isActive = true), onMouseUp: () => (this.isActive = false), onMouseOut: () => (this.isActive = false), onChange: this.onChange, onInput: this.onInput }), this.error ? (index.h("span", { class: `input__feedback-icon input__feedback-icon--error ${this.feedbackIconRing ? 'input__feedback-icon--ring' : ''}` })) : this.feedbackIcon ? (index.h("span", { class: `input__feedback-icon input__feedback-icon--${this.feedbackIconType} ${this.feedbackIconRing ? 'input__feedback-icon--ring' : ''}` }, feedbackIconTypes[this.feedbackIconType])) : null, index.h("slot", { key: 'a7428ebd28be904b9f9386cf58a8b54ee45836f2', name: "suffix" }), " "), this.helperText && index.h("dga-helper-text", { key: '3aabb5c06f1fb0ef3c58494197ab2c625a6c6aaa', helperText: this.helperText, helperTextIcon: this.helperTextIcon, error: this.error })));
    }
};

exports.dga_helper_text = DgaHelperText;
exports.dga_label = DgaLabel;
exports.dga_text_input = DgaTextInput;

//# sourceMappingURL=dga-helper-text_3.cjs.entry.js.map