Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
maxLength = (max: number, value: string, code: string): string => {
let message = Application.i18n(undefined, "validation.InputValidations", "maxLength");
let valueLength = (value === undefined || value === null) ? 0 : value.length;
/* eslint-disable no-eval */
let result = (valueLength > max) ?
template(message, {
max: max,
value: value,
code: code,
}) : undefined;
return result;
}
regex = (regex: string, value: any, code: string): string => {
minLength = (min: number, value: string, code: string): string => {
let message = Application.i18n(undefined, "validation.InputValidations", "minLength");
let valueLength = (value === undefined || value === null) ? 0 : value.length;
/* eslint-disable no-eval */
return (valueLength < min) ?
template(message, {
min: min,
value: value,
code: code,
}) : undefined;
}
maxLength = (max: number, value: string, code: string): string => {
required = (value: any, code: string): string => {
let message = Application.i18n(undefined, "validation.InputValidations", "required");
/* eslint-disable no-eval */
return (value === undefined || value === null || value === "" || value.length === 0) ?
template(message, {
value: value,
code: code
}) : undefined;
}
htmlRequired = (value: any, code: string): string => {
minValue = (minValue: number, value: number, code: string): string => {
let message = Application.i18n(undefined, "validation.InputValidations", "minValue");
/* eslint-disable no-eval */
return (value === undefined || value === null || value < minValue) ?
template(message, {
minValue: minValue,
value: value,
code: code
}) : undefined;
}
maxValue = (maxValue: number, value: number, code: string): string => {
maxValue = (maxValue: number, value: number, code: string): string => {
let message = Application.i18n(undefined, "validation.InputValidations", "maxValue");
/* eslint-disable no-eval */
return (value === undefined || value === null || value > maxValue) ?
template(message, {
maxValue: maxValue,
value: value,
code: code
}) : undefined;
}
minLength = (min: number, value: string, code: string): string => {
create: {
visible: false,
text: Application.i18n(DataGrid, "datagrid.DataGrid", "toolbar", "create"),
icon: "fa-plus",
onClick: this.props.onNewClick
},
edit: {
visible: false,
text: Application.i18n(DataGrid, "datagrid.DataGrid", "toolbar", "edit"),
icon: "fa-pencil",
onClick: this.props.onEditClick,
disabled: !this.state.hasSelection
},
delete: {
visible: false,
text: Application.i18n(DataGrid, "datagrid.DataGrid", "toolbar", "delete"),
icon: "fa-trash",
onClick: this.__showDeleteConfirm,
disabled: !this.state.hasSelection
}
};
Maps.forEach(this.props.toolbar, (item: Object) => {
if (is.string(item)) {
if (!(config[item] === undefined)) {
config[item].visible = true;
} else {
console.warn("command not found please use create,edit,delete or use your custom command"); //eslint-disable-line
}
} else if (is.hash(item)) {
if (config[item.name] === undefined) {
config[item.name] = {};
render(): Object {
return (
<h2>{Application.i18n(SampleProjects, "sampleprojects.SampleProjects", "title")}</h2>
<h5>{Application.i18n(SampleProjects, "sampleprojects.SampleProjects", "header")}</h5>
<br>
{this.renderProjects()}
);
}
render():Object {
return (
<div>
{Application.i18n(ButtonSample,"buttons.ButtonSample","buttonNormal")}
<div>
<button>Normal</button>
</div>
{Application.i18n(ButtonSample,"buttons.ButtonSample","buttonAsync")}
<div>
<button>{Application.i18n(ButtonSample,"buttons.ButtonSample","async")}</button>
</div>
<a rel="noopener noreferrer" href="https://react-bootstrap.github.io/components.html#buttons">{Application.i18n(ButtonSample,"buttons.ButtonSample","forMoreLink")}</a>
</div>
);
}
static onClick(e: Object) {
render() {
return (<div style="{NotFound.style}">
<img src="./notfound.gif">
<h1>{Application.i18n(NotFound,"error.NotFound","message")}</h1>
</div>);
}
constructor(props: Object) {
super(props);
this.strengthMessages = Application.i18n(PasswordInput, "inputs.PasswordInput", "strength");
}
/**