How to use @talend/react-forms - 10 common examples

To help you get started, we’ve selected a few @talend/react-forms 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 Talend / ui / packages / components-kit / src / components / ComponentForm / ComponentForm.component.js View on Github external
export function resolveNameForTitleMap({ schema, properties, value }) {
	if (schema.titleMap) {
		// Here we add a field side by side with the value
		// to keep the title associated to the value
		const info = schema.titleMap.find(titleMap => titleMap.value === value);

		const parentKey = schema.key.slice();
		const key = parentKey.pop();
		const nameKey = `$${key}_name`;
		const parentValue = getValue(properties, { key: parentKey });

		if (info) {
			parentValue[nameKey] = info.name;
		} else {
			delete parentValue[nameKey];
		}
	}
}
github Talend / ui / packages / containers / src / ComponentForm / ComponentForm.component.js View on Github external
return;
	}

	// Here we add a field side by side with the value
	// to keep the title associated to the value
	const valueIsArray = Array.isArray(value);
	const uniformValue = valueIsArray ? value : [value];

	const names = uniformValue
		.map(nextValue => schema.titleMap.find(titleMap => titleMap.value === nextValue))
		.map(entry => entry && entry.name);

	const parentKey = schema.key.slice();
	const key = parentKey.pop();
	const nameKey = `$${key}_name`;
	const parentValue = getValue(properties, { key: parentKey });

	if (names.some(name => name !== undefined)) {
		parentValue[nameKey] = valueIsArray ? names : names[0];
	} else {
		delete parentValue[nameKey];
	}
}
github Talend / ui / packages / containers / src / ComponentForm / fields / Datalist / Datalist.component.js View on Github external
function resolveName(value) {
		// create schema to get entry name from internal properties
		const key = Array.from(props.schema.key);
		key[key.length - 1] = `$${key[key.length - 1]}_name`;

		const nameSchema = { ...props.schema, key };
		return getValue(props.properties, nameSchema) || value;
	}
github Talend / ui / packages / containers / src / ComponentForm / kit / defaultRegistry.js View on Github external
function updateProperties({ body, trigger, properties }) {
	const targetPath = trigger.options[0].path;
	const schema = { key: targetPath.split('.') };
	const value = trigger.options[0].type === 'object' ? body : body.data;
	return {
		properties: mutateValue(properties, schema, value),
	};
}
github Talend / component-runtime / component-kit.js / src / service.js View on Github external
function getNewErrors(errors, schema, errorMessage) {
  if (errorMessage) {
    return addError(errors, schema, errorMessage);
  } else if (getError(errors, schema) !== undefined) {
    return removeError(errors, schema);
  }
  return errors;
}
github Talend / component-runtime / component-kit.js / src / service.js View on Github external
function getNewErrors(errors, schema, errorMessage) {
  if (errorMessage) {
    return addError(errors, schema, errorMessage);
  } else if (getError(errors, schema) !== undefined) {
    return removeError(errors, schema);
  }
  return errors;
}
github Talend / ui / packages / containers / src / ComponentForm / kit / defaultRegistry.js View on Github external
function getNewErrors(errors, schema, errorMessage) {
	if (errorMessage) {
		return addError(errors, schema, errorMessage);
	} else if (getError(errors, schema) !== undefined) {
		return removeError(errors, schema);
	}
	return errors;
}
github Talend / component-runtime / component-kit.js / src / service.js View on Github external
function getNewErrors(errors, schema, errorMessage) {
  if (errorMessage) {
    return addError(errors, schema, errorMessage);
  } else if (getError(errors, schema) !== undefined) {
    return removeError(errors, schema);
  }
  return errors;
}
github Talend / component-runtime / component-kit.js / src / service.js View on Github external
function getNewErrors(errors, schema, errorMessage) {
  if (errorMessage) {
    return addError(errors, schema, errorMessage);
  } else if (getError(errors, schema) !== undefined) {
    return removeError(errors, schema);
  }
  return errors;
}
github Talend / ui / packages / containers / src / ComponentForm / kit / defaultRegistry.js View on Github external
function getNewErrors(errors, schema, errorMessage) {
	if (errorMessage) {
		return addError(errors, schema, errorMessage);
	} else if (getError(errors, schema) !== undefined) {
		return removeError(errors, schema);
	}
	return errors;
}