Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/forms / build / dist / src / deprecated / inputs / TextBox / deps / toAttributes.js
Size: Mime:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const toErrorProps_1 = require("./toErrorProps");
const toClassList_1 = require("./toClassList");
const toPassThroughProps_1 = require("./toPassThroughProps");
const toValidationProps_1 = require("./toValidationProps");
const toType_1 = require("./toType");
const createGetFromPropsOrState_1 = require("./createGetFromPropsOrState");
const toPlaceholder_1 = require("./toPlaceholder");
const toAccessibleProps_1 = require("./toAccessibleProps");
const toAriaLabel_1 = require("./toAriaLabel");
function toAttributes(instance) {
    const { props, state } = instance;
    const classList = toClassList_1.toClassList(props, state);
    const passthroughProps = toPassThroughProps_1.toPassThroughProps(props, state);
    const validationProps = toValidationProps_1.toValidationProps(props, state);
    const type = toType_1.toType(props, state);
    const get = createGetFromPropsOrState_1.createGetFromPropsOrState(instance);
    const placeholderText = toPlaceholder_1.toPlaceholder(props, state);
    const accessibleProps = toAccessibleProps_1.toAccessibleAttributes(props, state);
    const { hasError } = toErrorProps_1.toErrorProps(props, state);
    const animatePlaceholder = get('animatePlaceholder');
    const name = get('name');
    const isDisabled = get('isDisabled');
    // @todo should not come like this, should go as passthroughProps
    const dataQa = get('dataQa');
    const qa = get('qa');
    const wrapperProps = Object.assign({}, accessibleProps, { hasError });
    const labelText = get('labelText');
    const ariaLabel = toAriaLabel_1.toAriaLabel(props, state);
    const inputIcon = get('icon');
    return {
        passthroughProps,
        wrapperProps,
        validationProps,
        classList,
        placeholderText,
        animatePlaceholder,
        name,
        isDisabled,
        type,
        dataQa,
        qa,
        labelText,
        ariaLabel,
        inputIcon,
    };
}
exports.toAttributes = toAttributes;
//# sourceMappingURL=toAttributes.js.map