HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ns3133907 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64
User: cssnetorguk (1024)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //home/pbyh.co.uk/public_html/wp-content/plugins/complianz-gdpr/settings/src/Settings/Password.js
import {
    Component,
} from '@wordpress/element';

class Password extends Component {
    constructor() {
        super( ...arguments );
    }

    onChangeHandler(fieldValue) {
        let fields = this.props.fields;
        let field = this.props.field;
        fields[this.props.index]['value'] = fieldValue;
        setChangedField( field.id, fieldValue )
        this.setState({
            fields: fields,
        })
    }

    render(){
        let field = this.props.field;
        let fieldValue = field.value;
        let fields = this.props.fields;

        /**
         * There is no "PasswordControl" in WordPress react yet, so we create our own license field.
         */
        return (
            <div className="components-base-control">
             <div className="components-base-control__field">
                 <label
                     className="components-base-control__label"
                     htmlFor={field.id}>{field.label}</label>
                 <input className="components-text-control__input"
                        type="password"
                        id={field.id}
                        value={fieldValue}
                        onChange={ ( e ) => this.onChangeHandler(e.target.value) }
                 />
             </div>
            </div>
        );

    }
}

export default Password;