Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
message() {
return locale.t('h.validation.type.globalmobile');
}
} // international mobile
message() {
return locale.t('h.validation.type.url');
}
},
maxLen(value, configValue) {
if (configValue === null || configValue === undefined) {
return true;
}
let result = value !== null && value !== undefined && String(value).length <= configValue;
return result === true ? true : locale.t('h.validation.base.maxLen', { value: configValue });
},
minLen(value, configValue) {
required(value) {
let result = value !== null && value !== undefined && String(value).length > 0;
return result === true ? true : locale.t('h.validation.base.required');
},
maxLen(value, configValue) {
message() {
return locale.t('h.validation.type.number');
}
},
message() {
return locale.t('h.validation.type.tel');
}
},
function confirm(content, title) {
if (!title) {
title = locale.t('h.confirm.title');
}
return Confirm(content, title);
}
max(value, configValue) {
if (configValue === null || configValue === undefined) {
return true;
}
let result = value !== null && value !== undefined && Number(value) <= configValue;
return result === true ? true : locale.t('h.validation.base.max', { value: configValue });
},
min(value, configValue) {
minLen(value, configValue) {
if (configValue === null || configValue === undefined) {
return true;
}
let result = value !== null && value !== undefined && String(value).length >= configValue;
return result === true ? true : locale.t('h.validation.base.minLen', { value: configValue });
},
max(value, configValue) {
import locale from 'heyui/locale';
let valids = {
int: {
valid(value) {
return parseInt(value, 10) == value;
},
message: locale.t('h.validation.type.int')
},
number: {
valid(value) {
return !isNaN(Number(value));
},
message() {
return locale.t('h.validation.type.number');
}
},
email: {
pattern: /^[^\s]+@[^\s]+\.[^\s]+$/,
message() {
return locale.t('h.validation.type.email');
}
},
url: {