return (
<Button className="inline-hint" onClick={onClickAddProperty.bind(container, property, path)} label="Add" src={imgAdd} />
);
return (
<Button className="inline-hint" onClick={onClickAddProperty.bind(container, property, path)} label="Add" src={imgAdd} />
);
return (
<Button className="remove-property-action inline-hint" title="Remove" onClick={onClickRemoveProperty.bind(container, property, path)} label="Remove" src={imgRemove}/>
);
return (
<Button className="remove-property-action inline-hint" title="Remove" onClick={onClickRemoveProperty.bind(container, property, path)} label="Remove" src={imgRemove}/>
);
const isGuid = Property.isGuid(property);
const isBoolean = Property.isBoolean(property);
const isEnumeration = Property.isEnumeration(property);
const isGuid = Property.isGuid(property);
const isBoolean = Property.isBoolean(property);
const isEnumeration = Property.isEnumeration(property);
processFieldValueChange.bind(container, pathToProperty), 2000, {maxWait: 5000})); // max wait for short-name
// create an onChange event handler for a select field for the specified field path
const onSelectChange = changeHandler.bind(null, processFieldValueChange.bind(container, pathToProperty));
processFieldValueChange.bind(container, pathToProperty), 2000, {maxWait: 5000})); // max wait for short-name
// create an onChange event handler for a select field for the specified field path
const onSelectChange = changeHandler.bind(null, processFieldValueChange.bind(container, pathToProperty));
if (isEnumeration) {
const enumeration = Property.getEnumeration(property, value);
const options = enumeration.map((d, i) => {
if (isEnumeration) {
const enumeration = Property.getEnumeration(property, value);
const options = enumeration.map((d, i) => {
- className={ClassNames({'-value-not-set': !isValueSet})}
- defaultValue={value}
- title={pathToProperty}
- onChange={onSelectChange}
- onFocus={onFocus}
- onBlur={endEditing}
- onMouseDown={startEditing}
- onMouseOver={startEditing}
- readOnly={!isEditable}>
+ className={ClassNames({'-value-not-set': !isValueSet})}
+ defaultValue={value}
+ title={pathToProperty}
+ onChange={onSelectChange}
+ onFocus={onFocus}
+ onBlur={endEditing}
+ onMouseDown={startEditing}
+ onMouseOver={startEditing}
+ disabled={!isEditable}>
- <select
- key={fieldKey}
- id={fieldKey}
- className={ClassNames({'-value-not-set': !isValueSet})}
- defaultValue={value}
- title={pathToProperty}
- onChange={onSelectChange}
- onFocus={onFocus}
- onBlur={endEditing}
- onMouseDown={startEditing}
- onMouseOver={startEditing}
- readOnly={!isEditable}>
+ <select
+ key={fieldKey}
+ id={fieldKey}
+ className={ClassNames({'-value-not-set': !isValueSet})}
+ defaultValue={value}
+ title={pathToProperty}
+ onChange={onSelectChange}
+ onFocus={onFocus}
+ onBlur={endEditing}
+ onMouseDown={startEditing}
+ onMouseOver={startEditing}
+ disabled={!isEditable}>
- <select
- key={fieldKey}
- id={fieldKey}
- className={ClassNames({'-value-not-set': !isValueSet})}
- defaultValue={val && val.toUpperCase()}
- title={pathToProperty}
- onChange={onSelectChange}
- onFocus={onFocus}
- onBlur={endEditing}
- onMouseDown={startEditing}
- onMouseOver={startEditing}
- readOnly={!isEditable}>
+ <select
+ key={fieldKey}
+ id={fieldKey}
+ className={ClassNames({'-value-not-set': !isValueSet})}
+ defaultValue={val && val.toUpperCase()}
+ title={pathToProperty}
+ onChange={onSelectChange}
+ onFocus={onFocus}
+ onBlur={endEditing}
+ onMouseDown={startEditing}
+ onMouseOver={startEditing}
+ disabled={!isEditable}>
if (Property.isLeafEmpty(property)) {
// A null value indicates the leaf exists (as opposed to undefined).
// We stick in a string when the user actually sets it to simplify things
// but the correct thing happens when we serialize to user data
if (Property.isLeafEmpty(property)) {
// A null value indicates the leaf exists (as opposed to undefined).
// We stick in a string when the user actually sets it to simplify things
// but the correct thing happens when we serialize to user data
let present = isEmptyLeafPresent ? EMPTY_LEAF_PRESENT : "";
const options = [
<option key={'true'} value={EMPTY_LEAF_PRESENT}>Enabled</option>,
let present = isEmptyLeafPresent ? EMPTY_LEAF_PRESENT : "";
const options = [
<option key={'true'} value={EMPTY_LEAF_PRESENT}>Enabled</option>,
- <select
- key={fieldKey}
- id={fieldKey}
- className={ClassNames({'-value-not-set': !isEmptyLeafPresent})}
- defaultValue={present}
- title={pathToProperty}
- onChange={onSelectChange}
- onFocus={onFocus}
- onBlur={endEditing}
- onMouseDown={startEditing}
- onMouseOver={startEditing}
- readOnly={!isEditable}>
+ <select
+ key={fieldKey}
+ id={fieldKey}
+ className={ClassNames({'-value-not-set': !isEmptyLeafPresent})}
+ defaultValue={present}
+ title={pathToProperty}
+ onChange={onSelectChange}
+ onFocus={onFocus}
+ onBlur={endEditing}
+ onMouseDown={startEditing}
+ onMouseOver={startEditing}
+ disabled={!isEditable}>
- <textarea
- key={fieldKey}
- cols="5"
- id={fieldKey}
- defaultValue={value}
- placeholder={placeholder}
- onChange={onTextChange}
- onFocus={onFocus}
- onBlur={endEditing}
- onMouseDown={startEditing}
- onMouseOver={startEditing}
- onMouseOut={endEditing}
- onMouseLeave={endEditing}
- readOnly={!isEditable} />
+ <textarea
+ key={fieldKey}
+ cols="5"
+ id={fieldKey}
+ defaultValue={value}
+ placeholder={placeholder}
+ onChange={onTextChange}
+ onFocus={onFocus}
+ onBlur={endEditing}
+ onMouseDown={startEditing}
+ onMouseOver={startEditing}
+ onMouseOut={endEditing}
+ onMouseLeave={endEditing}
+ disabled={!isEditable} />
// write the current choice value into the state
let choiceObject = utils.resolvePath(this.model, [name, selected].join('.'));
let isTopCase = false;
// write the current choice value into the state
let choiceObject = utils.resolvePath(this.model, [name, selected].join('.'));
let isTopCase = false;
- <select
- key={Date.now()}
- className={ClassNames({'-value-not-set': !selectedOptionValue})}
- defaultValue={selectedOptionValue}
- onChange={onChange}
- onFocus={onFocus}
- onBlur={endEditing}
- onMouseDown={startEditing}
- onMouseOver={startEditing}
- onMouseOut={endEditing}
+ <select
+ key={Date.now()}
+ className={ClassNames({'-value-not-set': !selectedOptionValue})}
+ defaultValue={selectedOptionValue}
+ onChange={onChange}
+ onFocus={onFocus}
+ onBlur={endEditing}
+ onMouseDown={startEditing}
+ onMouseOver={startEditing}
+ onMouseOut={endEditing}
let field;
const valuePath = path.slice();
// create a unique field Id for use as react component keys and html element ids
let field;
const valuePath = path.slice();
// create a unique field Id for use as react component keys and html element ids
// keys only need to be unique on components in the same array
// html element ids should be unique with the document (or form)
let fieldId = uniqueId;
// keys only need to be unique on components in the same array
// html element ids should be unique with the document (or form)
let fieldId = uniqueId;