mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-16 04:53:18 +01:00
e03fea2e9b
Some missed changes after moving from Lion
26 lines
731 B
TypeScript
26 lines
731 B
TypeScript
import {Required as LionRequired} from "@lion/form-core";
|
|
|
|
export class Required extends LionRequired
|
|
{
|
|
/**
|
|
* Returns a Boolean. True if the test fails
|
|
* @param {?} [modelValue]
|
|
* @param {?} [param]
|
|
* @param {{}} [config]
|
|
* @returns {Boolean|Promise<Boolean>}
|
|
*/
|
|
execute(modelValue : any, param : any, config : {}) : boolean | Promise<boolean>
|
|
{
|
|
return modelValue == "" || modelValue == undefined || modelValue == null;
|
|
}
|
|
|
|
/**
|
|
* Give a message about this field being required. Could be customised according to MessageData.
|
|
* @param {MessageData | undefined} data
|
|
* @returns {Promise<string>}
|
|
*/
|
|
static async getMessage(data)
|
|
{
|
|
return data.formControl.egw().lang("Field must not be empty !!!");
|
|
}
|
|
} |