<commit_before>﻿import * as React from 'react'
import { StyleContext, TypeContext } from '../Lines';
import { classes, addClass } from '../Globals';

import "./Lines.css"

export interface FormControlReadonlyProps extends React.Props<FormControlReadonly> {
    ctx: StyleContext;
    htmlAttributes?: React.HTMLAttributes<any>;
    className?: string
}

export class FormControlReadonly extends React.Component<FormControlReadonlyProps>
{
    render() {
        const ctx = this.props.ctx;

        var attrs = this.props.htmlAttributes;


        var formControlClasses = ctx.readonlyAsPlainText ? ctx.formControlPlainTextClass : classes(ctx.formControlClass, "readonly");

        return (
            <div {...attrs} className={classes(formControlClasses, attrs && attrs.className, this.props.className)}>
                {this.props.children || "\u00A0" /*To get min height*/}
            </div>
        );
    }
}<commit_msg>Revert to last Version and set ccs styleoption for deactivate pointer events.<commit_after>﻿import * as React from 'react'
import { StyleContext, TypeContext } from '../Lines';
import { classes, addClass } from '../Globals';

import "./Lines.css"
import { navigatorIsReadOnly } from '../../../../Extensions/Signum.React.Extensions/Authorization/AuthClient';

export interface FormControlReadonlyProps extends React.Props<FormControlReadonly> {
    ctx: StyleContext;
    htmlAttributes?: React.HTMLAttributes<any>;
    className?: string
}

export class FormControlReadonly extends React.Component<FormControlReadonlyProps>
{
    render() {
        const ctx = this.props.ctx;

        var attrs = this.props.htmlAttributes;
        
        if (ctx.readonlyAsPlainText) {
            return (
                <p {...attrs} className={classes(ctx.formControlPlainTextClass, attrs && attrs.className, this.props.className)}>
                    {this.props.children}
                </p>
            );

        } else {
            return (
                <input type="text" style={{ pointerEvents: "none" }} readOnly {...attrs} className={classes(ctx.formControlClass, attrs && attrs.className, this.props.className)}
                    value={React.Children.toArray(this.props.children)[0] as string || ""} />
            );
        }
    }
}
{'fraction_non_alphanumeric': 0.12478031634446397, 'fraction_numerical': 0.0017574692442882249, 'mean_word_length': 2.826890756302521, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3307933', 'n_tokens_mistral': 615, 'n_tokens_neox': 611, 'n_words': 142}