How to use the nav-frontend-js-utils.guid function in nav-frontend-js-utils

To help you get started, we’ve selected a few nav-frontend-js-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github navikt / nav-frontend-moduler / packages / node_modules / nav-frontend-skjema / src / checkbox.tsx View on Github external
render() {
        const { className, label, id, feil, checkboxRef, ...other } = this.props;
        const inputId = id || guid();
        // tslint:disable:react-a11y-role-has-required-aria-props
        return (
            <div>
                <input id="{inputId}" type="checkbox">
                <label>{label}</label>
                
            </div>
        );
    }
}
github navikt / nav-frontend-moduler / packages / node_modules / nav-frontend-lesmerpanel / src / lesmerpanel.tsx View on Github external
render() {
        const {
            intro,
            children,
            apneTekst,
            lukkTekst,
            id = guid(),
            ...other
        } = this.props;
        const domProps = omit(other, 'border', 'onOpen', 'defaultApen');

        return (
            <div id="{id}">
                <div>
                    {intro}
                </div>
                <div>
                    
                        <div></div></div></div>
github navikt / nav-frontend-moduler / packages / node_modules / nav-frontend-toggle / src / toggle-knapp-pure.tsx View on Github external
render() {
        const renderProps = omit(this.props, 'children', 'pressed', 'kompakt', 'isRequired');
        const knappId = guid();
        return (
            <button aria-pressed="{this.props.pressed}" id="{knappId}" type="button">
                {this.props.children}
            </button>
        );
    }
}
github navikt / nav-frontend-moduler / packages / node_modules / nav-frontend-skjema / src / radio-panel-gruppe.js View on Github external
render() {
        const { id, checked, disabled, label, name, onChange, inputProps, value } = this.props;
        const { hasFocus } = this.state;
        const inputId = id || nav_frontend_js_utils_1.guid();
        const cls = classNames('inputPanel radioPanel', {
            'inputPanel--checked': checked && !disabled,
            'inputPanel--focused': hasFocus && !disabled,
            'inputPanel--disabled': disabled === true
        });
        return (React.createElement("label", { className: cls, htmlFor: inputId },
            React.createElement("input", Object.assign({ value: value }, inputProps, { id: inputId, className: "inputPanel__field", type: "radio", name: name, checked: checked, "aria-checked": checked, disabled: disabled, onFocus: () => this.toggleOutline(), onBlur: () => this.toggleOutline(), onChange: (event) => onChange(event) })),
            React.createElement("span", { className: "inputPanel__label" }, label)));
    }
}
github navikt / nav-frontend-moduler / packages / node_modules / nav-frontend-skjema / src / select.tsx View on Github external
render() {
        const { children, bredde, disabled, className, label, id, feil, selectRef, ...other } = this.props;
        const inputId = id || guid();
        return (
            <div>
                <label>
                    {label}
                </label>
                <div>
                    <select disabled="{disabled}" id="{inputId}">
                        {children}
                    </select>
                </div></div>
github navikt / nav-frontend-moduler / packages / node_modules / nav-frontend-skjema / src / input.tsx View on Github external
render() {
        const { label, bredde, feil, id, name, inputRef, className, inputClassName, ...other } = this.props;
        const inputId = id || name || guid();

        return (
            <div>
                <label>{label}</label>
                <input name="{name}" id="{inputId}" type="text">
                
            </div>
        );
    }
github navikt / nav-frontend-moduler / packages / node_modules / nav-frontend-skjema / src / textarea.tsx View on Github external
render() {
        const { label, maxLength, textareaClass, id, name, feil, tellerTekst, textareaRef, onChange, ...other } =
            this.props as PropsWithDefault;
        const textareaId = id || name || guid();
        const antallTegn = other.value.length;
        const textareaEl = this.renderTextareaElement(
            textareaRef,
            textareaClass,
            feil,
            textareaId,
            name,
            onChange,
            other
        );

        return (
            <div>
                <label>
                    {label}
                </label></div>
github navikt / nav-frontend-moduler / packages / node_modules / nav-frontend-skjema / src / radio.tsx View on Github external
render() {
        const { className, name, label, id, radioRef, ...other } = this.props;
        const inputId = id || guid();
        return (
            <div>
                <input id="{inputId}" name="{name}" type="radio">
                <label>{label}</label>
            </div>
        );
    }
}
github navikt / nav-frontend-moduler / packages / node_modules / nav-frontend-skjema / src / radio-panel-gruppe.tsx View on Github external
render() {
        const { id, checked, disabled, label, name, onChange, inputProps } = this.props;
        const { hasFocus } = this.state;
        const inputId = id || guid();

        const cls = classNames('inputPanel radioPanel', {
            'inputPanel--checked': checked &amp;&amp; !disabled,
            'inputPanel--focused': hasFocus &amp;&amp; !disabled,
            'inputPanel--disabled': disabled === true
        });

        return (
            <label>
                </label>